• Sales
  • My Account
  • Portal
Microsoft Azure Free trial
  • Features
    • What is Azure?
    • Compute

      Compute

      Virtual Machines
      Provision Windows and Linux Virtual Machines and applications in minutes
      Cloud Services
      Create highly available, infinitely scalable cloud applications and APIs
      Batch
      Run large-scale parallel and batch compute jobs
      Scheduler
      Run your jobs on simple or complex recurring schedules
      RemoteApp
      Deploy Windows client apps in the cloud, run on any device

      Get credits that enable:

      4 Windows or Linux VMs

      24 x 7 for a month

      And much more...

      Learn more

    • Web & Mobile

      Web & Mobile

      Websites
      Deploy and scale web apps in seconds
      Mobile Services
      Build and host the backend for any mobile app
      API Management
      Publish APIs to developers, partners and employees securely and at scale
      Notification Hubs
      Scalable, cross-platform push notification infrastructure

      Get credits that enable:

      Deploy 20 websites

      over 10M mobile API calls

      And much more...

      Learn more

    • Data & Storage

      Data & Storage

      SQL Database
      Managed Relational SQL Database-as-a-service
      DocumentDB
      Managed NoSQL document database-as-a-service
      Redis Cache
      High throughput, low latency data access to build fast and scalable applications
      Storage
      Durable, highly available and massively scalable cloud storage
      StorSimple
      Hybrid cloud storage for enterprises, reduces costs and improves data security
      Azure Search
      Fully-managed search-as-a-service

      Get credits that enable:

      8 standard SQL Databases

      Hadoop instance for a week

      And much more...

      Learn more

    • Analytics

      Analytics

      HDInsight
      Provision managed Hadoop clusters
      Machine Learning
      Powerful cloud-based predictive analytics
      Stream Analytics
      Real-time stream processing
      Data Factory
      Orchestrate and manage data transformation and movement
      Event Hubs
      Ingest, persist, and process millions of events per second

      Get credits that enable:

      8 standard SQL Databases

      Hadoop instance for a week

      And much more...

      Learn more

    • Networking

      Networking

      Virtual Network
      Provision private networks, optionally connect to on-premises datacenters
      ExpressRoute
      Dedicated private network fiber connections to Azure
      Traffic Manager
      Load balance incoming traffic for high performance and availability

      Connect Virtual Machines with Virtual Network for free.

      Learn more

    • Storage & Backup

      Storage & Backup

      Storage
      Durable, highly available and massively scalable cloud storage
      Backup
      Simple and reliable server backup to the cloud
      Site Recovery
      Orchestrate protection and recovery of private clouds

      Get credits that enable:

      Over 8 terabytes of storage

      Backup 700GB for a month

      And much more...

      Learn more

    • Media & CDN

      Media & CDN

      Media Services
      Encode, store, and stream video and audio at scale
      CDN
      Deliver content to end-users through a robust network of global data centers

      Get credits that enable:

      Encoding 100GB of media

      Transfer up to 1600GB of content

      And much more...

      Learn more

    • Hybrid Integration

      Hybrid Integration

      BizTalk Services
      Seamlessly integrate the enterprise and the cloud
      Service Bus
      Connect across private and public cloud environments
      Backup
      Simple and reliable server backup to the cloud
      Site Recovery
      Orchestrate protection and recovery of private clouds

      Get credits that enable:

      Send 200 million messages

      And much more...

      Learn more

    • Identity & Access Management

      Identity & Access Management

      Active Directory
      Synchronize on-premises directories and enable single sign-on
      Multi-Factor Authentication
      Safeguard access to your data and apps with an extra level of authentication

      Get credits that enable:

      Store 500,000 objects in Active Directory

      Multi-factor auth with 100 users

      And much more...

      Learn more

    • Developer Services

      Developer Services

      Visual Studio Online
      Plan, build and ship software, all from one place
      Application Insights
      Detect and solve problems to continuously improve web apps

      Each free account includes:

      Five free Basic licenses

      Unlimited private code repos

      And more!

      Learn more

    • Management

      Management

      Preview Portal
      Explore the new Azure Preview portal
      Scheduler
      Run your jobs on simple or complex recurring schedules
      Automation
      Simplify cloud management with process automation
      Operational Insights
      Collect, search and visualize machine data from on-premises and cloud

      Sign-up for free and get $200 to spend on all Azure services

      Learn more

    • Case Studies
  • Pricing
  • Documentation
  • Downloads
  • Marketplace
  • Blog
  • Community
    • Service Updates
    • Training
    • Events
    • Partners
      • Partner opportunity
      • Grow your business
      • Build your offering
      • Get started
    • Education
    • Newsletter
  • Support
    • Support Options
    • Support Plans
    • Forums
    • Service Dashboard
    • Trust Center
      • Overview
      • Security
      • Privacy
      • Compliance
      • Resources
      • FAQ
    • Legal
      • Overview
      • Subscription Agreement
      • Services Terms
      • Offer Details
      • Privacy Statement
      • Service Level Agreements
      • Preview Supplemental Terms
      • Store Terms
      • Website Terms Of Use
    • FAQ
Help us improve our documentation. Was this article helpful?
Yes No

Help us improve our documentation.

Was this article helpful?

Yes No
Help us improve our documentation. Rate this article.
Help us improve our documentation. Rate this article.
Tweet

Discover more resources for these services: Virtual Machines

Creating and Uploading a Virtual Hard Disk that Contains the Linux Operating System

Updated:

This article shows you how to create and upload a virtual hard disk (VHD) so you can use it as your own image to create virtual machines in Azure. You'll learn how to prepare the operating system so you can use it to create multiple virtual machines based on that image.

NOTE:

You don't need any experience with Azure VMs to complete the steps in this article. However, you do need an Azure account. You can create a free trial account in just a couple of minutes. For details, see Create an Azure account.

A virtual machine in Azure runs the operating system that's based on the image you choose when you create the virtual machine. Your images are stored in VHD format, in .vhd files in a storage account. For more information about disks and images in Azure, see Manage Disks and Images.

When you create the virtual machine, you can customize some of the operating system settings so they're appropriate for the application you want to run. For instructions, see How to Create a Custom Virtual Machine.

Important: The Azure platform SLA applies to virtual machines running the Linux OS only when one of the endorsed distributions is used with the configuration details as specified in this article. All Linux distributions that are provided in the Azure image gallery are endorsed distributions with the required configuration.

Prerequisites

This article assumes that you have the following items:

  • A management certificate - You have created a management certificate for the subscription for which you want to upload a VHD, and exported the certificate to a .cer file. For more information about creating certificates, see Create a Management Certificate for Azure.

  • Linux operating system installed in a .vhd file - You have installed a supported Linux operating system to a virtual hard disk. Multiple tools exist to create .vhd files, for example you can use a virtualization solution such as Hyper-V to create the .vhd file and install the operating system. For instructions, see Install the Hyper-V Role and Configure a Virtual Machine.

    Important: The newer VHDX format is not supported in Azure. You can convert the disk to VHD format using Hyper-V Manager or the convert-vhd cmdlet.

    For a list of endorsed distributions, see Linux on Azure-Endorsed Distributions. Alternatively, see the section at the end of this article for Information for Non-Endorsed Distributions.

  • Linux Azure command-line tool - if you are using a Linux operating system to create your image, you use the Azure Command-Line Tools for Linux and Mac to upload the VHD.

  • Azure Powershell tools - the Add-AzureVhd cmdlet can also be used to upload the VHD. Please visit Azure Downloads to download the Azure Powershell cmdlets. For reference information, see Add-AzureVhd.

This task includes the following steps:

  • Step 1: Prepare the image to be uploaded
  • Step 2: Create a storage account in Azure
  • Step 3: Prepare the connection to Azure
  • Step 4: Upload the image to Azure

Step 1: Prepare the image to be uploaded

Microsoft Azure supports a variety of Linux distributions (see Endorsed Distributions). The following articles will guide you through how to prepare the various Linux distributions that are supported on Azure:

  • CentOS-based Distributions
  • Oracle Linux
  • SLES & openSUSE
  • Ubuntu
  • Other - Non-Endorsed Distributions

After the steps in the guides above you should have a VHD file that is ready to upload into Azure.

Step 2: Create a storage account in Azure

A storage account represents the highest level of the namespace for accessing the storage services and is associated with your Azure subscription. You need a storage account in Azure to upload a .vhd file to Azure that can be used for creating a virtual machine. You can create a storage account by using the Azure Management Portal.

  1. Sign in to the Azure Management Portal.

  2. On the command bar, click New.

    Create storage account

  3. Click Storage Account, and then click Quick Create.

    Quick create a storage account

  4. Fill out the fields as follows:

    Enter storage account details

  5. Under URL, type a subdomain name to use in the URL for the storage account. The entry can contain from 3-24 lowercase letters and numbers. This name becomes the host name within the URL that is used to address Blob, Queue, or Table resources for the subscription.

  6. Choose the location or affinity group for the storage account. By specifying an affinity group, you can co-locate your cloud services in the same data center with your storage.

  7. Decide whether to use geo-replication for the storage account. Geo-replication is turned on by default. This option replicates your data to a secondary location, at no cost to you, so that your storage fails over to a secondary location if a major failure occurs that can't be handled in the primary location. The secondary location is assigned automatically, and can't be changed. If legal requirements or organizational policy requires tighter control over the location of your cloud-based storage, you can turn off geo-replication. However, be aware that if you later turn on geo-replication, you will be charged a one-time data transfer fee to replicate your existing data to the secondary location. Storage services without geo-replication are offered at a discount.

  8. Click Create Storage Account.

    The account is now listed under Storage Accounts.

    Storage account successfully created

Step 3: Prepare the connection to Azure

Before you can upload a .vhd file, you need to establish a secure connection between your computer and your subscription in Azure.

  1. Open an Azure PowerShell window.

  2. Type:

    Get-AzurePublishSettingsFile

    This command opens a browser window and automatically downloads a .publishsettings file that contains information and a certificate for your Azure subscription.

  3. Save the .publishsettings file.

  4. Type:

    Import-AzurePublishSettingsFile <PathToFile>

    Where <PathToFile> is the full path to the .publishsettings file.

    For more information, see Get Started with Azure Cmdlets

Step 4: Upload the image to Azure

When you upload the .vhd file, you can place the .vhd file anywhere within your blob storage. In the following command examples, BlobStorageURL is the URL for the storage account that you created in Step 2, YourImagesFolder is the container within blob storage where you want to store your images. VHDName is the label that appears in the Management Portal to identify the virtual hard disk. PathToVHDFile is the full path and name of the .vhd file.

Do one of the following:

  • From the Azure PowerShell window you used in the previous step, type:

    `Add-AzureVhd -Destination <BlobStorageURL>/<YourImagesFolder>/<VHDName> -LocalFilePath <PathToVHDFile>`
    

    For more information, see Add-AzureVhd.

  • Use the Linux command-line tool to upload the image. You can upload an image by using the following command:

    # azure vm image create <image-name> --location <location-of-the-data-center> --OS Linux <source-path-to the vhd>
    
Help us improve our documentation. Was this article helpful?
Yes No

Help us improve our documentation.

Was this article helpful?

Yes No
Help us improve our documentation. Rate this article.
Help us improve our documentation. Rate this article.

Contribute to this article

Want to edit or suggest changes to this content? You can edit and submit changes to this article using GitHub.

Need more help using this Azure service? Go to an MSDN forum or StackOverflow discussion

  • Go Social
  • Facebook
  • Twitter
  • Rss
  • Newsletter
  • Microsoft Azure
  • Features
  • Services
  • Regions
  • Case Studies
  • Pricing
  • Calculator
  • Documentation
  • Downloads
  • Marketplace
  • Microsoft Azure in China
  • Microsoft Azure Government
  • Community
  • Blogs
  • Service Updates
  • Forums
  • Events

  • Support
  • Forums
  • Service Dashboard
  • Support
  • Account
  • Subscriptions
  • Profile
  • Preview Features
  • Management Portal
  • Trust Center
  • Security
  • Privacy
  • Compliance
  • Hello from Seattle.
  • English (US)
    English (US) Čeština Dansk Deutsch
    English (India) English (UK) Español (ES) Suomi
    Français Ελληνικά Italiano Magyar
    Nederlands Bokmål Polski Português (BR)
    Português (PT) Svenska Română Türkçe
    Українська русский 日本語 한국어
    中文(简体) 中文(繁體)
     
  • USD
    US Dollar ($) Euro (€) Swiss Frank (chf) Argentine Peso ($)
    Australian Dollar ($) Danish Krone (kr) Canadian Dollar ($) Indonesian Rupiah (Rp)
    Japanese Yen (¥) Korean Won (₩) New Zealand Dollar ($) Norwegian Krone (kr)
    Russian Ruble (руб) Saudi Riyal (SR) South African Rand (R) Swedish Krona (kr)
    Taiwanese Dollar (NT$) Turkish Lira (TL) British Pound (£) Mexican Peso (MXN$)
    Malaysian Ringgit (RM$) Indian Rupee (₹) Hong Kong Dollar (HK$) Brazilian Real (R$)
     
  • Nutzungsbedingungen
  • Impressum
  • Contact Us
  • Trademarks
  • Privacy & Cookies
  • Feedback
Microsoft © 2014 Microsoft