Ubuntu and Hyper-V: The Paths to Enlightenment

As part of virtualization on Hyper-V, there is the ability to use Para-virtualized drivers instead of using built-in drivers for slower, emulated devices. Para-virtualized drivers are simply device drivers that are written for native virtual devices. In other words they are not emulating a pre-existing physical device. The Path to Enlightenment is simply the method you use to take an operating system and enable it to use these synthetic devices.

In this article we will be describing the different methods of enabling enlightenment on Ubuntu Linux for the following 3 categories: Ubuntu 9.04 and Earlier, Ubuntu 9.10, and Ubuntu 10.04. Each of these distribution versions has significant differences which require sometimes slightly and sometimes major differences in procedure.

Methods of Enlightenment

The first method of enlightenment for Linux on Hyper-V is the release package from Microsoft, the Linux Integration Components (LIC), as of the time of this writing there are versions 1.0, 2.0, and the release candidate of 2.1. If you are using Hyper-V 2008 R2, then you will need to use version 2.0 or greater of the LIC. All versions of the LIC include vmbus, netvsc, storvsc, and blkvsc. In the release candidate of version 2.1 Microsoft has additionally incorporated time sync, heartbeat, and integrated shutdown into the vmbus, additionally 2.1 includes code which allows for SMP (multiple processors). Prior to this version you only received the synthetic device drivers for SCSI (storvsc), IDE (blkvsc), and networking (netvsc) plus the underlying vmbus (vmbus) architecture which all of the previous components depend upon. The biggest drawback to the LIC is the support statement that Microsoft has made. Currently the targeted distributions are very narrow (though much wider than when first released). Now of course Ubuntu is not one of the supported distributions (that would just be too easy). Due to this the LIC installer can be a bit tricky on Ubuntu.

The second method is by using a Linux kernel version which is newer than 2.6.32. This kernel must be compiled with the Hyper-V drivers out of the staging tree of the kernel source code. It can either be self-compiled or installed via a kernel install package. The primary difference between the Linux Integration Components and the kernel modules is that the kernel modules have been renamed to follow kernel coding standards, as such all modules that exist in the LIC have been prepended with hv_ so the modules are named hv_vmbus, hv_netvsc, hv_blkvsc, and hv_storvsc. Additionally please keep in mind that self-compiled kernels are NOT supported by Canonical (the company behind Ubuntu). As such if your system is production you should not use this option unless you are willing to self-support. Additionally there were fixes rolled into version 2.6.32.6 which allow the hv_vmbus module to properly handle SMP (multiple processors), so please ensure that you are taking advantage of this. Ultimately using the newer kernel method is preferable in most cases since we are able to bypass Microsoft’s installer which does not support Ubuntu.

Mouse Integration

When a user uses Hyper-V Management Console or System Center Virtual Machine Manager to connect to a VM and they begin to interact with the desktop via the mouse, they find themselves in an interesting situation where they are unable to reclaim their mouse pointer from the VM without entering a somewhat cryptic keystroke ctrl + alt + left arrow. Mouse integration provides for seamless interaction between the VM and the workstation being used to connect to the VM. If a VM Connect window is selected AND the mouse pointer is inside of the boundary of the VM’s desktop then the mouse commands will be sent to the guest. If these conditions are not met then the commands are sent to the workstation.

Mouse integration is currently achieved by installing the inputvsc module which was included in Citrix’s Project Satori. This installer has the same support statement as the LIC, meaning it is not supported on Ubuntu (though in some cases it does work). The inputvsc requires the vmbus module to be both installed and operable. The requirement for the vmbus module is not fulfilled by using the kernel included modules due to the existence of the hv_vmbus as a replacement for the vmbus module.

It is also important to note that if you do not have Mouse Integration via Citrix’s Project Satori then you will be unable to capture and use the mouse if you are using the SCVMM or HV Management Consoles while you are connected through a RDP session. However if you are using the SCVMM or HV Management Consoles directly on the physical machine that you are on you will be able to capture the mouse as expected.

Linux Integration Components – Future Versions

Currently the code for the Linux Integration Components version 2.1 RC is in the linux-next source code, so unless some problems are discovered to warrant their removal they will be included in 2.6.35, this means that we can rely on the actual kernel modules to provide the ability to use synthetic devices as well as timesync, integrated shutdown, and heartbeat.

Method 1 – Use 2.6.32 Modules from Default Install (Ubuntu 10.04 only)

Easy Install YES
SMP-Safe YES
Mouse Integration Compatible NO
Integrated Shutdown NO
Pre-Release Software NO

Configure Modules to Load on Boot

Add the following to /etc/initramfs-tools/modules

hv_vmbus

hv_storvsc

hv_blkvsc

hv_netvsc

# update-initramfs -u

Configure Synthetic Network Interface

Add the following to /etc/network/interfaces

auto seth0

iface seth0 inet dhcp

Method 2 – Install 2.6.32 Kernel Image from Lucid Repository (Ubuntu 9.10 and Earlier)

Easy Install YES
SMP-Safe YES
Mouse Integration Compatible NO
Integrated Shutdown NO
Pre-Release Software NO

Download Kernel Image

# wget http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-2.6.32-31-server_2.6.32-21.32_amd64.deb

Install Kernel Image

# dpkg -i linux-image-2.6.32-31-server_2.6.32-21.32_amd64.deb

Configure Modules to Load on Boot

Add the following to /etc/initramfs-tools/modules

hv_vmbus

hv_storvsc

hv_blkvsc

hv_netvsc

# update-initramfs -u -k 2.6.32-21-server

Configure Synthetic Network Interface

Add the following to /etc/network/interfaces

auto seth0

iface seth0 inet dhcp

Method 3 – Install 2.6.18 Kernel Image for Direct Installation of LIC v2.0 (Ubuntu 9.04 and Earlier)

Easy Install NO
SMP-Safe NO
Mouse Integration Compatible YES
Integrated Shutdown NO
Pre-Release Software NO

Download Kernel Image and Headers

Add the following to /etc/apt/sources.list (comment out after completed with installation)

##Repositories which contain older versions of the linux kernel (needed for the Hyper-V Linux IC)

deb http://ftp.us.debian.org/debian etch main

deb http://security.debian.org/debian-security etch/updates main

Install Kernel Image, Headers, and Prerequisites

# apt-get install build-essential linux-image-2.6.18-6-amd64 linux-headers-2.6.18-6-amd64

Install Linux IC v2.0 (Assumes Files are Pre-staged in /opt/linux_ic-20/)

# cd /opt/linux_ic-20

# ./setup.pl drivers

Install Linux Inputvsc (Assumes Files are Pre-staged in /opt/linux_ic-input/) – Optional for Mouse Integration

# cd /opt/linux_ic-input

# ./setup.pl input

Configure Modules to Load on Boot

Add the following to /etc/initramfs-tools/modules

vmbus

storvsc

blkvsc

netvsc

inputvsc #Optional for Mouse Integration

# update-initramfs -u

Configure Synthetic Network Interface

Add the following to /etc/network/interfaces

auto seth0

iface seth0 inet dhcp

Reboot

Method 4 – Install 2.6.18 Kernel Image to for Direct Installation of LIC v2.1 (Ubuntu 9.04 and Earlier)

Easy Install NO
SMP-Safe YES
Mouse Integration Compatible YES
Integrated Shutdown YES
Pre-Release Software YES

Download Kernel Image and Headers

Add the following to /etc/apt/sources.list (comment out after completed with installation)

##Repositories which contain older versions of the linux kernel (needed for the Hyper-V Linux IC)

deb http://ftp.us.debian.org/debian etch main

deb http://security.debian.org/debian-security etch/updates main

Install Kernel Image, Headers, and Prerequisites

# apt-get install build-essential linux-image-2.6.18-6-amd64 linux-headers-2.6.18-6-amd64

Install Linux IC v2.1 (Assumes Files are Pre-staged in /opt/linux_ic-21/)

# cd /opt/linux_ic-21

# ./setup.pl drivers

Install Linux Inputvsc (Assumes Files are Pre-staged in /opt/linux_ic-input/) – Optional for Mouse Integration

# cd /opt/linux_ic-input

# ./setup.pl input

Configure Modules to Load on Boot

Add the following to /etc/initramfs-tools/modules

vmbus

storvsc

blkvsc

netvsc

inputvsc #Optional for Mouse Integration

# update-initramfs -u

Configure Synthetic Network Interface

Add the following to /etc/network/interfaces

auto seth0

iface seth0 inet dhcp

Reboot

Comments are closed.