In this tutorial, you will learn how to launch, configure, and connect to a Windows Virtual Machine using Amazon Elastic Compute Cloud (EC2).  Amazon EC2 is the Amazon Web Service you use to create and run virtual machines in the cloud (we call these virtual machines 'instances').  Everything done in this tutorial is free tier eligible.

Launching a Virtual Machine with AWS Requires an Account

Create a Free Account in Minutes

AWS Free Tier includes 750 hours of Linux and Windows t2.micro instances each month for one year. To stay within the Free Tier, use only EC2 Micro instances.

View AWS Free Tier Details »

When you click here, the AWS management console will open in a new browser tab, so you can keep this tutorial open.  Find EC2 under Compute and click to open the Amazon EC2 Console.

launch-windows-vm-0

(click to zoom)

launch-windows-vm-0

a. You are now in the Amazon EC2 console. Click Launch Instance 

launch-windows-vm-1

(click to zoom)

launch-windows-vm-1

b.  With Amazon EC2, you can specify the software and specifications of the instance you want to use.  In this screen, you are shown options to choose an Amazon Machine Image (AMI), which is a template that contains the software configuration required to launch your instance.  

For this tutorial, find Microsoft Windows Server 2012 R2 Base and click Select.

launch-windows-vm-2

(click to zoom)

launch-windows-vm-2

c.  You will now choose an instance type.  Instance types comprise of varying combinations of CPU, memory, storage, and networking capacity so you can choose the appropriate mix for your applications. For more information, see Amazon EC2 Instance Types.

For this tutotiral, selct the default option of t2.micro - this instance type is covered within the free tier. Then click Review and Launch at the bottom of the page.

launch-windows-vm-3

(click to zoom)

launch-windows-vm-3

d. You can review the options that are selected for your instance which include AMI Details, Instance Type, Security Groups, Instance Details, Storage, and Tags.  You can leave these at the defaults and click Launch from the bottom of the page.

Note: For detailed information on your options, see Launching an Instance

launch-windows-vm-4

(click to zoom)

launch-windows-vm-4

To connect to your virtual machine, you need a key pair. A key pair is used to log into your instance (just like your house key is used to enter your home).


a. In the popover, select Create a new key pair and name it MyFirstKey. Then click Download Key Pair. MyFirstKey.pem will be downloaded to your computer -- make sure to save this key pair in a safe location on your computer. 

  • Windows users: We recommend saving your key pair in your user directory in a sub-directory called .ssh (ex.C:\user\{yourusername}\.ssh\MyFirstKey.pem).
  • Mac/Linux users: We recommend saving your key pair in the .ssh sub-directory from your home directory (ex.~/.ssh/MyFirstKey.pem).

Note: If you don't remember where you store your SSH private key (the file you are downloading), you won't be able to connect to your virtual machine.

launch-windows-vm-6

(click to zoom)

launch-windows-vm-6

b. After you have downloaded and saved your key pair, click Launch Instance to start your Windows Server instance.

Note: It can take a few minutes to launch your instance.

launch-windows-vm-6

(click to zoom)

launch-windows-vm-6

c. On the next screen, click View Instances to view the instance you have just created and see its status.

launch-windows-vm-7

(click to zoom)

launch-windows-vm-7

After launching your instance, it's time to connect to it using an RDP client.


a. Select the Windows Server instance you just created and click Connect

launch-windows-vm-8

(click to zoom)

launch-windows-vm-8

b.  In order to connect to your Windows virtual machine instance, you will need a user name and password:

  • The User name defaults to Administrator
  • To receive your password, click Get Password
launch-windows-vm-10

(click to zoom)

launch-windows-vm-10

c.  In order to retrieve the password, you will need to locate the Key Pair you created in Step 3. Click Choose File and browse to the directory you stored MyFirstKey.pem.  Your Key Pair will surface in the text box. Click Decrypt Password.

launch-windows-vm-12

(click to zoom)

launch-windows-vm-12

d.  You now have a decrypted password for your Windows Server instance. Make sure to save this information in a secure location. It is your Windows Server admin login credentials.

launch-windows-vm-11

(click to zoom)

launch-windows-vm-11

e.  Click Download Remote Desktop File and open the file.

launch-windows-vm-9

(click to zoom)

launch-windows-vm-9

f. When prompted log in to the instance, use the User Name and Password you generated in to connect to your virtual machine.

Note: When you complete this step, you might get a warning that the security certificate could not be authenticated. Simply choose yes and proceed to complete the connection to your Windows Server instance

launch-windows-vm-20

(click to zoom)

launch-windows-vm-20

You can easily terminate the Windows Server VM from the Amazon EC2 console. In fact, it is a best practice to terminte instances you are no longer using so you don’t keep getting charged for them.


a. Back on the EC2 Console, select the box next to the instance you created.  Then click the Actions button, navigate to Instante State, and click Terminate.

launch-windows-vm-18

(click to zoom)

launch-windows-vm-18

b. You will be asked to confirm your termination - select Yes, Terminate.

Note: This process can take several seconds to complete.  Once your instnaces has been terminated, the Instance State will change to terminated on your EC2 Console.

launch-windows-vm-19

(click to zoom)

launch-windows-vm-19

You have created, configured, and connected to your first Windows Virtual Machine in the cloud with Amazon EC2.  Without the cost and complexity of purchasing servers or managing data centers, you have more resources to focus on your solution.

Now that you have learned to create, configure, and connect to a Windows Virtual Machine in the cloud, you can progress to the next tutorial where you will learn how to deploy a WordPress Blog on an Amazon EC2 Instance.

Deploy a WordPress Blog on an Amazon EC2 Instance »

Yes
No