Table of Contents
- Prerequisites
- Create a Linux Virtual Machine
- Deploy and Connect to Your VM
- Connect to your VM using SSH
Prerequisites
- Azure subscription
- Basic knowledge of Linux Virtual Machine (LVM)
A Linux Virtual Machine (VM) is a self-contained, software-based environment that mimics the functionality of a physical computer. By allocating resources from the host system, such as processing power, memory, and storage, the VM runs its own operating system (Linux) and its applications independently, creating a virtual computer within your existing system.
This article provides step-by-step instructions on deploying a Linux virtual machine using the Azure portal.
Step 1: Create a Linux Virtual Machine
- Log in to the Azure portal [https://portal.azure.com]
- Use the search box to search for and select "virtual machine"
- Click on create and select Azure virtual machine
- continue to complete the configuration on the basic settings
- select the size
- create a username
- check the HTTP (80) and SSH (22) box on the select inbound ports
- click on review + create
Step 2: Deploy and Connect to Your VM
- After the validation passes, click create to deploy your VM
- When prompted, select "Download private key and create resource".
- Wait for deployment completion, then select Go to resource
- click on overview and ensure the virtual machine Status is Running.
- select Connect and Connect in the drop-down.
Step 3: Connect to your VM using SSH
- Open a CMD window so you can run the SSH connection string.
- At the prompt, connect to the virtual machine using SSH.
ssh -i 'c:\users\admin\downloads\VM1_key.pem' adminuser@public_ip_address
To get the correct path to the key, click on your file explore, go to download, right click on the VM file (key path) and click on properties.
click on security, then copy the path to the key on the object name
When prompted, type yes to connect.
Ensure the command is successful and the prompt changes to adminuser@VM1.
Fetch the list of available OS updates and install updates. When prompted, type yes to continue. Each command must complete successfully.
sudo apt update
sudo apt install nginx
Copy and paste the VM Ip address on the browser to launch the Nginx welcome page.
In conclusion, Linux Virtual Machines provide a flexible and scalable way to run Linux operating systems on various cloud platforms. With easy creation and deployment options, Linux VMs are ideal for development, testing, and production environments.
Summary:
We discussed Linux Virtual Machines (VMs) and explored various aspects, including:
- Definition: A Linux VM is a software emulation of a physical computer running the Linux operating system.
- Creation: Explored methods to create a Linux VM using Azure portal.
- Connection: using SSH to connect the VM
Top comments (2)
This is a great step-by-step guide to deploying a Linux VM on Azure! I especially appreciate the clear instructions on using SSH to connect, including the key path details. I'm going to try this out myself.
Thank you so much! I'm glad you found the guide helpful. Good luck with your deployment, and feel free to reach out if you have any questions!