Creating a Linux Virtual Machine as a Persistent Windows Azure VM role.

 

2388.Azure_5F00_320894DA[1]

Over the past few weeks, I have had a few questions around the ability of Windows Azure https://www.windowsazure.com/education to run non Windows operating systems. In this post I will explain the process of  installing Linux on Windows Azure.

Firstly some key facts about Windows Azure support for Linux 

Creating a virtual machine that is running the Linux operating system is easy when you use the image gallery in the Windows Azure Preview Management Portal. With no prior experience with Windows Azure, you can create a virtual machine running the Linux operating system in the cloud that you can access and customize.

Images are provided by these trusted members of the Linux community:

 

So how to create a virtual machine?

 

 

Here is a step by step walkthrough adapted from Bruno Terkaly Blog https://blogs.msdn.com/b/brunoterkaly   
002

  1. Open Internet Explorer and browse https://manage.windowsazure.com to enter the Windows Azure portal. Then, log in with your credentials.
  2. In the menu located at the bottom, select New | Virtual Machine | From Gallery to start creating a new virtual machine.

 

Working with the gallery
003

  1. Select "From Gallery" to start creating a new virtual machine.
  2. Gallery will provide a list of available operating systems.

Select a flavour of Linux

 Selecting a flavour of Linux
VMgallery

 

  1. Not including your own, you can choose your VM to run the following Systems:
    • Microsoft SQL Server 2012
      • This image contains the full version of SQL Server, including all components except Distributed Replay, Always On, and Clustering capabilities.
    • Windows Server 2008 R2 SP1
      • Windows Server 2008 R2 is a multi-purpose server designed to increase the reliability and flexibility of your server or private cloud infrastructure.
    • Windows Server 2012
      • Windows Server 2012 incorporates Microsoft's experience building and operating public clouds, resulting in a dynamic, highly available server platform. It offers a scalable, dynamic and multi-tenant-aware infrastructure that helps securely connect across premises.
    • CentOS 6.2
      • This distribution of CentOS version 6.2 is provided by OpenLogic and contains an installation of the Basic Server packages
    • OpenSUSE64-12.1
      • OpenSUSE Linux 64 Bits (IAAS M1 Preview)
      • This is the distribution with Yast2
    • Suse Linux Enterprise Server
      • SUSE Linux Enterprise Server is a highly reliable, scalable, and secure server operating system, built to power mission-critical workloads in both physical and virtual environments. It is an affordable, interoperable, and manageable open source foundation
    • Ubuntu Server 12.04
      • Ubuntu Server 12.04 amd64 20120528.1
      • Ubuntu Server 12.04 (Precise Pangolin) amd64 20120528.1 Cloud Image

 

     Naming the Virtual Machine (Linux)
005

  1. You will need to provide:
    • Virtual Machine Name
    • User Name
    • Password
    • Size (larger VMs allow up to 14GB of memory)
  2. Some guidelines regarding Administrator account
    1. Rename the Default Administrator Account
    2. When you rename the default Administrator account, it removes the obvious indication that this account has elevated privileges.
    3. Although an attacker still needs the password to use the default Administrator account, a renamed default Administrator account adds an additional layer of protection against elevation of privilege attacks.
    4. Note: Renaming the default administrator account hinders only certain types of attack.
    5. Additionally, tools are available that enumerate group members, and these always list the original administrator account first.
    6. For the best protection against attacks on your built-in administrator account, create a new administration account and then disable the built-in account.

 

Specifying Linux VM Details
image

  1. The DNS name is the name of your Linux OS in the cloud
  2. Specify a storage account or automatically generate one
    • This is so you can store tables, blobs, and queues
  3. Specify region or affinity
    • Affinity is a useful concept.
      • It allows you to group dependant Windows Azure services, and deploy those in one place if possible
        • If your services are dependant on each other it is good if those are co-located, so that transactions between them are executed faster.
          • The best option is if the network hops between your hosted services are minimized as much as possible
        • Lowering your bill - For the most part bandwidth within the data center is free of charge

     Understanding Availability Set
007

  1. Availability sets means that your VMs will be distributed across different fault domains in the data center.
  2. This means if an entire rack goes down, you will have a running instance available

 

Your Virtual Machine Running (Portal)
008

  1. The Linux OS is up and running after just a few minutes.
  2. We now need to test connectivity
  3. We will use the Putty tool(s)

 

Understanding the Dashboard, Endpoints, and Configuration
009

  1. You have a few choices here:
    • Dashboard
      • Usage Overview
      • Status
      • URL
      • HostName
      • Public Virtual IP Address
      • SSH Details
      • Size
      • Disks
      • Location
      • Deployment ID
      • Subscription Name
      • Subscription ID
    • Endpoints
      • Name
      • Protocol (UDP or TCP)
      • Public Port
      • Private Port
      • Load Balanced
    • Configure
      • Virtual Machine Size
      • Availability Set

 

  How to open endpoints to your Linux VM
010

  1. Each VM can have attached a number of disks for storing data, and communicates with other VMs through endpoints
  2. Endpoints are simply TCP or UDP ports that can be configured individually

 

Opening a TCP port
011

  1. Note the:
    • Name
    • Protocol
      • TCP or UDP
    • Public Port (access from outside the data center)
    • Private Port (from within the data center)

 

Working with Putty
012

  1. Now that you have provisioned and configured a Linux Virtual Machine, you will connect by using an SSH client.
  2. Note: You can download Putty, a free SSH client for Windows, here:
  3. Putty offers the following:
    • PuTTY (the Telnet and SSH client itself)
    • PSCP (an SCP client, i.e. command-line secure file copy)
    • PSFTP (an SFTP client, i.e. general file transfer sessions much like FTP)
    • PuTTYtel (a Telnet-only client)
    • Plink (a command-line interface to the PuTTY back ends)
    • Pageant (an SSH authentication agent for PuTTY, PSCP, PSFTP, and Plink)
    • PuTTYgen (an RSA and DSA key generation utility).

 

  Starting Putty
013

  1. Login with your credentials
    • User Name and Password (you provided this previously)
  2. You can get the SSH details from the portal

 

Your terminal screen to your Linux VM
014

  1. You will need to login with your previous password.
  2. Once you do that, you are now logged in.

     

What if you already have a Linux Sever you simply want to move to the cloud?

Here is a quick step by step guide for creating and Uploading a Virtual Hard Disk that Contains the Linux Operating System

You create a virtual machine in Windows Azure by using a virtual hard disk (VHD) file. You can choose to create a virtual machine by using a VHD file that is supplied for you in the Image Gallery, or you can choose to create your own image and upload it to Windows Azure in a VHD file.

Create a Linux virtual machine using a partner solution

Choose one of the partners below for help creating Linux virtual machines in Windows Azure:

Linux partners

Create a Linux virtual machine with your own image

Learn how to create your own virtual hard drive (VHD) with a Linux operating system on it, and then upload it and use it to create a Linux virtual machine in Windows Azure.

  • CSUpload command-line tool.
  • This tool is a part of the Windows Azure SDK. You use this tool to set the connection to Windows Azure and upload the VHD file. You must use the tools available in Windows Azure SDK - June 2012 or later to upload VHDs to Windows Azure. To download the SDK and the tools, see
  • Windows Azure Downloads
  • .