DEV Community

Cover image for How to Create a Linux virtual machine in the Azure portal
Simeon Alikali
Simeon Alikali

Posted on

How to Create a Linux virtual machine in the Azure portal

Azure virtual machines (VMs) can be created through the Azure portal. The Azure portal is a browser-based user interface to create Azure resources. This tutorial shows you how to use the Azure portal to deploy a Linux virtual machine (VM) running Ubuntu Server 22.04 LTS.

Create virtual machine

1) Sign in to the Azure portal
2) Enter virtual machines in the search.
3) Under Services, select Virtual machines.

Image description

4) In the Virtual machines page, select Create and then Virtual machine. The Create a virtual machine page opens.

Image description

5) In the Basics tab, under Project details, make sure the correct subscription is selected and then choose the resource group or click create new to create resource group.

Image description

6) Under Instance details,
Virtual machine name: Input the Virtual machine name.
Region: Select the region of your choice.
Availability Option: Select availability zone.
Availability Zone: Choose any zone of your choice.
Security type: select trusted lunch virtual machines.
Image: Choose Ubuntu Server 22.04 LTS - Gen2 for your Image or any of your choice.
Size: select the size of your choice.

Image description

Image description

Under Administrator account

Authentication type: Select SSH public key or password.
Username: enter your username, exceluser.
Password: Enter your password.
Confirm password: Confirm the password entered above.

Under Inbound port rules

Public inbound ports: choose Allow selected ports.
Select inbound port: Select SSH (22).

Image description

7) Leave the remaining defaults and then select the Review + create button at the bottom of the page

Image description

8) click create after validation is successfully passed.

Image description

9) When the deployment is finished, select Go to resource.

Image description

Connect to virtual machine
a) click connect, in the drop down menu, select connect

Image description

b) Open windows PowerShell and type in the following command on the powershell command prompt, ssh username@public ip address and then strike enter.
c) It will give you a massage if you are connecting for the first time, The authenticity of host "public ip address" (public ip address)' can't be established.....
d) Are you sure you want to continue connecting (yes/no/[fingerprint])?
e) Type "yes" and strike enter, then it will request for your password.
f) Type in your password and strike enter, if all things are ok you will be connected.

Image description

Great!!!
Here we are in our linux virtual machine.

Top comments (0)