Ubuntu – One click shutdown Ubuntu and load into alternative bootup

dual-bootgrub2shutdownwindows

I have a dual boot system with Ubuntu 11.04 and Windows 7.

My GRUB bootloader defaults to Ubuntu.
I mainly use Ubuntu, but I occasionally need to bootup Windows to do a few things.

If I need to do something in Windows I can "shutdown" Ubuntu and select Windows 7 in the bootloader. However, it would be more efficient if I could do this in one click from Ubuntu.

  • Is it possible to press a key in Ubuntu which means "Shut down, and then boot into Windows"? (or for that matter Shut down and boot into any non-default bootup)

Best Answer

In case you know the entry number for your Windows installation (start counting with 0 for first position) in the grub menu you can reboot into Windows (assuming to be 3rd on the list) by this command:

grub-reboot 2

Alternatively you can also use the textual entry used:

grub-reboot '<type entry here>'

This command can also be put in a launcher for "single-click" usage.

To make this procedure work we need the entry GRUB_DEFAULT=saved in /etc/default/grub.

Related Question