Using Ubuntu 9.04 as a Xen dom0 host with NVidia driver
I guess this is a somewhat unusual setup, but I wanted my desktop to be usable as a Xen dom0 for testing and I need the nvidia driver for Xorg.
There’s two core problems here:
- While Ubuntu provides the Xen hypervisor and associated utilities (imported straight from Debian’s repository), Ubuntu does not provide a Xen-enabled kernel.
- The NVidia kernel module is not supported on Xen-enabled kernels.
I’m using the x64 version of Ubuntu, I dont see why i386 wouldn’t work either. This text assumes you already have a working Ubuntu 9.04 desktop with the proprietry Nvidia driver installed from Ubuntu repository.
Step 1: Install Xen using Debian kernel. The easiest way to get a suitable kernel is to use the Debian Lenny kernel. This blog post neatly summarises the steps required: download linux-image and linux-modules from Debian and install, add ubuntu-xen-desktop package, remove network-manager package, and configure /etc/network/interfaces to use DHCP. I found that GRUB was setup correctly without needing any effort on my behalf.
Step 2: Remove repository-provided Nvidia module and install Kernel headers. The Nvidia kernel module as supplied by Ubuntu does not function correctly under a Xen dom0, if used a black screen is simply displayed and /var/log/X0rg.0.log will show that Xorg has frozen during startup. If you simply reboot into the new Debian kernel, you will not even get that far though, as the DKMS build step of the nvidia module will fail due to the missing headers. To get around the black screen problem you need to install Nvidia driver straight from their website, using a few flags to configure it to work on Xen.
Before getting that far though, you need to remove the Ubuntu-supplied NVidia driver and install Debian’s kernel header packages. I was using the “nvidia-glx-180″ package, so execute “apt-get remove nvidia-glx-180 nvidia-180-kernel-source”. Next, find the header packages from Debian corresponding to the linux image you downloaded in Step 1. In my case I am using “linux-image-2.6.26-2-xen-amd64″ and I needed three .deb’s: “linux-headers-2.6.26-2-common-xen”, “linux-headers-2.6.26-2-xen-amd64″ and “linux-kbuild-2.6.26″. You also need gcc-4.1 installed to build the module.
Step 3: Install the NVidia driver from their website. I downloaded NVIDIA-Linux-x86_64-180.60-pkg2.run , since that is basically the same version that Ubuntu supplies. This page on NVnews.net has the magic incantation required: as root, you need to run
IGNORE_XEN_PRESENCE=y CC="gcc -DNV_VMAP_4_PRESENT -DNV_SIGNAL_STRUCT_RLIM" ./NVIDIA-Linux-x86_64-###.##-pkg2.run
Now reboot into the Xen kernel and the Ubuntu desktop should appear as per normal.
[...] de Xen y había que conformarse con utilizar el driver nv con sus limitaciones. Hoy he encontrado ésta entrada dónde se explican los pasos para conseguirlo; aquí no incluímos nada nuevo respecto la anterior, [...]
[...] and building xenified kernel in Ubuntu 9.04 environment. I would call this way of mind anti Nathan’s Blog. Built in patched kernel open-source NVIDIA drivers work just fine on Ubuntu 9.04, providing Gnome [...]