Ubuntu – Windows Server 2012 and Ubuntu 12.04.1 under Hyper-V

hyper-vhyper-v-server-2012Ubuntuubuntu-12.04windows-server-2012

I've set up an instance of Ubuntu 12.04.1 LTS under Hyper-V 2012. However it seems to be nondeterministic as to whether or not it completes the boot process.

I get a Kernel Panic, "IO-APIC + timer doesn't work!", which from my research is caused by not having integration services correctly installed?

It was my understanding that the integration services were all now baked into the kernel? It should then be fine to update the OS (including any kernel updates, as I'm guessing that's what has happened)

Being able to rely on this successfully booting would be great as I intend on using ssh for crisis situations.

Best Answer

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:

  1. 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.

  2. 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.

  3. sudo apt-get update
  4. sudo apt-get install linux-backports-modules-hv-precise-virtual

    This step adds the update kernel and associated modules.

  5. 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.

  6. This step removed as it pertains to modifying GRUB to run more efficiently on Windows Azure.
  7. (recommended) sudo apt-get dist-upgrade
  8. 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.