Hyper-V Guests: Linux Integration Components on RHEL and CentOS

Hyper-V Guests: Linux Integration Components on RHEL and CentOS

In this article I am documenting the process for installing the Hyper-V Integration Components within a Red Hat Enterprise Linux 5.3 or a CentOS 5.3 VM. My environment consists of x64 VMs, I have not taken the time to test this process for x86 VMs, however it should hold true, as long as you update the package names to reflect the appropriate architecture.

In my testing I have found that the current versions (v1 and v2) do not work with linux kernels 2.6.20 or newer, which means in order to use the ICs you will need to have 2.6.19 or older. Since both RHEL 5.3 and CentOS 5.3 included the Linux 2.6.18-128 kernel.

While reading the Hyper-V Integration Components readme they talk about implementing the Xen kernel (x2v) this is not necessary, and really is kind of a hinderance for a lot of production environments. I will not be installing this as part of this article.

Now before we get started you need to deploy a new VM with Red Hat or CentOS installed. Please do not attempt to follow these instructions on a production machine, do it in test until you are comfortable with the process, then do it in prod.

STEP 1 – Verify Your Kernel
Login as root
Verify the kernel is older than 2.6.20
# uname –a

STEP 2 – Install Pre-Requisites and Pre-Stage Files for Linux Integration Components
Login as root
If using Red Hat make sure you have registered with RHN so that yum will work (this is not applicable to CentOS)
Install Kernel Development Package and Compiler
# yum install kernel-devel gcc
Prestage Integration Components files (make sure you mounted the LIC iso as a CD drive on the VM)
# mkdir /opt/linux_ic
Copy files from cd
# cp -R /media/CDROM/* /opt/linux_ic/
# cd /opt/linux_ic
Verify Symbolic Link is intact (look for build – if it is highlighted in red then the link is broken)
#  ls –l /lib/modules/2.6.18-128.el5/
See where the link should be pointed
# ls –l /usr/src/kernels/
Remove the existing Symbolic Link
# rm /lib/modules/2.6.18-128.el5/build
Create a new Symbolic Link
# ln –s /usr/src/kernels/2.6.18-128.1.16.el5-x86_64/ /lib/modules/2.6.18-128.el5/build

STEP 3 – Install the Linux Integration Components
Execute installation script
# cd /opt/linux_ic
# ./setup drivers

STEP 4 – Configure Networking to Use Synthetic Devices
Copy configuration to new interface names
# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-seth0
Edit the script to change the device name from eth0 to seth0
# nano /etc/sysconfig/network-scripts/ifcfg-seth0
Shutdown the VM
# shutdown –h now
Configure the VM Properties to use the Synthetic Devices

That is it.  You have now completed the installation of the Linux Integration Components for Hyper-V on RHEL or CentOS.  This will allow you to use the much more performant drivers of the synthetic storage and network systems provided by VMBUS.