Can't find hypervisor information in sysfs!

Very often, people search how to resolve this annoying message, espacially when you reboot after a fresh Xen (or XCP) install. In this post, we'll understand what does it mean and how to fix it.

Just a fresh install

If you read previous article about installing XCP on Debian 7, you have now rebooted in your fresh system, but can't do anything, because Xen tells you:

ERROR:  Can't find hypervisor information in sysfs!

This "bug" is common to all Debian versions, and it's not really a bug, but more a question of post-install script, which doesn't trigger Xen Kernel in Grub configuration file.

Grub2 on Debian

If you list all files in your /etc/grub.d folder, you'll get:

-rwxr-xr-x 1 root root 6.6K Oct 14 10:31 00_header
-rwxr-xr-x 1 root root 5.3K Oct 14 10:07 05_debian_theme
-rwxr-xr-x 1 root root 6.2K Oct 14 10:31 10_linux
-rwxr-xr-x 1 root root 5.8K Oct 14 10:31 20_linux_xen
-rwxr-xr-x 1 root root 5.9K Oct 14 10:31 30_os-prober
-rwxr-xr-x 1 root root  214 Jan 18  2011 40_custom
-rwxr-xr-x 1 root root   95 Jan 18  2011 41_custom
-rw-r--r-- 1 root root  483 Jan 18  2011 README

It means when you build your grub config files, it starts with header, then add debian theme, then push regular kernel, then Xen Kernel etc. But it's not that we want :)

Solution

Propper way

The propper way to do this, is the "dpkg way" as indicated in Debian documentation. So:

# dpkg-divert --divert /etc/grub.d/08_linux_xen --rename /etc/grub.d/20_linux_xen

And rebuild your Grub config file:

# update-grub

Old way

If you want to have a Xen enabled kernel, you need to invert order, simply like that:

# mv /etc/grub.d/10_linux /etc/grub.d/20_linux && mv /etc/grub.d/20_linux_xen /etc/grub.d/10_linux_xen

And rebuild your Grub config file:

# update-grub

Now, reboot, and you're done!