Is there some way when I'm in Ubuntu 12.10 that I can set it to reboot automatically to Windows just once, so that when I'm in Windows I can reboot and it will automatically boot back into Ubuntu? I need this because often when I travel I access my home computer for email and other personal info that I don't want to travel with or leave to the tender mercies of the "cloud". On rare occasions, I need to temporarily boot into Windows 7 to do something Windows-specific, but then I want to be able to boot back into Ubuntu because that's where most of my computing takes place. Any ideas? Thanks in advance!
-
This question has multiple good answers and it is potentially relevant to anyone who uses both Ubuntu and Windows on the same computer. This is not too localized. – Eliah Kagan Dec 19 '12 at 01:07
3 Answers
First time, edit GRUB configuration:
sudo nano /etc/default/grub
Then find the line:
default=Something goes here
And change to:
default=saved
Next, run
sudo update-grub
Next time, run fgrep menuentry /boot/grub/grub.cfg
Count your Windows menuentry from the list (starting from 0, e.g. first is 0, second is 1...).
Finally run
echo "savedefault --default=<your number> --once | grub --batch

- 197,895
- 55
- 485
- 740
Thanks for the replies. I actually found a way that's somewhat easier. The first step was indeed to set the default in GRUB to "saved", but being a GUI-oriented person who makes frequent typos I found you can do the exact same thing in GRUB Customizer (which you can get at grub-customizer. My steps were as follows:
- Open Grub Customizer
- Click the General Settings tab
- Under the "default entry" heading select "previously booted entry"
- Click the Save button or select File > Save
Open a terminal window and type in the following: sudo grub-reboot position of Windows in Grub menu minus 1 (so on my netbook it would be "sudo grub-reboot 5", e.g.)
Reboot the computer
This will cause the computer to reboot to Windows automatically one time only, then when you reboot from Windows it will automatically reboot into Ubuntu.
And now I end where I should have started. This has worked on both my Linux laptops:
- Brand new System 76 Pangolin Performance (p9) laptop running Ubuntu 12.10 64-bit in xubuntu desktop environment
- 3 year-old Acer Aspire One netbook running Ubuntu Studio 12.04 32-bit in native environment
Thanks for the help!

- 45

- 21
This is not an exact solution to the problem you have but this is how I solved it many years ago and never had to look back. Maybe today you will be able to find a way to boot one time in windows and boot back to ubuntu (in a reasonable easy way) but at the time I couldn't.
I installed virtualbox and "cloned my windows install in it" (manually reinstalled the same way :) ) and defined default boot to ubuntu. There are ways to clone it automatically I think but I never used and I'm not sure how well they work. This way, if I need windows from remote place, no need to reboot, I start it from ubuntu. I maintained the dual boot too but after 2 years never booting in windows (only using the virtual machine when needed) I finally removed the dual boot and never had problems using it this way (and this was in 2007/8).

- 6,779