How to Create a Linux Virtual Machine (VM) with Windows Azure

How to Create a Linux Virtual Machine (VM) with Windows Azure

Getting Started with MS AzureWindows Azure is Microsoft’s platform, which offers Public Cloud. Azure provides the IaaS offering to host or run the user’s applications with the Azure Virtual Machines. The Azure virtual machine (VM) is a virtual server, which the user can access, control and manage as per the requirement. The on demand virtual machine can be created from a standard image (from the Azure images gallery) provided by Azure or the user’s own image. Window’s Azure charges the user on an hourly basis.

The virtual machine is created from the Virtual Hard Disk (VHD). The user has to provide information, such as the VM size, OS (VHDs), and the region in the portal and Azure will provide the VM. Azure also allows for creating or uploading the user’s own VHD to Azure.

The present guide demonstrates how to create a Linux virtual machine with Windows Azure.

Azure also allows copying or downloading the VHD out of Azure and running it locally.

VHD is of the following two types:

A) Image: This is similar to a pre-configured software stack or template. Whenever the user creates a VM from the VHD it will have all the data and software from that VHD.

B) Disk: A disk is a type of VHD, which can be booted and mounted to a VM. When an image is provisioned through a portal it becomes a disk. Any VHD attached to a virtual hardware and running as part of a service is called a disk.

To create a virtual machine with the Linux OS, the user can select the VHD provided by Azure (Ubuntu) or upload their own VHD. The resulting VM will have a disk attached to it.

1. Create an account with Windows Azure and login to the Azure management portal. Click on the “New” button from the command bar or the “Create a Virtual Machine” option.

2. To create a VM from the Azure Image Gallery, click on the “Image Gallery” option.

3. Select the Ubuntu OS.

4. Provide the VM configuration details:

a. Virtual Machine Name: This is a name which is less than 15 characters. It is used to identify the VM in the portal.

b. New User Name: This is the account name to administrate the Linux machine. The user will not have root access. However, the name provided will have sudo access to perform all the tasks.

c. Password: This is the password required to connect to the VM for the above mentioned user name.

d. Size: This is the VM size. Based on different sizes, the user will get different cores and memory. Azure also charges differently based on the VM size. For a Free Trial, use the Small size. Click the arrow “=>”to continue.

5. Provide the following Virtual Machine mode configuration details:

a. DNS Name: The VM is contained in a Cloud service. The DNS provided will become a part of the URI of the Cloud service where this VM belongs to. The URI can be used to connect to the VM.

b. Storage Account: This is the storage account where the VHD file is stored. The user can currently accept the default value “Use Automatically Generated Storage Account”.

c. Region: This is the data center where the user wants to launch the VM.

Provide a unique DNS name. If a DNS name is used by someone or same user, Azure will not allow the same DNS name to be used again.

6. Once the DNS is correct and verified, click on the arrow “=>” to continue.

7. In the virtual machine options, provide the Availability option. Availability is a group of VMs which are deployed across domains for fault tolerance. The availability set ensures that the user’s application does not fail with a single point of failure, such as a network or power failure.

8. The Virtual Machine will now be created and available in the VM list. Initially, it will start in the provisioning mode.

9. After some time, the VM will be in a running state. The portal will show the status as running. Click on the name of the machine or the arrow “=>” to view details about the VM.

10. In the VM screen, select the “Dashboard”.

11. The dashboard will show information, such as the status, DNS name, Public virtual IP, the hostname etc.

12. The dashboard also shows information, such as the SSH details. The SSH details which is used to connect to the Linux instance. Note down the SSH details along with the port.

13. Use the SSH (we used putty) / Telnet client to connect to the Linux VM. The Host name should be the same as the above mentioned SSH details. Also use the same port from the SSH details to connect to the VM.

14. Initially, the SSH client may show the warning before adding the IP to its trusted list.

15. Provide the user name and the password created in step#4. The user is now connected to the VM and can perform tasks on the VM.

Keywords: Microsoft Azure, Windows Azure, Azure Cloud, Azure Public Cloud, Virtual Machines, Virtual Networks, Virtual Hard Disk, High Performance Computing, Azure VM, Azure Images Gallery, Azure VHD, Azure Virtual Hard Drive

You must be to post a comment.

* As a bonus, you'll receive our weekly newsletter!

Hitchhiker's Guide to The Cloud

Newvem's eBook for Cloud Operations