Speeding up Linux VMs with Hyper-V's Linux Integration Services
Through the Window
Microsoft provides a collection of tools for faster and more efficient Linux virtualization in the Hyper-V environment.
Back in 2008, when Microsoft realized it was falling behind on virtualization and cloud services, the company rolled out the Hyper-V virtualization environment. Hyper-V originally only supported Windows client systems, but Redmond soon realized they were missing out on a significant segment of the IT market that insisted on Linux support. Basic Linux guest support followed in 2009 (see the box titled "Supported Linux Operating Systems"). However, Microsoft knew it wasn't enough just to provide basic functionality for a Linux virtual machine. To remain competitive, the company realized it would need to invest as much energy as its competitors in dialing up performance for Linux virtual systems. Linux Integration Services (LIS) is Microsoft's answer to the need for better, faster, and more integrated virtual Linux performance on a Hyper-V Server. LIS is similar to the VMware tools provided by VMware for virtual machines running on ESX Server.
Supported Linux Operating Systems
Microsoft currently supports the following Linux distribution flavors running as virtual machines on Hyper-V Server:
- Red Hat Enterprise Linux 5.7, 5.8, 6.0-6.3, and 6.4 x86 and x64
- CentOS 5.7, 5.8, 6.0-6.3, and 6.4 x86 and x64
- SUSE Linux Enterprise Server 11 with SP2 or SP3
- openSUSE 12.1
- Ubuntu 12.04, 12.10, 13.04, and 13.10
- Oracle Linux 6.4
Users needing drivers for Red Hat or CentOS version 5.6 and earlier should continue to use Linux Integration Services 2.1, which you can download from the Microsoft website.
As you will learn in this article, although you don't have to have LIS to run a virtual Linux system on Hyper-V, the tools available through LIS provide better, more efficient, and more comprehensive virtualization, as well as better integration with Hyper-V management structures for easier monitoring, management, and deployment of Linux virtual systems.
LIS works through a system of drivers running on both the host and guest. In other words, LIS is not just a tool that runs on the Windows host. You must install LIS on the Linux virtual machine, unless it is already present. (As you will learn in this article, several Linux distributions come with LIS support pre-installed; in that case, you only need to activate it.)
If you work for a company that uses Hyper-V virtualization, and you want to get the best performance from your Linux virtual machines, read on for a close look at Hyper-V Linux virtualization with LIS.
Understanding Linux Integration Services
LIS provides two types of components: drivers and services. The drivers enhance the overall performance of the Linux virtual machines by supporting more direct access to the host. For example, the VMBus driver is a component that helps boost performance by reducing the extra communication layers between the virtual machine and host system. Services perform specific jobs. The LIS Time Synchronization service, for instance, keeps Linux virtual machines in sync with the Hyper-V host.
LIS comes with the following drivers:
- VMBus: Microsoft Hyper-V Server provides VMBus, which acts as a communication channel between Linux virtual machines and the Hypervisor. This component plays an important role in improving the performance of Linux virtual machines. The VMBus is a core communication driver in Microsoft Hyper-V. If VMBus is not available, a Linux virtual machine will operate using emulation, which is less efficient. VMBus functionality is implemented in the
hv_vmbusdriver in the Linux virtual machine.
- VSP/VSC: Guest and host systems communicate using matching pairs of Virtual Service Provider (VSP) and Virtual Service Client (VSC) drivers. VSPs reside on the host system and listen for requests originating from corresponding VSCs running on the client. Hyper-V supports four types of VSP and VSC drivers: the Network VSP, Video VSP, Storage VSP, and HID VSP drivers and their corresponding VSC drivers. The VSPs always run in the parent partition of the Hyper-V host, and VSCs run in the Linux virtual machines once the LIS is installed. VSCs running in the Linux virtual machine use the VMBus communication channel to talk with corresponding VSPs. Note: The Hyper-V Video VSC is not available through LIS.
- SCSI Drivers: Linux virtual machines can use SCSI storage controllers if LIS is installed, and you can add multiple SCSI controllers and attach VHD files to them. This functionality is provided by the
hv_storsvcdriver in the Linux virtual machine.
- IDE Drivers: Linux Integration Services supports IDE storage controllers, which are implemented using the
- VMBus Network Controller Drivers: Two types of network adapters are available in a virtual machine running on the Hyper-V Server: a legacy network adapter and VMBus network controllers. VMBus network controllers are available only if you have installed LIS. A VMBus network controller uses the Network VSC, running on the Linux virtual machine, to communicate with the Network VSP running on the Hyper-V host. The
Hv_netsvcdriver provides support for VMBus network controllers.
- Hyper-V Balloon Driver: Windows virtual machines support dynamic memory with a combination of ballooning and hot add/remove. Starting with Red Hat Enterprise Linux 6.4 virtual machines, a basic balloon driver for dynamic memory management has been added. The balloon driver is used to remove memory dynamically from a virtual machine, but the driver does not provide the functionality to allocate memory on the fly. Ballooning is implemented with the
- HID-Compatible Mouse Driver: LIS provides full mouse support for Linux virtual machines. Mouse functionality is provided by the
hid_hypervdriver in the Linux virtual machine.
LIS comes with the following services:
- Time Synchronization: The Time Synchronization service keeps the clock inside the Linux virtual machine in sync with the Hyper-V host with the help of "Timesync" service and time source code provided by the Hyper-V LIS.
- Guest Shutdown: You can shut down Linux virtual machines from either Hyper-V Manager or System Center Virtual Machine Manager (SCVMM) by using the shutdown command.
- Heartbeat: This feature allows the virtualization server to detect whether the virtual machine is running and responsive. This status is reflected in both Hyper-V Manager and SCVMM.
- Data Exchange: Information about the running Linux virtual machine is passed to the host using the Data Exchange service. For supported Linux virtual machines, the data exchange component allows a virtual machine to communicate information such as the processor architecture, kernel version, domain name, IPv4 and IPv6 addresses of virtual adapters, and the LIS version.
These LIS services are provided by the
hv_utils module, which is installed and registered as part of LIS. Note: The Hyper-V Volume Shadow Copy Requestor service, which helps create volume snapshots on the fly, is not available for Linux virtual machines.
See the box titled "Other Hyper-V Features" for other features available to Linux virtual systems through Hyper-V.
Other Hyper-V Features
Apart from the drivers and services provided by the Linux Integration Services, Linux virtual machines can use other features offered by the Hyper-V environment, including:
- Live Migration: The Hyper-V live migration feature smoothly migrates virtualized workloads without any downtime.
- Jumbo Frames: Linux virtual machines can be configured to use Ethernet frames with more than 1,500 bytes of payload.
- VLAN Tagging and Trunking: Administrators can attach single or multiple VLAN IDs to synthetic network adapters. These synthetic network adapters are called VMBus network adapters, and they are available only if the LIS has been installed in a Linux virtual machine.
- Symmetric Multiprocessing (SMP): Supported Linux distributions can use multiple virtual processors per virtual machine. The actual number of virtual processors you can allocate to a virtual machine is only limited by the Microsoft Hyper-V Server.
How LIS Improves Performance
A Linux virtual machine running on a Hyper-V server does not know if it is operating in a virtual environment or running directly on the hardware. In a virtual environment, operating system components send hardware access requests using native drivers, but the requests are received by the virtual layer.
Such requests are intercepted by the virtual layer before the request to access the hardware device is honored. This interception is called device emulation. Because these intercepted calls are handled by the device emulation component, emulation always presents an extra layer of communication between Linux virtual machines and hardware devices.
To avoid the extra layer of communication, Microsoft provides a set of components in the Linux Integration Services. The VMBus and VSP/VSC components manage and expedite device access requests.
Any request generated by the VSCs running in the Linux virtual machines are always received by the VMBus driver running in the parent partition, and the VMBus driver knows where to forward such requests. VMBus acts as a communication channel that helps facilitate smooth communication between VSC and VSP components (Figure 1).
Figure 1 shows three kinds of virtual machine: one is running Windows, the second is a Linux virtual machine with Integration Services installed, and the third is a Linux virtual machine without Integration Services. The key difference between the second and third Linux virtual machines is that the VMBus and VSP/VSC components are available to the virtual machine using LIS.
Any request for hardware device access has to take place in the parent partition of the Microsoft Hyper-V server. Microsoft Hyper-V uses its virtualization drivers to honor the request. How fast the request for accessing hardware devices is honored depends on the components used to send the request. An emulation request is a request that requires the virtual machine to use its native drivers to access the hardware devices (far right in Figure 1).
Without a mechanism for directly channeling the requests, these calls are intercepted by the Hyper-V virtual layer, and the end result is poor performance for the Linux virtual machine.
LIS supports what is known as a "synthetic request." A synthetic request is sent by the VSC component running in the Linux virtual machine to the VMBus driver, which is also running in the Linux virtual machine. The VMBus driver in the virtual machine then forwards the request to the VMBus driver running in the Microsoft Hyper-V parent partition. The VMBus in parent partition takes note of the request and forwards the call to the corresponding VSP running in the parent partition.
To make sure the VMBus and VSC components have been installed successfully in a Linux virtual machine and it is using the synthetic drivers, run the commands:
modinfo hv_netvsc modinfo hv_storvsc modinfo hv_vmbus modinfo hv_vmbus
These commands list the VMBus driver and VSCs registered on the Linux virtual machines, as shown in Figure 2.
Setting Up LIS
Some recent Linux distributions come with built-in support for LIS. If your distro includes LIS support, you still need to activate LIS before you can use it. The following steps describe how to set up LIS on an Ubuntu 12.04 system; other distributions are similar.
Enable Integration Services by editing the
modules file located under
/etc/initramfs-tools using the following command:
sudo vi /etc/initramfs-tools/modules
In vi or another text editor, navigate to the last line in the file and enter the following lines:
hv_vmbus hv_storvsc hv_blkvsc hv_netvsc
The resulting file should look like the file as shown in Figure 3. Save the file and exit.
Next, run the following commands to re-initialize the
sudo update-initramfs -u
Finally, reboot the virtual machine with the following command:
sudo shutdown -r now
Once the guest virtual machine is rebooted, the Integration Services drivers will be registered in the system (Figure 4).
Run the following command to verify the registration of the LIS modules:
The Integration Services drivers will appear in the list (Figure 5).
If LIS is not preinstalled in your Linux distribution, you will need to install it manually. Start by obtaining the ISO file from the Microsoft site. The current Linux Integration Services version is 3.4; you can download it from the Microsoft download center. LIS 3.4 is very similar to the previous version, except the developers have added support for new Linux distributions.
LIS ships as an ISO file. The ISO file contains the necessary RPM package and scripts to install or upgrade an existing version of integration services. You can use the
LinuxICv34.ISO file to install/upgrade LIS on any of the following Linux distributions:
- RHEL/CentOS 5.7, 5.8
- RHEL/CentOS 6.0, 6.1, 6.2, 6.3
To install LIS version 3.4 on any of the preceding Linux distributions, you must attach the ISO file to the virtual machine using Hyper-V Manager and then mount the ISO inside the Linux virtual machine. After mounting the ISO file, run the Shell scripts provided with the ISO file to begin installing Linux Integration Services:
- Attach the
LinuxICv34.ISOfile to the virtual machine using the Hyper-V Manager.
Run the following command to mount the ISO file:
# mount /dev/cdrom /media
As a root user, change to the directory relevant to your distribution:
For RHEL/CentOS 5.7: # cd /media/CDROM/RHEL57 For RHEL/CentOS 5.8: # cd /media/CDROM/RHEL58 For RHEL/CentOS 6.0, 6.1, 6.2: # cd /media/CDROM/RHEL6012 For RHEL/CentOS 6.3: # cd /media/CDROM/RHEL63
Run the script provided in the directory to begin the installation:
For RHEL/CentOS 5.7: # ./install-rhel57.sh For RHEL/CentOS 5.8: # ./install-rhel58.sh For RHEL/CentOS 6.0, 6.1, 6.2: # ./install.sh For RHEL/CentOS 6.3: # ./install.sh
- Finally, reboot the Linux virtual machine so that Integration Services are initialized and registered.
Once rebooted, use the
modinfo command to check the status of VMBus and VSC drivers.
Buy this article as PDF
Bug database has a bug of its own that could allow an intruder to create an unauthorized account.
Report focuses federal resources on achieving universal Internet access.
Leading browser makers say “no” to porous encryption algorithm
Report from the X-Force group says attackers are using TOR to hide their crimes
Future Firefox extensions will be compatible with Chrome.
Better read this if you bought your computer before 2011
Users should upgrade to the new version as soon as possible
Xen project announces a privilege escalation problem for Qemu host systems
Attackers can compromise an Android phone just by sending a text message
PC vendor will pre-install Ubuntu on portables in India.