Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here's the thing:
I've got dual boot computer with Ubuntu 8.04 and XP Pro. Sometimes I want to switch between these two. To do this I need to issue "Reboot" in Ubuntu, wait for grub menu and choose XP and then wait for it to boot. Instead I would like to issue "boot to Windows" at Ubuntu, walk away to make some tea and come back at XP desktop loaded.
The other way round is easy as Ubuntu is default system to boot. How do I make it work both ways?

Solution:
I picked the grub-set-default solution as the easiest and most elegant: Here's /boot/grub/menu.lst most important parts:

default saved
(...)
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault 0
makeactive
chainloader +1

XP is 7th entry in my grub menu, so now I should issue:

sudo grub-set-default 6
sudo reboot now

I put these two in /bin/reboot2XP script. After that I put a new activator with command gksu reboot2XP in System menu. Now I should be able to reboot to XP with a click and password entering.

Thanks!

share|improve this question
    
Interested in anyone finding a solution to this, afaik this can only be done one way like you suggest. –  Ivo Flipse Oct 1 '09 at 17:36
    
Here's another option that might work: bit.ly/cGqtlP –  Ivo Flipse Apr 30 '10 at 6:10
    
There must be a better way to do this. I used to have this in my linux distro 10 years ago. I think it was a KDE option and I was running Mandrake (Mandriva's ancestor) or maybe SuSe (openSuSe's ancestor). Reboot would bring up a gui where I could chose the OS to reboot into. Was it a feature no longer available to grub? For all I know I was using lilo, it was a while ago... –  terdon Aug 17 '12 at 18:05

3 Answers 3

up vote 3 down vote accepted

I suggest reading this article by PC World on: Auto reboot and Switch Default OS on dual boot XP and Vista and here's an excellent article by HowToGeek on the same subject: Create Shortcuts to Quickly Reboot to the Alternate OS in a Vista/XP Dual-Boot

Update: You should be able to use the grub-set-default command to tell grub to boot into an alternate option just once.

Hope HowToGeek can help edit this post into something that switches between Linux and XP.

After reading quite a bit of the Microsoft BCD publicaton and doing some extensive research on .bat files and bootloaders I came up with this. The procedure below employs DOS, Bootloaders and a nifty little program called wizmo. At this point and time I have a shortcut on each of my desktops that once clicked upon automatically reboots the system to the other OS. This feature I couldn't live without as I am constantly using XP for work stuff and Vista for personal stuff. So, if you want a nifty auto reboot button that takes you to your other OS... READ ON. Dangerous and exciting walkthrough follows. IF this sounds like something your going to do, read this walkthrough a couple of times as making a mistake can be costly...see the last disclaimer below.

Disclaimer: Caution be very carefull, messing with your master boot record and bcd store is dangerous and could cause your system not to boot at all, thus leading to more pain and suffering, proceed with caution.

share|improve this answer
1  
I've looked at this before, and I didn't come up with a good solution yet. The problem is figuring out a way to change the grub option from Windows. –  The How-To Geek Oct 1 '09 at 18:50
    
Actually looks like the grub-set-default command might make it work. Will have to test it further though. –  The How-To Geek Oct 1 '09 at 18:56

You could write a script that would modify grub.conf to select your Windows installation as the default, write a new grub to your boot loader area, and then reboot. The problem with this is that now you'd have the opposite problem rebooting into Ubuntu.

You could get a copy of GRUB that will run under Windows, but then you'd also have to either have a duplicate grub.conf or somehow mount the grub.conf from your Ubuntu installation under Windows. Maybe you could create a tiny FAT partition that holds your grub.conf and make /etc/grub.conf a link to there?

share|improve this answer
    
+1 for mini-boot partition on FAT. then you should be able to run grub-set-default from windows or linux. or you could access your current grub.conf from windows with a ext2-for-win filesystem driver, but i don't know enough about those to recommend one. –  quack quixote Oct 1 '09 at 20:24

How about set Windows as your default boot OS and specify a timer for GRUB (see grub timeout)?

sudo gedit /boot/grub/menu.lst

Add or change:

timeout 10

Or some other value. The above will boot your default entry 10 seconds after displaying the boot menu, if you don't select anything else.

share|improve this answer

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.