Installing and Activating Hyper-V Linux Integration Services

by Nirmal Sharma

Learn how to install and activate Hyper-V Integration Services for Linux to help improve the performance of Hyper-V VMs running on Linux distributions.

Editor's Note: Updated to reflect changes with the Hyper-V Linux Integration Services 4.0 release.

Microsoft developers have designed components that help in improving the performance of virtual machines running on Hyper-V Server. These components are designed as part of the Hyper-V Integration Services.

While the Hyper-V Server is intelligent enough to install and activate Integration Services for Windows virtual machines on its own, Windows Server Tutorials for a few virtual machines running Linux distributions you'll need to manually install and activate Hyper-V Linux Integration Services. Today we'll cover the process of installing and activating Hyper-V Integration Services in Linux distribution virtual machines.

Hyper-V Linux Integration Services (LIS)

Hyper-V Linux Integration Services, sometimes referred to simply as Hyper-V LIS, provides two types of components: drivers and services. The drivers play an important role in enhancing the performance of Linux virtual machines, and services are designed to perform a specific job.

For example, the VMBUS driver acts as a communication channel to improve communication between virtual machines, and the “Time Sync” service helps in syncing time with the Hyper-V Host.

Once Linux Integration services are deployed, virtual machines running Linux distributions can use features like Live Migration, Jumbo Frames, VLAN Tagging and Trunking, support for Symmetric multiprocessing (SMP), Static IP Injection, VHDX resize, Virtual Fibre Channel, Live Virtual Machine Backup and the ability to perform hot adding and removal of memory using the Dynamic Memory feature of Hyper-V.

Hyper-V Integration Services Support on Linux Distributions

Currently, Microsoft supports a variety of Linux distributions running as a virtual machine on a Hyper-V Server. Specifically, Microsoft provides Integration Services components for the following Linux distributions:

  • Red Hat Enterprise Linux 5.5 - 5.11 32-bit, 32-bit PAE and 64-bit
  • Red Hat Enterprise Linux 6.0 - 6.7 32-bit and 64-bit
  • Red Hat Enterprise Linux 7.0 - 7.1 64-bit
  • CentOS 5.5 - 5.11 32-bit, 32-bit PAE, and 64-bit
  • CentOS 6.0 - 6.7 32-bit and 64-bit
  • CentOS 7.0 - 7.1 64-bit
  • Oracle Linux 6.4 - 6.7 with Red Hat Compatible Kernel 32-bit and 64-bit
  • Oracle Linux 7.0 - 7.1 with Red Hat Compatible Kernel 64-bit

Hyper-V Linux Integration Services Activation and Installation

Before we talk about the activation and installation processes of Hyper-V Linux Integration Services, it's important to note the following points:

  • There are a few Linux distributions that require installation and activation of LIS
  • There are a few Linux distributions that come with LIS already installed, including Ubuntu – Ubuntu Hyper-V Integration Services have been built into Ubuntu Linux since Ubuntu 12.04 — so there's no need for a separate download and installation. For these distributions, only activation is required to use the full features of Hyper-V

Important: LIS 4.0 ships with two scripts: Install.SH and Upgrade.SH. Whereas in earlier versions of LIS you had to switch to the appropriate Linux distribution directory before you could install/upgrade LIS on Linux virtual machine, starting with Hyper-V LIS 4.0, Microsoft changed the installation process and now you only need to execute one script to either Install (Install.SH) or upgrade (Upgrade.SH) on a Linux distribution.

This is also shown in the screenshot below illustrating the ISO file of LIS 4.0.

Hyper-V Integration Services for Linux - Screenshot 1

Activating Hyper-V Integration Services for Linux Distributions that Ship with LIS Drivers and Services Already Installed

Please use the steps below for Linux distributions that ship with LIS drivers and services already installed. For this example we have chosen Ubuntu 12.04 (i.e. Ubuntu Hyper-V Integration Services).

  1. The first step is to edit the "modules" file located in /etc/initramfs-tools using this command:
    sudo vi /etc/initramfs-tools/modules
  2. In vi Editor, navigate to the last line in the file and use the insert ( I ) command to append and enter the following lines:
  3. Save the file by hitting the Esc key and then issuing the ": x" command
  4. Next, run the following commands to re-initialize the “modules” file:
    sudo update-initramfs –u
  5. Finally, reboot the virtual machine by executing the below command in Shell:
    sudo shutdown -r now

Once the guest virtual machine is rebooted, the LIS drivers and services will be registered in the system.

Installing Hyper-V Integration Services for Linux Distributions that Do Not Ship with LIS Drivers and Services

You may find you need to install Hyper-V Integration Services in a Linux Distribution in the following cases:

  • Linux distributions that do not ship with LIS already integrated
  • When there is a new version of LIS available at the Microsoft site. The current Hyper-V Linux Integration Services version is 4.0

Since Linux can only understand RPM files for installation, the LIS ISO comes with the required RPM files to help in installing or updating the existing LIS components.

Important: Hyper-V LIS 4.0 is available in two formats: a Tar file (lis4-0-11.tar.gz) that can be transferred to the target Linux virtual machine or an ISO file (lis4-0-11.iso) that can be attached to the Linux virtual machine. We'll explain how to install LIS 4.0 by attaching the ISO file. (Note: The previous Hyper-V Integration Services release, LIS 3.5, included only an ISO file).

The LIS installation process starts by attaching the LIS ISO to a virtual machine using Hyper-V Manager and then executing a set of commands to finish the installation as explained in the steps below:

  1. Attach the LinuxICv35.ISO file to a Linux virtual machine.
  2. As a root user, execute the command below to mount the ISO file: mount /dev/cdrom /media
  3. Next, run the script provided with the LIS ISO to install LIS: ./install.sh
  4. Finally, you need to reboot the Linux virtual machine so that the Hyper-V LIS components are initialized and registered successfully. To reboot, type “reboot” in the terminal and then press enter.

Once rebooted, use the "lsmod" or "Modinfo" command to check the status of LIS drivers and services as explained in the “Verifying Hyper-V LIS 4.0 Services and Drivers” section in this article.

Upgrading Hyper-V Linux Integration Services

Microsoft has provided upgrade scripts needed to update the Hyper-V LIS drivers for Linux distributions. Please follow the steps above to mount the ISO file and then execute the "Upgrade.sh" script after switching to the directory relevant to your Linux distribution.

Once the script has finished installing LIS drivers and services, reboot the virtual machine so that the Hyper-V LIS drivers and services are registered with the Linux kernel.

Verifying Hyper-V Linux Integration Services 4.0 Services and Drivers

After upgrading/installing LIS 4.0 on a Linux virtual machine, you can run the following command to verify the registration of the LIS drivers and services:

lsmod | grep hv

The above command should list the Hyper-V LIS drivers and services. You'll need to look for hid_hyperv, hv_netvsc, hv_utils, hv_storvsc and hv_vmbus for the successful activation of LIS. The output of the command should look similar to this screenshot:

Hyper-V Integration Services for Linux

Recommended for You

Nirmal Sharma is a MCSEx3, MCITP and Microsoft MVP in Directory Services. He specializes in directory services, Microsoft Azure, Failover clusters, Hyper-V, System Center and Exchange Servers, and has been involved with Microsoft technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles on various sites and contributing to Health Packs for ADHealthProf.ITDynamicPacks.Net solutions. Nirmal can be reached at nirmal_sharma@mvps.org.

Follow ServerWatch on Twitter and on Facebook

This article was originally published on Monday Apr 4th 2016
Mobile Site | Full Site