Wednesday, March 10, 2010

IT From All Angles

Minimize
May 19

Written by: Matthew.Mattoon
Tuesday, May 19, 2009 

This is a follow-up article which will allow you to get mouse control within the Guest OS without having to 'capture' your mouse. Now generally this is not necessary, since Linux in the Datacenter is generally without a GUI, however I use Hyper-V on my Laptop and have a Linux Desktop Guest which this makes it helpful for.


Now in order to do this you will need the linux integration components previously installed. I discussed this in a previous article for Ubuntu and Debian (found here). Additionally I plan on having a follow up article for CentOS, RHEL, and Fedora (however I am slightly slow on these since I am not as familar with them).


I have verified this installation on Debian 5 and Ubuntu 9.04. I have not verified this procedure on previous versions of Ubuntu. When I release my articles on installation of Hyper-V Integration Components on other Linux Distributions I will post updates to ensure these instructions are compatible with those distributions, or I will post reasons that they are not.


If you have the linux integration components installed then that will ensure you have all of the prerequisites for building the input module. This is important as the inputvsc module is dependent on the vmbus module.
 

STEP 1 - Prestage Files
Download iso image from xen.org
http://www.xen.org/files/Satori/inputvsc.iso
Mount iso image as the guests cdrom.
Elevate permissions to root (on Ubuntu use sudo -s)
$ su -
Make directory for install files
# mkdir /opt/inputvsc
Copy install files
# cp -R /media/cdrom/* /opt/inputvsc/

STEP 2 - Install InputVSC Module
Change directory into install directory
# cd /opt/inputvsc
Execute Install Script
# ./setup.pl inputdriver
Verify the error you receive is the expected error by viewing drvinstall.err (the error should occur when 'installing the udev inputvsc rules' - This means that the module will not be loaded automatically)
# cat drvinstall.err
 

STEP 3 - Verify and Test Module
Load module manually
# modprobe inputvsc
Verify module is loaded
# lsmod | grep inputvsc
You should now be able to control your internal mouse without capturing.
 

STEP 4 - Configure Module to Automatically Load
Open /etc/initramfs-tools/modules
# nano /etc/initramfs-tools/modules
Add the following to the end of the file

inputvsc

Rebuild initrd image
# update-initramfs –u

STEP 5 - Reboot and Verify Automatic Loading of Module
Reboot
# reboot
Verify module is loaded
$ lsmod | grep inputvsc
OK and we are all done.


Now that this is done I have noticed a few issues on Debian 5 which I will be attempting to sort out. Ubuntu 9.04 did not have any of these issues. The internal mouse tracked just fine with the external mouse.

  • On startup when at the login screen the first time I click in the guest it captures the mouse. However if I uncapture and click again it does not capture (this is all pre-login).
  • I also have noticed that the guest mouse does not track exactly with my mouse, it is still usable but kind of a pain.
  • The guest viewer window needs to be selected in order to have mouse control within the guest.

Tags:

8 comment(s) so far...

Re: Hyper-V Guests: Mouse Integration on Linux VMs

Hi again,

Reiterating from my previous comment - awesome article. a real lifesaver - really.
i have the same question as per your previous article on Linux Integration Components... this time, what I did to fix it DIDNT work... :( im stumpted.


On step 2, executing the install script, the prompt displays:

sh: cannot create drvinstall.err: Read-only file system
grep: drvinstall.err: No such file or directory
*** The drivers have been installed successfully. ***

I tried my previous solution for making the drive rw

# mount -o remount,rw /dev/hda2 /

and then reran the setup, but i cannot get it to install... i get the same error. Can you help!??

(Im so close to linux vm mouse bliss....)

By Stuart on   Saturday, July 11, 2009

Re: Hyper-V Guests: Mouse Integration on Linux VMs

Hi Stuart,

My gut tells me that you are not copying the LIC files from the mounted CD to the local hard disk. Make sure that is what you are doing (this is Step 1 on the mouse integration article).

This could also be something to do with your config, however we will not be able to get enough detail out in these comment blocks to resolve it. Please use my email me form on the home page to send me a detailed message describing your environment, I can then follow it up with any questions I have.

-matt

By Matthew Mattoon on   Monday, July 13, 2009

Re: Hyper-V Guests: Mouse Integration on Linux VMs

I now have a Kubuntu 9.04 install running with the integration components under Hyper-V R2 thanks to your two articles.

Your article is the place I found clear instructions for the roll back of the kernel version.

Good job.

By Bob on   Sunday, September 27, 2009

Re: Hyper-V Guests: Mouse Integration on Linux VMs

I am trying to get mouse intergration working on Ubuntu 9.10

I've made a working kernel build (2.6.32.3) with the hyper-v drivers. However I can't get this mouse thing to work. I first had a problem with the vmbus driver. On my system it was named hv_vmbus.ko nad it was located in the /lib/modules/kernel_ver/kernel/drivers/staging/hv/ directory and not ......../kernel/drivers/vmbus/

I changed this in the setup.pl script, to work around this error. However that got me into a field of hurt. it seems to fail on the hid driver. I started the installation of this manually with make -s -C hid which gives the same errors as the auto build via setup.pl

Should I just give up building the mouse driver on this machine? Or is there a solution to this?

By Bert on   Wednesday, January 20, 2010

Re: Hyper-V Guests: Mouse Integration on Linux VMs

Hi Bert,

The mouse integration was not written for the new kernel, as such it does not reflect the correct module names in the setup.pl and some of the MAKEFILEs of the setup, I have been working on making the appropriate edits, however at this point I am not done verifying the instructions.

For those who don't know the version of the ICs this was written for used the module names (vmbus, storvsc, blkvsc, netvsc) where as the Linux Kernel uses (hv_vmbus, hv_storvsc, hv_blkvsc, hv_netvsc). My assumption is that once these references are corrected and the installation run then it should work...

-matt

By Matthew Mattoon on   Wednesday, January 20, 2010

Re: Hyper-V Guests: Mouse Integration on Linux VMs

Thanks for you really quick awnser Matt.... If you ever need something tested or verified, don't hesitate to contact me, I'd love to help you out. Best instructions about Linux and Hyper-V i found on the web, keep up the good work!

By Bert on   Thursday, January 21, 2010

Re: Hyper-V Guests: Mouse Integration on Linux VMs

Thanks for the instructions on how to get the enlightened mouse driver loaded, I've found this website very useful as an information resource for Linux systems running as Hyper-V guests.

My question follows on from Bert's above. I'm trying to get this working on kernel 2.6.32-14, but unfortunately, it's a no-go. I've managed to fix the issues that occurred when building the hid driver, only for it to fall flat on its face trying to build the inputvsc driver. I haven't managed to fix this part yet (and it looks like I won't be able to any time soon). Have you had any luck in this respect?

By Dave on   Wednesday, March 03, 2010

Re: Hyper-V Guests: Mouse Integration on Linux VMs

Hi Dave,

I have not been able to fix this yet. I have been quite busy with work, however the crux of the issue is the module rename which took place when the ICs were put into the Linux Kernel.

-matt

By Matthew Mattoon on   Thursday, March 04, 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