Thursday, March 11, 2010

IT From All Angles

Minimize
Jul 10

Written by: Matthew.Mattoon
Friday, July 10, 2009 

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.

Tags:

12 comment(s) so far...

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

These instructions do not work on Hyper-V R2 (Integration components v2). An error occurs when updating module dependencies. I am using CentOS 5.3 with the same kernel version.

By Alex on   Sunday, September 20, 2009

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

Alex,

I think this may be related to not properly updating the symbolic link in step 2. If that does not turn out to be the case please email me with my web form on this site.

-matt

By Matthew Mattoon on   Wednesday, September 23, 2009

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

Just a note for anyone that finds this, linux kernels have probably updated since 5.3 was released (mine was upped from 2.6.18-128 to 2.6.18-164). So, your options are to force install of the devel of your version or upgrade the current kernel (yum install kernel-devel kernel) and reboot so that the kernel matches the kernel-devel you'll receive.

Here's what you'll need for option 1.
If you followed the steps above to install the newer version:
yum remove kernel-devel
yum search kernel-devel --showduplicates
then type (bah, no copy available) the kernel source line you need
yum install kernel-devel-2.6.18-128.el5.x86_64

And Voila! kernel sources to match your kernel.

By Jack on   Friday, September 25, 2009

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

I tried to update thru yum from kernel .128 to kernel .164. In fact i think its a upgrade from RHEL 5.3 to 5.4. After upgrading I am unable to boot inside the virtual server. It gives an error: Cannot find VolGroup00 etc.....Booting with old kernel .128 gives no problem. Any experience with this ???
I will try to install a virtual server with RHEL 5.3 wihout the Linux addons. Then do the upgrade. This to make shure it is not an issue with the Linux addons

By paul on   Monday, October 12, 2009

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

I tried to update thru yum from kernel .128 to kernel .164. In fact i think its a upgrade from RHEL 5.3 to 5.4. After upgrading I am unable to boot inside the virtual server. It gives an error: Cannot find VolGroup00 etc.....Booting with old kernel .128 gives no problem. Any experience with this ???
I will try to install a virtual server with RHEL 5.3 wihout the Linux addons. Then do the upgrade. This to make shure it is not an issue with the Linux addons

By paul on   Tuesday, October 13, 2009

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

Paul,

edit your grub.conf file, and take out hda=noprobe & hdb=noprobe

By Erik on   Friday, October 30, 2009

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

Forgot to add, after re-booting, you need to rebuild/reinstall the IC components,

By Erik on   Friday, October 30, 2009

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

Nice instructions, worked like a champ.

By Kukulkan on   Thursday, November 12, 2009

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

During the execution of depmod I get errors like "WARNING: could not find /opt/linux_ic/drivers/dist/vmbus/../hv/vmbus/.vmbus.i686.cmd for /opt/linux_ic/drivers/dist/vmbus/../hv/vmbus/vmbus.i686"

By Greg Hullender on   Tuesday, December 15, 2009

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

Nice post! It was very useful for me. In addition I have created a short howto about installing the linux integration components in a non-running kernel. This howto can be found at:
www.devplace.nl/blog/updating-hyper-v-drivers-after-kernel-upgrade-on-centos .


By Joris van de Sande on   Saturday, December 26, 2009

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

Many thanks for the tutorial. I seem to be falling at the last hurdle though. Using Hyper-V R2 and the R2 integration components, 2.6.18-164.11.1.el5-x86_64 kernel. I get the errors below.

I'm no Linux expert, but note the comment above about the link, and this is in place and working.

Any help much appreciated!

[root@localhost linux_ic_rtm]# ./setup.pl drivers
Checking if required components are installed...done.
Updating Linux integration components (vmbus, enlightened ide, enlightened scsi and network drivers) for Hyper-V...
Building vmbus driver...done.
Building blkvsc driver...done.
Building storvsc driver...done.
Building netvsc driver...done.
Installing vmbus driver...done.
Installing blkvsc driver...done.
Installing storvsc driver...done.
Installing netvsc driver...done.
Updating module dependencies. This may take a while...An error has occured during the setup! Please view the drvinstall.err for more details.
[root@localhost linux_ic_rtm]# cat drvinstall.err
Building modules, stage 2.
WARNING: could not find /opt/linux_ic_rtm/drivers/dist/vmbus/../hv/vmbus/.vmbus.x86_64.cmd for /opt/linux_ic_rtm/drivers/dist/vmbus/../hv/vmbus/vmbus.x86_64
/opt/linux_ic_rtm/drivers/dist/blkvsc/blkvsc_drv.c: In function ‘blkvsc_ioctl’:
/opt/linux_ic_rtm/drivers/dist/blkvsc/blkvsc_drv.c:1490: warning: unused variable ‘blkdev’
Building modules, stage 2.
WARNING: could not find /opt/linux_ic_rtm/drivers/dist/blkvsc/../hv/blkvsc/.blkvsc.x86_64.cmd for /opt/linux_ic_rtm/drivers/dist/blkvsc/../hv/blkvsc/blkvsc.x86_64
Building modules, stage 2.
WARNING: could not find /opt/linux_ic_rtm/drivers/dist/storvsc/../hv/storvsc/.storvsc.x86_64.cmd for /opt/linux_ic_rtm/drivers/dist/storvsc/../hv/storvsc/storvsc.x86_64
Building modules, stage 2.
WARNING: could not find /opt/linux_ic_rtm/drivers/dist/netvsc/../hv/netvsc/.netvsc.x86_64.cmd for /opt/linux_ic_rtm/drivers/dist/netvsc/../hv/netvsc/netvsc.x86_64
make: depmod: Command not found
make: *** [install] Error 127

By Tim Boothby on   Tuesday, February 02, 2010

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

Well I'm not 10% sure how, but I've managed to get it working and I though was worth sharing.

The "make: depmod: Command not found" error is caused by /sbin not being in the $PATH variable.

This can be resolved with "PATH=\sbin:$PATH" at least until the next reboot.

in /lib/modules/ I had two folders 2.6.18-164.11.1.el5 and 2.6.18-164.el5. It seems I was fixing the build link in in the wrong one, it should have been the 2.6.18-164.el5 folder, even though uname tells me my kernel is 2.6.18-164.11.1.el5.

Despite a load of errors in drvinstall.err I now have a working seth0 adapter.

Now I'm left with it unable to reboot. On boot it hangs early in the process at "Red Hat nash version 5.1.19.6 starting" Fortunately I have a snapshot of the working VM, so as long as I never turn it off, it will be fine! I'll post back if I find a fix for this problem.

I wish Microsoft would sort these drivers on a few other versions of Linux. I understand they don't want to get bogged down in providing tech support for umpteen flavours of Linux, but surely they could release tested versions of the drivers with step by step instructions that are verified to work. Loving Hyper-V but it's been a struggle to get a free Linux running on it.

By Tim Boothby on   Friday, February 05, 2010

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 

Search IT From All Angles Blog

Minimize