DEV Community

Lauren Omosa
Lauren Omosa

Posted on

Creating a virtual machine with AWS

Creating a virtual machine on AWS is as simple as cutting a slice of birthday cake :). Whether you are a beginner or an expert in cloud computing and have difficulty in setting up a virtual machine in AWS, you can follow these simple steps:

1. Set up an account
To set up an account head over to AWS Free Cloud Computing Services and create an account if you do not have one.

AWS Set up
You have to fill in the correct details, and also set up your card details so that you can be able to access all features of AWS. AWS will only hold $1 for you to be able to create a virtual machine so this is very important for you to note.

2. EC2 Services.
Once you have completed your account setup, you can login as root user and you'll be directed to the console home. On the navigation bar, you will see a services icon and that will lead you to a sub menu where you can pick the compute section and see the EC2 service where we will be able to create virtual servers in the cloud.

EC2 Services

3. Creating an instance
After successfully heading to the EC2 dashboard, you will be able to see and monitor all EC2 resources that are running on your account. To create an instance, on the side bar, you will select the instances option and click on the 'launch instance' button.

EC2

After clicking the button you will be able to see the following page where you can choose the features of your instance. The first step is naming your instance and you have to make sure it is a unique name so that it will not be rejected.

Name

Then you will have to select the operating system that you want your virtual machine to run on such as aws linux,mac os, ubuntu, windows, redhat etc., but for this instance let us go with windows.

Operating System

After that you can select the instance type. There are many instance types you can choose from with different storage capacities and pricing but for this instance, we will go with the default one.

Instance Type

The third step is choosing a key pair. If you do not have one you will have to create one so that it will be able to connect with the RDP.

Create Key pair
Use the OpenSSH (pem) key for this instance for ease of use. Click on the create key pair button and this will automatically download a file that will be used later.

pem
After successfully creating a key pair, you leave the rest as default and head over to the summary section to ensure you got all the details of your instance correctly. If the details are okay, you can click on the 'launch instance' button to create your instance.

key pair
A successful instance launch will prompt the message below.

success instance
4. Connecting to RDP
To connect to an RDP, you will head over to the instances and select the instance that we created and click on the connect button that is right above it.
connect

If you are connecting it using a windows machine, head over to the RDP Client section and select it. This will lead you to the RDP client settings and you will be able to get the password for it.
rdp
We previously had a file that automatically downloaded when we created a key pair. We will upload that file private key file here. Decrypt the password and copy it for later use.

decrypt

Now we can download the Remote desktop file and run it.

remote desktop file

A window pop up will show up and you will have to enter the password that you had copied earlier.
password

Allow connections to the RDP and wait for the virtual machine to load. The following will show up after successful connection.

virtual machine

You have successfully created a virtual machine! Hurray!!

4. Terminating an instance

Remember that you have to terminate an instance in order to not accumulate charges on your account. To terminate your instance you select the instance and click on instant state as shown below. You will have a choice on which instant state you want and select terminate instance.

Terminate Instance

After selecting terminate instance a pop up window will appear asking you to confirm if you want to terminate the instance. Click terminate and proceed.

terminate pop up

You will see a message showing that you have successfully terminated the instance and therefore it is not running anymore and you will not accrue any charges on your account.

success termination

You have finally learnt how to create a virtual machine in AWS. Great Job !!

Top comments (0)