DEV Community

Cover image for How to create a virtual machine on AWS
Rashidat Jimoh
Rashidat Jimoh

Posted on

How to create a virtual machine on AWS

Introduction to Virtual Machines and Cloud-Based Computing with Amazon EC2

A virtual machine is a software based computer that resides within another computer's operating system. It is essentially creating another computer within a computer.
A virtual machine in the cloud is similar to a traditional virtual machine. However it is hosted and managed by a cloud service provider such as Amazon Web Services (AWS), Google Cloud Platform or Microsoft Azure.

Amazon Elastic Compute Cloud (Amazon EC2) is a cloud computing service provided by AWS. It allows users to launch virtual machines known as EC2 instances.

Step-by-step process to create a virtual machine on AWS

This guide will walk through the process of setting up a virtual machine using Amazon EC2.

  • Step 1: Create or login to your AWS account.

  • Step 2:Login into the AWS Management Console.

  • Step 3: Select a region where you want to launch the virtual machine. The AWS regions is located in the top right of the navigation bar on your console page.
    AWS region on the navigation bar

  • Step 4: Click on 'Services' at the top left of the navigation bar and select 'Compute'.
    AWS Services

  • Step 5: From 'Compute' click on EC2. This opens up the EC2 Dashboard.
    EC2 Dashboard

  • Step 6: Once in the EC2 Dashboard, click on 'Launch Instance'.
    Launch Instance image

  • Step 7: Enter in a name for your virtual machine instance.
    Instance name

  • Step 8: Under the Application and OS Images section, select the operating system and machine configurations you prefer.
    Application and OS Images section

  • Step 9: Select the instance type that meets your computing, memory or storage needs.
    Instance type section

  • Step 10: Enter a key pair name. The key pair name will be downloaded to your system and you will use the key pair to securely connect to your instance. Save the key pair in a location that will be easy to remember and access.
    Key pair name section

  • Step 11: Configure network settings and storage.
    Network settings and storage

  • Step 12: Configure advanced details (if required).

  • Step 13: Click on Launch instance.
    Instance launched

  • Step 14: After you successfully launch your Instance, navigate to the instance and select it.
    Instance selected

  • Step 15: Click on connect and select 'RDP Client' and go to 'Get password'.

RDP Client-Password

  • Step 16: Once in the Get password tab, upload your private key file, decrypt the password and then copy the password.
    Password decrypted

  • Step 17: Download your remote desktop file.
    For Mac users that configured a virtual Window OS, ensure you download a remote desktop from the app store before downloading the remote desktop file. The remote desktop file is needed to connect to your instance using the remote desktop connect app.

  • Step 18: Navigate to the remote desktop file after downloading, open it with the remote desktop app and enter in your password.
    Password entered on remote desktop app

After you input your password, the system will log you into your new virtual Window OS, and you can begin using it.
Virtual Window OS

How to delete your virtual machine

If you no longer have use for your virtual machine, you can close it and perform the following steps to delete it on AWS.

  1. Open the Amazon EC2 console again and select 'Instances' from the navigation pane.
  2. Select the Instance you want to delete. Instance selected
  3. Click on 'Instance State' and then select Terminate'. Terminate Instance
  4. In the "Terminate Instance" dialog box, click on 'Terminate'. Terminate Instance dialog box
  5. After termination is complete, a successful termination message appears at the top of the screen. Successful termination of Instance

Top comments (3)

Collapse
 
bcouetil profile image
Benoit COUETIL 💫 • Edited

You should try Terraform. These hours of trying to pop up a VM with the right parameters become... 15s.

Collapse
 
rashidatjay profile image
Rashidat Jimoh

Thanks.

Collapse
 
chymee profile image
Amadi Chimeremma

lovely!