Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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 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)
share|improve this question
up vote 15 down vote accepted

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.

share|improve this answer
Thanks. After reading your answer, I did a few searches and found the following post useful to flesh out a few more details about grub-reboot : – Jeromy Anglim May 13 '11 at 7:35

@Takkat has answered the question, but I thought I'd describe a few more details in case it might help others.

  • Boot menus count from zero. I have five elements in my boot menu. The fifth element is Windows, thus, to reboot to Windows, I had to issue the command grub-reboot 4 (i.e., not 5). UPDATE: see comments below about this possibly changing.
  • In order to edit /etc/default/grub I issued sudo vim /etc/default/grub.
  • To make the procedure work, I had to modify the existing value of GRUB_DEFAULT=0 to GRUB_DEFAULT=saved and then run sudo update-grub.

I then created a script based on the webupd8 example:

I called it winboot and put in in ~/bin

gksu grub-reboot 4
gksu reboot
share|improve this answer
Ty for giving us further details. Mind that after the next kernel update you will likely have to change your position number. – Takkat May 13 '11 at 9:03
@Takkat - Would there be a way of auto selecting the lowest line number (I'm assuming Windows is listed last in Grub2) to avoid that problem? @Jeromy - Thanks for posting this up. – boehj May 13 '11 at 11:33
I've not tested this but by using the textual description for Winodws you should be on the safe side. – Takkat May 13 '11 at 12:38

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.