Custom Kernel on KVM from Xen

Hello all,

Sorry if this is a very noobish or basic question, but we used to use the 'PV-Grub' method of running a custom Kernel under Xen (https://www.linode.com/docs/tools-refer … ith-pvgrub">https://www.linode.com/docs/tools-reference/custom-kernels-distros/run-a-custom-compiled-kernel-with-pvgrub). Now everything is moving to KVM, how do we ensure this carries across our Linodes?

We attempted to upgrade one to KVM without changing any settings (on hindsight probably a stupid idea) and it defaulted to booting straight to grub and not doing much else. We had to fix this by editing the configuration and selecting a 'latest x64' Kernel instead so the machine would boot. Of course, this means we are no longer using the custom installed kernel…

We tried 'Direct Disk' as an option but the console complained about a missing MBR. As the name suggests, I'm learning here so this is a little new to me. Sorry if this is a silly and obvious question. Any new pointers on how to do this on the new KVM platform? Thanks in advance.

2 Replies

Direct-to-disk will only work after "grub-install /dev/sda" (so to speak), but for a custom kernel, you don't need that.

What you need is

1) a kernel which may be run under KVM (make sure you didn't customize so much that it only supports Xen)

2) Either:

  • A well written /boot/grub/grub.cfg if you select "GRUB2" as the "kernel".

  • A well written /boot/grub/menu.lst if you select "GRUB (Legacy)" as the "kernel".

and

3) A well written /etc/fstab.

The so called "distro-helper" modifies /etc/fstab for you, but I'm not sure it's smart enough to modify menu.lst or grub.cfg as well.

So, my recommendation would be to use UUID wherever possible. Then you can stop worrying about disk name changes.

Thanks for your response.

It looks like our problems were caused by an issue Linode side. An operator on IRC has confirmed legacy grub was misconfigured and this problem has now been resolved. I can confirm things are now working correctly after a few changes to grub's menu.lst file. For those who are interested, we needed to do the following to get our CentOS 6.5 boxes to work correctly after conversion to KVM:

1. Replace '/dev/xvda' with '/dev/sda' in /boot/grub/menu.lst

2. Add "console=ttyS0" to the end of the kernel line(s).

If we've missed any steps or it may be advisable to perform some additional steps, please let us know.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct