Skip to content

Instantly share code, notes, and snippets.

@tsal
Forked from peterforgacs/Windows10AWSEC2.md
Created February 25, 2020 13:17
Show Gist options
  • Save tsal/b8b3546c20f439b397800c92f65e5be5 to your computer and use it in GitHub Desktop.
Save tsal/b8b3546c20f439b397800c92f65e5be5 to your computer and use it in GitHub Desktop.

Revisions

  1. @peterforgacs peterforgacs revised this gist Apr 14, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -46,15 +46,15 @@ Note that P2 instances are only avalible in the US.
    The bucketname must be unique.

    ````bash
    aws s3 mb s3://bucketname --region eu-central-1
    aws s3 mb s3://peterforgacs --region eu-central-1
    ````

    # Upload image to s3
    Move to the folder you store the virtual machine file and upload the virtual image to the s3 bucket.

    ````bash
    cd myvmfolder
    aws s3 cp myimage.vhd s3://bucketname --region eu-central-1
    aws s3 cp codexaws.vhd s3://peterforgacs --region eu-central-1
    ````

    # Configuration files
    @@ -134,7 +134,7 @@ Create a configuration file on your computer called containers.json.
    Replace bucketname and myimage.vhd with your bucket and image name.
    ````json
    [{ "Description": "Windows 10 Base Install", "Format": "vhd", "UserBucket": { "S3Bucket": "bucketname", "S3Key": "myimage.vhd" } }]
    [{ "Description": "Windows 10 Base Install", "Format": "vhd", "UserBucket": { "S3Bucket": "peterforgacs", "S3Key": "codexaws.vhd" } }]
    ````
    # Create EC2 AMI from S3 VHD image
  2. @peterforgacs peterforgacs revised this gist Apr 14, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    # Running Windows 10 on AWS EC2
    # Downloading the image

    Download the windows image you want.
  3. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -155,8 +155,8 @@ When the import status is completed you can head to the EC2 console and select t
    Images -> AMI -> Right click -> Launch
    Instance type: g2 (You might have to ask the support for an increase in the g2 limit).
    Security Group: Allow RDP, Teamviewer ports.
    * Instance type: g2 (You might have to ask the support for an increase in the g2 limit).
    * Security Group: Allow RDP, Teamviewer ports.
    Instances -> Launch
    @@ -175,4 +175,4 @@ pass
    # Post Install
    Reassign teamviewer to the your teamviewer.
    Download nvidia experience and download a driver.
    Download nvidia experience and install a driver.
  4. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u

    # Creating the virtual machine

    * Use virtualbox to create a new virtual machine, make sure that it uses the VHD format.
    * Use virtualbox to create a new virtual machine, make sure that it uses the VHD format (The OS is 20 gigabyte).
    * Install the Windows 10 image onto it.
    * Make sure to set a username password on the administrator account otherwise cannot connect trough remote desktop.
    * Install teamviewer on the virtual machine grant easy access to yourself and check extras->options
    @@ -20,9 +20,9 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u
    * Start -> Allow remote access to your computer
    * Allow remote connections to this computer
    * Install ec2 configure service http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_Install.html
    Restart the virtual machine.
    Wait for windows 10 updates to install.
    Exit the virtual machine.
    * Restart the virtual machine.
    * Wait for windows 10 updates to install.
    * Exit the virtual machine.

    # Install and configure awscli
    ```bash
  5. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -175,4 +175,4 @@ pass
    # Post Install
    Reassign teamviewer to the your teamviewer.
    Download nvidia experiance and downlad a driver.
    Download nvidia experience and download a driver.
  6. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -13,12 +13,13 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u

    * Use virtualbox to create a new virtual machine, make sure that it uses the VHD format.
    * Install the Windows 10 image onto it.
    * Make sure to set a username password on the administrator account.
    * Make sure to set a username password on the administrator account otherwise cannot connect trough remote desktop.
    * Install teamviewer on the virtual machine grant easy access to yourself and check extras->options
    * General -> Network Settings: Accept Incoming Lan Connections
    * Security -> Windows logon: Allowed for all users
    * Start -> Allow remote access to your computer
    * Allow remote connections to this computer
    * Install ec2 configure service http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_Install.html
    Restart the virtual machine.
    Wait for windows 10 updates to install.
    Exit the virtual machine.
    @@ -165,14 +166,13 @@ Instances -> Right click -> Connect
    You download the remote desktop file.
    Launch that file with the username and password you set on the original
    In the form:
    Launch that file with the username and password you set on the original instance.
    In the form:
    .\Username
    pass
    # Post Install
    Download nvidia experiance and downlad a driver.
    Reassign teamviewer to the your teamviewer.
    Download nvidia experiance and downlad a driver.
  7. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -171,5 +171,8 @@ In the form:
    .\Username
    pass
    # Post Install
    Download nvidia experiance and downlad a driver.
  8. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 25 additions and 2 deletions.
    27 changes: 25 additions & 2 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,8 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u
    * Security -> Windows logon: Allowed for all users
    * Start -> Allow remote access to your computer
    * Allow remote connections to this computer
    Restart the virtual machine.
    Wait for windows 10 updates to install.
    Exit the virtual machine.

    # Install and configure awscli
    @@ -133,10 +135,10 @@ Replace bucketname and myimage.vhd with your bucket and image name.
    [{ "Description": "Windows 10 Base Install", "Format": "vhd", "UserBucket": { "S3Bucket": "bucketname", "S3Key": "myimage.vhd" } }]
    ````
    Start to import from S3 to Ec2.
    # Create EC2 AMI from S3 VHD image
    ````bash
    aws ec2 import-image --description "Windows 2008 OVA" --disk-containers file://containers.json --region eu-central-1
    aws ec2 import-image --description "Windows 10" --disk-containers file://containers.json --region eu-central-1
    ````
    This may take a while you can check on the status of the import.
    @@ -148,5 +150,26 @@ aws ec2 describe-import-image-tasks --region eu-central-1
    When the import status is completed you can head to the EC2 console and select the correct region.
    # Create EC2 instance from AMI
    Images -> AMI -> Right click -> Launch
    Instance type: g2 (You might have to ask the support for an increase in the g2 limit).
    Security Group: Allow RDP, Teamviewer ports.
    Instances -> Launch
    # Running the instance
    Instances -> Right click -> Connect
    You download the remote desktop file.
    Launch that file with the username and password you set on the original
    In the form:
    .\Username
    pass
  9. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -15,10 +15,10 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u
    * Install the Windows 10 image onto it.
    * Make sure to set a username password on the administrator account.
    * Install teamviewer on the virtual machine grant easy access to yourself and check extras->options
    ** General -> Network Settings: Accept Incoming Lan Connections
    ** Security -> Windows logon: Allowed for all users
    * General -> Network Settings: Accept Incoming Lan Connections
    * Security -> Windows logon: Allowed for all users
    * Start -> Allow remote access to your computer
    **Allow remote connections to this computer
    * Allow remote connections to this computer
    Exit the virtual machine.

    # Install and configure awscli
  10. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -15,10 +15,10 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u
    * Install the Windows 10 image onto it.
    * Make sure to set a username password on the administrator account.
    * Install teamviewer on the virtual machine grant easy access to yourself and check extras->options
    * * General -> Network Settings: Accept Incoming Lan Connections
    * * Security -> Windows logon: Allowed for all users
    ** General -> Network Settings: Accept Incoming Lan Connections
    ** Security -> Windows logon: Allowed for all users
    * Start -> Allow remote access to your computer
    * * Allow remote connections to this computer
    **Allow remote connections to this computer
    Exit the virtual machine.

    # Install and configure awscli
  11. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,8 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u
    * Install teamviewer on the virtual machine grant easy access to yourself and check extras->options
    * * General -> Network Settings: Accept Incoming Lan Connections
    * * Security -> Windows logon: Allowed for all users

    * Start -> Allow remote access to your computer
    * * Allow remote connections to this computer
    Exit the virtual machine.

    # Install and configure awscli
  12. @peterforgacs peterforgacs revised this gist Apr 13, 2017. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -11,10 +11,13 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u

    # Creating the virtual machine

    Use virtualbox to create a new virtual machine, make sure that it uses the VHD format.
    Install the Windows Image onto it.
    Make sure to set a username password combo.
    Install teamviewer on the virtual machine or enable remote desktop.
    * Use virtualbox to create a new virtual machine, make sure that it uses the VHD format.
    * Install the Windows 10 image onto it.
    * Make sure to set a username password on the administrator account.
    * Install teamviewer on the virtual machine grant easy access to yourself and check extras->options
    * * General -> Network Settings: Accept Incoming Lan Connections
    * * Security -> Windows logon: Allowed for all users

    Exit the virtual machine.

    # Install and configure awscli
  13. @peterforgacs peterforgacs revised this gist Apr 12, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -31,6 +31,7 @@ AWS secret access key.
    Default region.

    If you set a default region you dont have to specify the region parameter in the following commands.
    Note that P2 instances are only avalible in the US.

    # Create an S3 bucket

  14. @peterforgacs peterforgacs revised this gist Apr 11, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -136,8 +136,12 @@ aws ec2 import-image --description "Windows 2008 OVA" --disk-containers file://c
    This may take a while you can check on the status of the import.
    ````bash
    aws ec2 describe-import-image-tasks --region eu-central-1
    ````
    After the AMI is created you can navigate to the EC2 console, select the correct region.
    When the import status is completed you can head to the EC2 console and select the correct region.
  15. @peterforgacs peterforgacs revised this gist Apr 11, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Windows10AWSEC2.md
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,7 @@ You can download the trial Enterprise trial here: https://www.microsoft.com/en-u

    Use virtualbox to create a new virtual machine, make sure that it uses the VHD format.
    Install the Windows Image onto it.
    Make sure to set a username password combo.
    Install teamviewer on the virtual machine or enable remote desktop.
    Exit the virtual machine.

  16. @peterforgacs peterforgacs renamed this gist Apr 10, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  17. @peterforgacs peterforgacs revised this gist Apr 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -130,7 +130,7 @@ Replace bucketname and myimage.vhd with your bucket and image name.
    Start to import from S3 to Ec2.
    ````bash
    aws ec2 import-image --description "Windows 2008 OVA" --disk-containers file://containers.json
    aws ec2 import-image --description "Windows 2008 OVA" --disk-containers file://containers.json --region eu-central-1
    ````
    This may take a while you can check on the status of the import.
  18. @peterforgacs peterforgacs revised this gist Apr 10, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #Downloading the image
    # Downloading the image

    Download the windows image you want.

  19. @peterforgacs peterforgacs revised this gist Apr 10, 2017. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -9,15 +9,15 @@ So Home wont work.

    You can download the trial Enterprise trial here: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise

    #Creating the virtual machine
    # Creating the virtual machine

    Use virtualbox to create a new virtual machine, make sure that it uses the VHD format.
    Install the Windows Image onto it.
    Install teamviewer on the virtual machine or enable remote desktop.
    Exit the virtual machine.

    #Install and configure awscli
    ````bash
    # Install and configure awscli
    ```bash
    sudo apt install awscli
    aws configure
    ````
    @@ -31,15 +31,15 @@ Default region.

    If you set a default region you dont have to specify the region parameter in the following commands.

    #Create an S3 bucket
    # Create an S3 bucket

    The bucketname must be unique.

    ````bash
    aws s3 mb s3://bucketname --region eu-central-1
    ````

    #Upload image to s3
    # Upload image to s3
    Move to the folder you store the virtual machine file and upload the virtual image to the s3 bucket.

    ````bash
    @@ -51,7 +51,7 @@ aws s3 cp myimage.vhd s3://bucketname --region eu-central-1

    Create a trust policy in the file trust-policy.json

    ````json
    ```json
    {
    "Version": "2012-10-17",
    "Statement": [
  20. @peterforgacs peterforgacs created this gist Apr 10, 2017.
    142 changes: 142 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,142 @@
    #Downloading the image

    Download the windows image you want.

    AWS vmimport supported versions:
    Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

    So Home wont work.

    You can download the trial Enterprise trial here: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise

    #Creating the virtual machine

    Use virtualbox to create a new virtual machine, make sure that it uses the VHD format.
    Install the Windows Image onto it.
    Install teamviewer on the virtual machine or enable remote desktop.
    Exit the virtual machine.

    #Install and configure awscli
    ````bash
    sudo apt install awscli
    aws configure
    ````

    http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html
    During configure you can add your:

    AWS access key.
    AWS secret access key.
    Default region.

    If you set a default region you dont have to specify the region parameter in the following commands.

    #Create an S3 bucket

    The bucketname must be unique.

    ````bash
    aws s3 mb s3://bucketname --region eu-central-1
    ````

    #Upload image to s3
    Move to the folder you store the virtual machine file and upload the virtual image to the s3 bucket.

    ````bash
    cd myvmfolder
    aws s3 cp myimage.vhd s3://bucketname --region eu-central-1
    ````

    # Configuration files

    Create a trust policy in the file trust-policy.json

    ````json
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Principal": { "Service": "vmie.amazonaws.com" },
    "Action": "sts:AssumeRole",
    "Condition": {
    "StringEquals":{
    "sts:Externalid": "vmimport"
    }
    }
    }
    ]
    }
    ````

    Create a vmimport role and add vim import/export access to it.

    ````bash
    aws iam create-role --role-name vmimport --assume-role-policy-document file://trust-policy.json
    ````

    Create a file named role-policy.json replace the !!REPLACEME!! to the bucketname you are using.

    ````json
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Action": [
    "s3:ListBucket",
    "s3:GetBucketLocation"
    ],
    "Resource": [
    "arn:aws:s3:::!!REPLACEME!!"
    ]
    },
    {
    "Effect": "Allow",
    "Action": [
    "s3:GetObject"
    ],
    "Resource": [
    "arn:aws:s3:::!!REPLACEME!!/*"
    ]
    },
    {
    "Effect": "Allow",
    "Action":[
    "ec2:ModifySnapshotAttribute",
    "ec2:CopySnapshot",
    "ec2:RegisterImage",
    "ec2:Describe*"
    ],
    "Resource": "*"
    }
    ]
    }
    ````

    Add the policy to the vmimport role.

    ````bash
    aws iam put-role-policy --role-name vmimport --policy-name vmimport --policy-document file://role-policy.json
    ````

    Create a configuration file on your computer called containers.json.
    Replace bucketname and myimage.vhd with your bucket and image name.

    ````json
    [{ "Description": "Windows 10 Base Install", "Format": "vhd", "UserBucket": { "S3Bucket": "bucketname", "S3Key": "myimage.vhd" } }]
    ````

    Start to import from S3 to Ec2.

    ````bash
    aws ec2 import-image --description "Windows 2008 OVA" --disk-containers file://containers.json
    ````

    This may take a while you can check on the status of the import.

    ````bash
    aws ec2 describe-import-image-tasks --region eu-central-1
    ````

    After the AMI is created you can navigate to the EC2 console, select the correct region.