AZURE Virtual Machines(VMs).Creation of Linux VMs.
Tags: cloud, azure, vms, linux
Published: 2022-07-06 07:47:23


**Azure VMs**

- A virtual machine, is no different than any other physical computer like a laptop, smart phone or server. It has a CPU, memory, disks to store your files and can connect to the internet if needed.

-  A hypervisor is the software that integrates the physical hardware and the VM's virtual "hardware".

- The benefits of VMs are :

1. Cost Savings.
1. Agility and Speed
1. Lowered downtime
1. Scalability
1. Security Benefits


- We can create virtual machine of windows and different versions of linux as well.


**Creating a Virtual Machine (Linux):**

- First of all create a Resource Group .

- Then click on the Virtual Machines under Azure Services.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpa9eb15eil3nwg2bcm2.png)

- Then click on **Create**. 

-  Then choose **Azure Virtual Machine**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/otqfpwvw9cbhyk8s5yuw.png)

- Then choose the resource group you have created.
- Then add a name to your Virtual Machine.
- Then select region according to your needs.
- In availability region select No infrastructure redundancy required.
- In image select **Ubuntu Server 20.04 LTS Gen2**.
- Then under **Administration Account** choose Password under Authentication Type
- Then add your username and password.
- Under Inbound Port rules select **SSH** under Select inbound ports.
- Customise NSG as per the need.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5k1x12pw5tg48hwcwoz.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qzxzwdsehu6bdsirg8wb.png)

- Then click on Next until you reach the **Review + create**.
- Then click on **create**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/717nzq955h7ooafqyb3c.png)

- Need to wait for the virtual machine to be created.
- Then we will see a screen like this.

  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c7x4sq32c5rs59bsf3ip.png)

- Then go to your VM you created.
- Then click on connect and select **SSH**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r39l9f7epd1vmyo0xh8t.png)

- Then copy the command.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dpdjq39red4z4fn1v2jn.png)

- Now open **Xshell 7** on your desktop.
- There paste the command you recently copied by right clicking from your mouse and select paste.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ypxw4ggugp79dpbh3aui.png)

- Then using your arrow keys erase **-i private key path**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/isp7fwud1tsh7pe2ofob.png)

- Then press enter.

- Then click on **Accept and Save**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ofzdfpb3rbsjvywjjc51.png)
- Then enter your password you entered while creating your VM and click on OK.
 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqmy7zz1p1l56bq4qvb6.png)
- Hence you are logged into your Linux VM.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hslawtxsq2i75ettz8le.png)

Stay tuned for my upcoming blogs.

Thank You !