DEV Community

Cover image for How to Create Virtual Machines: A Step-by-Step Guide
Onyemachi Doris
Onyemachi Doris

Posted on

How to Create Virtual Machines: A Step-by-Step Guide

Table of Contents

  • Introduction to Virtual Machines
  • Benefits of Using Virtual Machines
  • Step-by-Step Guide to Creating a Virtual Machine in Azure
  • Conclusion

Introduction to Virtual Machines

A virtual machine (VM) is a computer system that is imitated and runs on top of a physical machine (the host). They allow you to run multiple operating systems (guests) on a single physical server.

Benefits of Using Virtual Machines

Numerous industries, including IT, development, and businesses can benefit greatly from using virtual machines (VMs). Some of these benefits include:

1. Efficient Resource Utilization
Virtual machines (VMs) make maximum use of the hardware resources, such as CPU, memory, and storage, on a single physical server by enabling the simultaneous operation of several operating systems and applications. With the use of virtual machines, multiple workloads can be operated on fewer physical servers which lowers the cost of hardware, power consumption, cooling requirements, and physical space in data centers.

2. Isolation and Security
Every virtual machine functions independently of the others, so if one fails or is compromised, it has no effect on the host system or the other VMs. Because of their isolation, virtual machines (VMs) are perfect for testing or executing potentially dangerous software without impacting production environments. They can also be used to create sandboxed environments where malware or vulnerabilities are contained. This thereby reduces security risks to the overall system.

3. Easy Backup, Cloning, and Recovery
VMs provides easy backup because it allows you to take snapshots of the system state at any point in time. If for an example, an update or configuration change causes problems, you can easily revert to the snapshot without data loss. Quick cloning of virtual machines (VMs) facilitates the deployment of identical systems for testing, development, and production.

Step-by-Step Guide to Creating a Virtual Machine in Azure

1️⃣ Create a Free Trial Account
To Do: Create a free trial account in Azure. This provides a subscription and $200 Azure credits.

2️⃣ Login to Azure Account
To Do: Go to portal.azure.com and log in with your credentials (username and password).

3️⃣ Search for Virtual Machines
To Do: In the “Search resources, services and docs” field, type “virtual machines”. You can also find it by clicking on the hamburger icon and scrolling through the options or by clicking on the “Create a resource” button and typing “virtual machine”.

Image description

4️⃣ Select Virtual Machine
To Do: From the list of search results, click on the “Virtual machine” option. The best option is usually highlighted.

5️⃣ Start the Creation Process
To Do: Click the “Create” button to start the virtual machine creation process. Choose “Create a virtual machine hosted by Azure”.

Image description

6️⃣ Enter Project Details
To Do: Select the appropriate subscription and create a resource group by clicking the “Create resource group” button and giving it a name. Also provide a name for your virtual machine.

Image description

7️⃣ Enter Virtual Machine Details
To Do: Provide information about your virtual machine, such as the operating system (choose either Ubuntu Server 20.04 or Windows Server Datacenter -x64 G2), size, and other configuration settings. Leave other options as default.

Image description

8️⃣ Create an Administrator Account
To Do: Choose “Password” for the authentication type. Use “Azureuser” for the username and “Password1234” for the password.

Image description

9️⃣ Select Inbound Port Rules
To Do: Select SSH if you chose a Linux VM and RDP if it’s a Windows VM. This allows IP addresses to connect to the VM.

Image description

🔟 Check Licensing
To Do: By default, this is unchecked. Click the box to check it.

Image description

1️⃣1️⃣ Disable Boot Diagnostics
To Do: Click “Next” until you reach the “Boot diagnostics” in the Monitoring tab, and click on “Disable”.

Image description

1️⃣2️⃣ Review and Create
To Do: Click on the “Review + Create” button. If the validation passes, the deployment will proceed. If not, note any recommendations, fix them, and try again. Deployment might take 3-5 minutes.

Image description

1️⃣3️⃣ Check the Status
To Do: If the VM is running, the task has succeeded. Then, click on "Go to Resource".

Image description

1️⃣4️⃣ Access the Virtual Machine
To Do: Once the virtual machine is deployed, click on the “Connect” button in the virtual machine blade in the Azure portal.

Image description

1️⃣5️⃣ Download RDP File
To Do: Click “Native RDP”, select, and wait for the configured sign to be displayed on the right-hand side. Download the RDP file.

Image description

1️⃣6️⃣ Connect to the VM
To Do: Open the RDP file from your local computer and click on “Connect”. Enter the admin details created during the VM setup.

Image description

1️⃣7️⃣ Follow the Prompt
To Do: Follow the prompt and click “Continue”. Use the username and password created for the admin section.

1️⃣8️⃣ Wait for Configuration
To Do: Wait for the remote PC to be configured.

1️⃣9️⃣ Start Using the VM
To Do: Once the connection is successful, start using your virtual machine!

Image description

Conclusion

Creating and managing virtual machines is a crucial skill for system administrators, developers, and IT professionals. It provides flexibility, efficiency, and scalability for both testing and production environments.

Don't forget to like, comment, share and subscribe!

Top comments (0)