Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just got a dedicated server with Ubuntu 12.04 installed with a custom compiled kernel. Since I would like to install VirtualBox and this custom kernel doesn't support dynamic module loading (for security) I need to change the kernel.

I'm running some Ubuntu servers for years but never played with grub and a headless computer.

When the command update-grub is run it shows the different kernel it finds. Here is what I see

Generating grub.cfg ...
Found linux image: /boot/bzImage-3.2.13-xxxx-grs-ipv6-64
Found linux image: /boot/vmlinuz-3.2.0-34-generic
Found initrd image: /boot/initrd.img-3.2.0-34-generic
  No volume groups found

The first one is the active one as seen with uname -r. To me it looks like the second kernel is the one I should use. But I don't know how to configure grub2 to use it.

The computer is also configured with a software RAID using mdadm I guess. Never used that before. I don't know if playing with the grub of changing kernel could brake this.

What must I do to set the generic kernel as the default one so that I can get VirtualBox running.

share|improve this question
up vote 3 down vote accepted

To change the default menu entry from a terminal :

  1. Obtain the existing menuentry choice number (starting from 0) run the following from the terminal: grep menuentry /boot/grub/grub.cfg
  2. Now open /etc/default/grub as root then update GRUB_DEFAULT to the corresponding menuentry number.
  3. run sudo update-grub
  4. reboot !
share|improve this answer
Perfect. It rebooted and uname -r returns 3.2.0-34-generic. Thank you very much. – chmike Dec 6 '12 at 13:43
This does not work for me since the first page in the boot menu consists of: Ubuntu, Advanced Options (where all my kernel versions are), Mem test, Mem test. So if I change to default of 2 then the Mem test runs instead of the kernel I want from the Advanced menu. – Chef Pharaoh Jul 2 '15 at 14:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.