Windows Server 2012 and Ubuntu 12.04.1 under Hyper-V
The easiest way to get Ubuntu 12.04 running well under Hyper-V on the 2012 platform would be to download the Windows Azure Cloud Image - unfortunately as I check today (July 10 2013) the images are not available on the Ubuntu Cloud Images image store. I've filed a question on their answers site which you can follow to see if they restore the cloud images.
That said, let's discuss why you have an issue: 12.04.2 has an older kernel without the latest Hyper-V integration (kernel modules) that were baked into 12.10 and are in 13.04 as well. The cure is to get a newer kernel. As I said earlier, the easiest way to get the right image is to get an image built for Windows Azure - the Azure public cloud and your private Hyper-V server both run essentially the same hypervisor, so any instructions applicable to Azure are applicable to you.
To run on the Azure platform, aka the 2012 Hyper-V hypervisor, Microsoft recommends under their list of endorsed distributions of Linux that you follow a number of steps to update 12.04.x distributions to use a backported kernel and kernel modules. You do not need to install the walinuxagent or reconfigure GRUB, which is only necessary for Windows Azure. The full instructions are reproduced here with the walinuxagent and GRUB instructions removed:
-
sudo sed -i "s,archive.ubuntu.com,azure.archive.ubuntu.com,g" /etc/apt/sources.list
This step updates the mirrors to point to an Azure hosted mirror.
-
sudo apt-add-repository ‘http://archive.canonical.com/ubuntu precise-backports main’
This step adds the repository needed to get the kernel and agent changes.
sudo apt-get update
-
sudo apt-get install linux-backports-modules-hv-precise-virtual
This step adds the update kernel and associated modules.
-
sudo apt-get install hv-kvp-daemon-init
This step adds the updated agent.NOTE: I have removed the walinuxagent from this command. It is not needed for private clouds, but is for Windows Azure. This update does however install the key value pair exchange which may be used for time sync and other things, but I am not entirely certain.
- This step removed as it pertains to modifying GRUB to run more efficiently on Windows Azure.
- (recommended)
sudo apt-get dist-upgrade
sudo reboot
A final note: these instructions add a new repository to your Ubuntu machines and you should be aware of the effect this has. Ensure that the first command runs correctly (I have not tested it myself in the past week) to replace archive.ubuntu.com
with azure.archive.ubuntu.com
. I have performed these steps myself but I cannot say they will work in the future. Just be aware that the goal of the first step is to point your Ubuntu distribution to use a new set of default repositories designed to backport support for Windows Azure and the 2012 Hyper-V hypervisor.