Thursday, May 21, 2009

The layers to Linux on Hyper-V

Recently I have been seeing and getting many questions regarding the Linux Integration Components for Hyper-V virtual machines.

Through a bit of questioning, I have discovered a couple things, and distinct levels to running Linux VMs on Hyper-V.

Note: Since SuSE 10 SP2 is the ‘supported’ distribution, any instructions will be specific to it.

I am assuming that you have obtained the SuSE media and performed a ‘vanilla’ installation into a new Hyper-V virtual machine.

WARNING: Level One can lead to Level Two. And, always perform a backup / export / snapshot before proceeding. All usual disclaimers apply.

Level One – the beginning

This is a simple installation of just the Linux operating system within a Hyper-V virtual machine. The only caveat is that the VM needs a Legacy Network adapter for network connectivity.

In this case you will end up with a working Linux VM. It should auto detect an install an SMB (multi-processor) kernel and it should just work. The performance is not the best that it could be, but it should run.

Level Two – the path to enlightenment

This is the simple installation from above, with the addition of the Hyper-V Linux drivers.

This one is a bit more involved. However, the end result is that you are running the synthetic Network Adapter, and the optimized storage, and display (and other) drivers.

This optimizes drivers, but advanced integration features such as shutdown from the host (or SCVMM) is currently not available.

To obtain driver enlightenment:

a) Obtain the LinuxIC.iso

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ab7f4983-93c5-4a70-8c79-0642f0d59ec2#tm

b) obtain the inputvsc.iso for the mouse driver

http://www.xen.org/download/satori.html

c) add the kernel-source and gcc-c++ packages

YaST can be used for this, either GUI or command line

Note: if an ISO was previously attached, you may need to detach, pause, then attach the desired ISO for SuSE auto-mount to pick up the change.

If that does not work, make a mount point ( mkdir /media/CDROM ) and mount /dev/hdc /media/CDROM

d) Install the linuxic drivers

a. Open a Terminal

b. attach the downloaded LinuxIC.iso through the Hyper-V manager

c. Create a folder and copy the contents to the folder

d. mkdir /tmp/linuxic

e. cp –rp /media/CDROM/* /tmp/linuxic

f. cd /tmp/linuxic

g. ./setup.pl drivers

e) Install the mouse driver

a. Attach the inputvsc.iso through the Hyper-V manager

b. Create a folder and copy the contents.

c. mkdir /tmp/inputvsc

d. cp –rp /media/CDROM/* /tmp/inputvsc

Note: you may need to mount again: mount /dev/hdc /media/CDROM

e. cd /tmp/inputvsc

f. ./setup.pl

f) Power down the VM, remove the Legacy Network Adapter, add a Synthetic Network adapter, power on the VM (you could also do a shutdown now –hP)

g) Using YaST (or YaST2), configure the newly installed synthetic network adapter.

4 comments:

Anonymous said...

How we add the kernel-source and gcc-c++ packages ???

BrianEh said...

It all depends on the distro that you are using.

If your distro has YUM, then you simply type: yum install kernel-source and repeat this for the gcc-c++ package.

If your distro has aptitate, then you can use apt or apt-get.

If you have a GUI desktop (XWindows), then you can use the GUI package manager that is included.

You might also want to check out a fellow MVP's blog: http://blog.allanglesit.com/
Matt spends a great deal of time keeping up to date with the Linux ICs.

Anonymous said...

Sorry This is the result when I try to install inputvsc on SuSe Linux 11. Kernel 2.6.27.19-5-default #1 SMP
I´ve been instaled Integration components and network and disks works properly

Can someone to help me please

/usr/local/src/inputvsc/dist/hid/hid-input.c:95: error: redefinition of ‘input_get_drvdata’
/usr/src/linux-2.6.27.19-5/include/linux/input.h:1237: error: previous definition of ‘input_get_drvdata’ was here
/usr/local/src/inputvsc/dist/hid/hid-input.c: In function ‘input_get_drvdata’:
/usr/local/src/inputvsc/dist/hid/hid-input.c:97: error: ‘struct input_dev’ has no member named ‘private’
/usr/local/src/inputvsc/dist/hid/hid-input.c: At top level:
/usr/local/src/inputvsc/dist/hid/hid-input.c:100: error: redefinition of ‘input_set_drvdata’
/usr/src/linux-2.6.27.19-5/include/linux/input.h:1242: error: previous definition of ‘input_set_drvdata’ was here
/usr/local/src/inputvsc/dist/hid/hid-input.c: In function ‘input_set_drvdata’:
/usr/local/src/inputvsc/dist/hid/hid-input.c:102: error: ‘struct input_dev’ has no member named ‘private’
/usr/local/src/inputvsc/dist/hid/hid-input.c: In function ‘hidinput_connect’:
/usr/local/src/inputvsc/dist/hid/hid-input.c:1189: error: incompatible types in assignment
make[5]: *** [/usr/local/src/inputvsc/dist/hid/hid-input.o] Error 1
make[4]: *** [_module_/usr/local/src/inputvsc/dist/hid] Error 2
make[3]: *** [sub-make] Error 2
make[2]: *** [all] Error 2
make[1]: *** [default] Error 2
make: *** [public] Error 2

BrianEh said...

Additional, and most excellent, resources for folks wanting specific distro information and IC version information you can find it here:
http://blog.allanglesit.com/

Also, the 8 things you need to know about Linux on Hyper-V:
http://blog.allanglesit.com/Blog/tabid/66/EntryId/59/Eight-Things-You-Need-To-Know-About-Linux-on-Hyper-V.aspx