Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

Bill

share|improve this question
    
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 1:07

3 Answers 3

First time, start here

Run 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, start from here

Then, 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 magic number (the menuentry one) --once | grub --batch

share|improve this answer

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).

share|improve this answer

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:

  1. Open Grub Customizer
  2. Click the General Settings tab
  3. Under the "default entry" heading select "previously booted entry"
  4. Click the Save button or select File > Save
  5. 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.)

  6. 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!

share|improve this answer
    
Very nice way to do it. –  laurent Dec 17 '12 at 11:16

Your Answer

 
discard

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.