Hyper-V Program Manager
Now that the Hyper-V integration services are included in the official Linux builds – I wanted to try out a Linux distribution that is not officially supported by Microsoft and see what was involved in getting it all working. With the recent release of Ubuntu 10.10 I thought I would try out their server version. After downloading the bits from http://www.ubuntu.com/server I created a quad-processor virtual machine with a non-legacy network adapter.
Installation was fairly straight forward:
However – Ubuntu does not have the Hyper-V enlightened network drivers enabled by default – so the installation complains about not being able to find any network adapters:
But I just ignored that and moved along with the install:
I chose the default packages for setting up a LAMP server:
The install finished and I was dropped at the login prompt:
A cool thing to note was that at this stage I could already shut down the virtual machine by using the shutdown button on the Virtual Machine Connection window, so part of the integration services are already running. You can also see that all four virtual processors are there and working:
Getting the Hyper-V drivers up and running at this point in time is actually relatively simple. The first thing you need to do is to edit /etc/initramfs-tools/modules and add the following lines to the end of it:
Once you have made these changes you will need to run “update-initramfs –u” and reboot. You will now have the Hyper-V drivers for storage and networking loaded:
You can confirm that these drivers are loaded by running “lsmod” after the reboot:
The final thing you need to do is to configure networking (because that step was skipped during installation). The first thing to do is to run “ifconfig –a” to find out what name your network adapter has been given. In my case it was “eth0” – but this is not always the name it will get. Once you know the name you will need to edit /etc/network/interfaces and add the following to the end of the file:
For DHCP (what I did):
auto eth0 iface eth0 inet dhcp
For a Static IP address:
auto eth0 iface eth0 inet static address [insert your IP address] netmask [insert your netmask] Gateway [insert your gateway address] Like this:
One more reboot and running “ifconfig” should confirm that everything is working:
And in my case I could also confirm that the website was accessible from my parent partition as well:
So there you have it. Ubuntu Server 10.10 running under Hyper-V with full integration services using nothing other than what is included on the Ubuntu install media.
Santo subito!! (immediately Saint!)
Great article, thank you. I have been evaluating Ubuntu server 10.04 in hyper-v, but the integration is not as seemless as in Ubuntu 10.10 it seems. It is unfortunate that 10.04 is LTS and 10.10 is not, but having a better integration is key for me.
The new 10.10 is damn easy on Hyper-V compared to some of the older 10.04 and 9.x editions.
We still need mouse integration thou and I haven't been able to find anything on how to enable it. The only integration depends on the vmbus module being installed but with 10.10 it's hv_vmbus and will not work.
the hv_vmbus, hv_netvsc and hv_utils are installed by default
You only need to add
hv_utils= time sync and Shutdown
excellent, thanks Ben
No need to reboot to get network up, I used this command "sudo /etc/init.d/networking restart"
Question: did you set-up a SCSi disk or IDE's?
I tried with SCSI but they aren't detected during the installation.
What version or ubuntu server you installed? 64 or 32 bits? Does it make a difference?
Thank you for sharing this article, that is an impressive amount of screenshots!
I have not followed through the article yet but it is on my list of things to do today when I deploy, great work!
I have not tried to setup mouse - as the Server install options I chose did not include X Windows.
Pablo Campos -
I will have to check that out. I did not need to enable time sync and shutdown - they were both working out of the box.
Doug Thomson -
Cool. I knew there would be a way to do this - but could not find it quickly :-)
I am using IDE. Whether you are running Windows or Linux you can only boot off of IDE with Hyper-V. Also - I used the 64-bit version of Ubuntu (and it should not make any difference).
On the other hand, Ubuntu 10.10 Desktop i386 doesn't work under Hyper-V. Well it kinda works, but it's the worst kind of working illusion, where it either doesn't boot or crashes after a few minutes. For comparison I tried it on VMWare Server 2 and it worked straight away
i am trying to install ubuntu 10.10 but unfortunately i have problems with my network configuration.How can I have the Hyper-V drivers for storage and networking loaded??
please help me,someone..i need your help.
Thanks for your very clear explanation.
I will try it tonight when i'm home.
Will keep you updated about the results.
Please help! -
Can you provide the details of what did not work for you?
My problem occured after the installation from: edubuntu-10.10-dvd-amd64.iso
On the installation from edubuntu-10.10-dvd-i386.iso where everything worked ok.
I wanted to use the 64 bit variant.
With the same (on Hyper-V) environment settings is installed Maverick from edubuntu-10.10-dvd-amd64.iso
and was not able to get a working nic.
The solution from Ben Armstrong, given by Mark Pizzolato works (in my case) only whith a non-GUI installation of ubuntu server 10.10 amd64
After installing GUI packages the boot image was destroyed including my working nic
I haven't tried this yet, But I have run into a fairly serious issue using the Microsoft LinuxIC rpm for Red Hat on Centos VMs. I've not yet narrowed this down to the nic teaming or the integration components, and I know Microsoft's policy is not to support nic teaming. Disabling the team is not an option, as we need to have complete redundancy throughout the network. The problem is as follows:
After a live migration, the linux VM fails to send a gratuitous ARP. Since the nic team rewrites the frames with its own MAC, the ARP table on the router still has the MAC address of the nic team on the server it just migrated off of. Furthermore, the periodic arp polling that the nic team does still includes this address, so even if connectivity re-establishes, it keeps going up and down as the ARP table on the router changes.
If I do an ifdown eth0 && ifup eth0 to force a gratuitous ARP to be sent, everything is fine. Obviously that's not going to work when PRO Tips migrates a VM at 3 in the morning.
This problem doesn't exist at all with windows guests. The gratuitous ARP is sent immediately after the migration and network connectivity stays up. That is what leads me to believe this is a bug in the LinuxIC code.
I sure would appreciate it if you can get this information to the right person!