AWS EC2에서 VM Import를 통해 Windows 10 설치하는 방법
Source: Dev.to
Prerequisites
AWS VM Import는 다음 Windows 10 에디션을 지원합니다: Professional, Enterprise, 그리고 Education (64‑bit, 영어). Home 에디션은 지원되지 않습니다.
Enterprise 체험판은 Microsoft 웹사이트에서 다운로드할 수 있습니다.
Create the Virtual Machine
- VirtualBox에서 VHD, VMDK, 또는 OVA 디스크 형식으로 새로운 VM을 생성합니다 (시스템 디스크는 약 20 GB).
- Windows 10을 설치합니다 – 관리자 비밀번호를 설정해야 합니다 (설정하지 않으면 나중에 원격 데스크톱으로 연결할 수 없습니다).
- TeamViewer를 설치하고 Easy Access를 구성한 뒤 LAN 연결 및 Windows 로그인 기능을 활성화합니다.
- 원격 데스크톱을 활성화합니다 (시작 → 원격 액세스 허용).
EC2 Config Service를 설치합니다.
- 재부팅하고 Windows Update가 완료될 때까지 기다린 뒤 종료합니다.
Install AWS CLI
sudo apt install awscli
aws configure
Access Key, Secret Key, 그리고 기본 Region을 설정합니다. P2 인스턴스는 미국 리전에서만 사용할 수 있다는 점에 유의하세요.
Upload the Image
S3 버킷을 생성합니다 (버킷 이름은 전 세계에서 고유해야 합니다):
aws s3 mb s3://your-bucket-name --region eu-central-1
VHD 파일을 업로드합니다:
aws s3 cp codexaws.vhd s3://your-bucket-name --region eu-central-1
Set Up IAM Role
trust-policy.json을 생성합니다:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "Service": "vmie.amazonaws.com" },
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": { "sts:Externalid": "vmimport" }
}
}]
}
역할을 생성합니다:
aws iam create-role --role-name vmimport --assume-role-policy-document file://trust-policy.json
role-policy.json을 생성하고 YOUR-BUCKET-NAME을 실제 버킷 이름으로 교체합니다:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:ListBucket", "s3:GetBucketLocation"],
"Resource": ["arn:aws:s3:::YOUR-BUCKET-NAME"]
},
{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::YOUR-BUCKET-NAME/*"]
},
{
"Effect": "Allow",
"Action": ["ec2:ModifySnapshotAttribute", "ec2:CopySnapshot", "ec2:RegisterImage", "ec2:Describe*"],
"Resource": "*"
}
]
}
정책을 연결합니다:
aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file://role-policy.json
Import the Image
containers.json을 생성합니다:
[{
"Description": "Windows 10 Base Install",
"Format": "vhd",
"UserBucket": {
"S3Bucket": "your-bucket-name",
"S3Key": "codexaws.vhd"
}
}]
이미지를 가져옵니다:
aws ec2 import-image --description "Windows 10" --disk-containers file://containers.json --region eu-central-1
진행 상황을 확인합니다:
aws ec2 describe-import-image-tasks --region eu-central-1
Launch the EC2 Instance
이미지 가져오기가 완료되면 EC2 콘솔로 이동합니다:
Images → AMI → 오른쪽 클릭 → Launch
- g2 인스턴스 유형을 선택합니다 (먼저 AWS에 한도 증액을 요청해야 할 수 있습니다).
- 보안 그룹에서 RDP와 TeamViewer 포트를 열어줍니다.
- 인스턴스를 시작한 뒤 Connect를 사용해 RDP 파일을 다운로드하고, 앞서 설정한 자격 증명으로 로그인합니다.
Post‑Installation Setup
- TeamViewer 계정을 다시 연결합니다.
- NVIDIA 드라이버를 설치합니다.
ENA Enhanced Networking 활성화를 위한 문서를 참고하세요.