1

As part of installing proxmox on a dedicated server running Debian, it installed a new kernel. As part of the install instructions, I am supposed to choose the new kernel in grub. However I dont have a virtual console for accessing the server at the time of boot. The only thing I can do, is to run an ssh console to the server after it boots. How can I select the pv kernel as default for boot time?

I am running Debian Wheezy on the server, and installed proxmox 3.

Joel G Mathew
  • 890
  • 1
  • 9
  • 18
  • "server" and no virtual console? Bad - maybe return it to the seller and ask for a server? What do you do if you need to reinstall totally, or do a bios upgrade? Remoete viortual consoles are standard even on low end servers these days. – TomTom Aug 02 '13 at 10:02

3 Answers3

3

Set the GRUB_DEFAULT variable in /etc/default/grub. You can use the title of the kernel entry instead of an index, so it's not disturbed by subsequent kernel installs/removals. Then you need to run update-grub. From the Grub manual:

‘GRUB_DEFAULT’
The default menu entry. This may be a number, in which case it identifies the
Nth entry in the generated menu counted from zero, or the title of a menu entry,
or the special string ‘saved’. Using the title may be useful if you want to set
a menu entry as the default even though there may be a variable number of entries 
before it.

For example, if you have:

     menuentry 'Example GNU/Linux distribution' --class gnu-linux {
     ...
     }

then you can make this the default using:

    GRUB_DEFAULT='Example GNU/Linux distribution'

If you set this to ‘saved’, then the default menu entry will be that saved by
‘GRUB_SAVEDEFAULT’, grub-set-default, or grub-reboot. 
Paulo Almeida
  • 466
  • 2
  • 6
  • How to get the title of the kernel entry? – Qian Chen Aug 18 '15 at 06:08
  • 1
    @ElgsQianChen On my system you can do it with this command: `grep "menuentry " /boot/grub/grub.cfg|cut -d"'" -f2`. But I don't know if it's universal, and if you have submenus it may also be different. You can also just look at the grub menu. – Paulo Almeida Aug 19 '15 at 22:17
0

Just edit /boot/grub/grub.cfg

set default="X"

where X is an index number of kernel definition in the /boot/grub/grub.cfg

ALex_hha
  • 7,025
  • 1
  • 23
  • 39
0

There's grub-set-default(8) which can be used to select the boot entry if you're using savedefault. If you're not using savedefault the default is set default="0" which boots the first defined kernel. Usually the kernels are ordered from latest to oldest in order to boot into the latest kernel.

ptman
  • 27,124
  • 2
  • 26
  • 45