remote control of dual boot

Jacques Dimanche jbd at home.sysads.com
Thu Nov 18 04:26:26 UTC 2004


Stewart Nelson wrote:

>Hi,
>
>I have a conventional dual-boot system:
>Win XP on IDE primary master, grub in MBR,
>FC2 on primary slave.
>
>If either Windows or FC2 is running, I can
>access it with VNC.  Of course, a reboot will
>switch to the default OS, if the other is running.
>However, I don't know how to switch back.
>
>Is there a good way to boot FC2 from Windows?
>Or to boot Windows from FC2?
>  
>

Here is how I would do it.  I would make my linux be the default OS to 
boot into.  You mentioned that you can control both OS'es remotely so 
this shouldn't be a problem.  If you are in windows, then you can just 
reboot to boot into linux.  While in linux, you can reboot into windows 
by executing the following commands:

enter grub with:
    grub --no-floppy (don't probe floppy drives makes it go faster if 
you do not have a drive like all my machines)
in the grub command line:
    savedefault --default=2 --once    (replace 2 with the appropriate 
selection that is your windows option in grub.conf)
    quit
Then you can reboot and it will boot into Windows.  When you reboot 
again, it will go back into Linux.

Here is a simple python batch file you can use that I wrote off of the 
top of my head:


#!/usr/bin/python
import os, sys

#Replace the following with the appropriate choice
DOSCHOICE=2

pipe = os.popen("/sbin/grub --no-floppy", 'w')
pipe.write('savedefault --default=DOSCHOICE --once\nquit\n')
pipe.close()

os.system('/sbin/shutdown -r now &')
sys.exit(0)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3178 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20041118/5c15710f/attachment-0002.bin 


More information about the users mailing list