DEV Community

Cover image for How to Create a Virtual Machine (EC2) in AWS on Windows 10
BraimohVictoria
BraimohVictoria

Posted on

How to Create a Virtual Machine (EC2) in AWS on Windows 10

AWS EC2 (Elastic Compute 2) is one of the numerous services run and offered by Amazon. It is an essential part of modern business operations.

Whether you're here for some research, study or other purposes, this article will teach and show you how to create an Amazon Web Service (AWS) EC2 or a virtual machine on Microsoft Windows 10 and also how to terminate it to avoid unnecessary billing.

For better understanding, the article will be divided into three parts.

Part A: Creating an EC2 Instance
Part B: Connecting the Instance and
Part C: Terminating the EC2 Instance.

Let's head right in!

Part A
How to Create an EC2 Instance

Step 1. The first step before any other process is to create and Login to your AWS account. You can create a free one here if you do not already have an account and then follow the prompt.

Step 2. Navigate to the AWS Management Console or simply search for EC2 in the search bar and open the dashboard.

Image description

Step 3. The image below is what your dashboard should look like. You can see you have 0 instances running because you haven't created any. Now, click on Launch Instance.

Image description

Step 4: You need to choose a name for the instance you want to create. I chose mine as (Instance). You can pick your name or any other preferred word. Also, at the right hand side, you can choose the number of instances you want to create. Now, we are creating just 1.

Image description

Step 5: This step requires picking your AMI (Amazon Machine Image). This contains your operating system. (Linux, Ubuntu, Windows, Mac etc). We are creating a virtual machine on Windows 10, so, select Microsoft Windows.

Image description

Step 6: This is a very important step. You need to create a unique key pair for your instance. You will need this to login later on. Click on "Create new key pair"
Image description

Step 7: Choose a unique name for your key pair (A name that has not been used before). I chose mine as Vick. I also selected the .pem file because the .ppk file could not decrypt the password. Now, click on Create Key Pair.

Image description

Step 8: Here, the Key Pair has been created and automatically downloaded. (Take a look at the file highlighted in red below the screen)

Image description

Step 9: You will get a notification that your instance has been launched successfully.

Image description

Note: These are the necessary steps in this part. You can choose to configure other settings and the security group to your preference or just leave them as they are.

Part B
How to Connect an EC2 Instance

This part involves the necessary steps needed to connect your instance or virtual machine after it has been created.

Step 1: Go back to your instance. Click on it and select Connect at the top right of the screen. (Marked in red)

Image description

Step 2: Connect using RDP. Download the Remote Desktop File (RDP File). You should see it downloaded below your screen (Marked in red). Now, click on get password.

Image description

Step 3: To get the login password, you need the key pair that was created when you launched your instance. Remember it was “Vick.pem”. Click on “upload private key pair”. Select the .pem file and open.

Image description

Image description

Step 4: The image below is what your private key contents should look like. It MUST begin with “——-BEGIN RSA PRIVATE KEY——-”. Then, click on Decrypt password.

Image description

Step 5: Now, these are your login details. The Public DNS, Username and password. Copy them out and save somewhere.

Image description

Step 6: Click on the RDP file that was downloaded. It is marked in red below the screen

Image description

Step 7: This is what your Remote Desktop Connection should look like. Click on connect

Image description

Step 8: Enter the password that you saved somewhere and click ok.

Image description

Step 9: Here we go! The virtual machine has been connected successfully. Click the “x” button to leave the interface.

Image description

Part C
How to Terminate an EC2 Instance

This part involves the steps needed to terminate the instance in order to avoid unnecessary billing.

Step 1: Go back to your EC2 Dashboard and click Instances. You should have 1 instance running now.

Image description

Step 2: Select the instance and click “Instance State”. (Marked in red). From the drop down options, choose terminate instance.

Image description

Step 3: Confirm you want to terminate.

Image description

Step 4: The instance status will change from “running” to “shutting down”.

Image description

Step 5: Now, the instance status will change again from “shutting down” to “terminated”.

Image description

Congratulations! You just created, connected and terminated an AWS EC2 or Virtual Machine on Windows 10.

I hope this article was the perfect guide. I also hope it helped. Feel free to leave your questions and/or comments (if any). I'll be glad to help further.

Top comments (2)

Collapse
 
chymee profile image
Amadi Chimeremma

beautiful!

Collapse
 
braimohvictoria profile image
BraimohVictoria

Thank you 🙏