Dual boot - how to select OS with remote only?
#1
I have dual boot HTPC running WinXP and XBMCLive Dharma 4 Beta. Both installed onto the hard drive. At the startup I get the menu that allows me to select the operating system. Since this is HTPC, I have no keyboard connected. All is controlled via remote. Is there a way to get the remote working before the menu loads so I can select which OS I want?

Thanks.
Reply
#2
Unless your BIOS can see your remote as an emulated keyboard or something similar, I don't think you'll be able to do this. I could be wrong, and if someone wants to correct me, I'm fine with that.
Reply
#3
Agree, a HID remote seen as keyb/mouse might work. (I have not tried)

Only workaround I can think of to avoid plugging in keyb is to install the bootloader to a USB key and insert that when you want to boot second OS. Both OS still on HD.
This is fine for low freq use of 2nd OS, if you use it 50/50 I am not aware of any solution.
Reply
#4
I am assuming it is grub boot loader that gives you a menu at start up.
You can write a script that will switch default OS (linux) to alternative OS (win) when you press given button on controller and then restart. Upon restart it will boot up to win instead of linux.
However I am not aware on how to change it back from windows. There is grub for windows so I am assuming it is doable (windows will switch default OS back to linux)
Reply
#5
http://sidvind.com/wiki/GRUB:_Boot_another_OS_once
Reply
#6
Edit: hm, perhaps I should test it before I make any statments. perhaps it will work as is. Should have considered that another 30s.
Reply
#7
Thanks for all the replies.

vikjon0 Wrote:Only workaround I can think of to avoid plugging in keyb is to install the bootloader to a USB key and insert that when you want to boot second OS. Both OS still on HD.
This is fine for low freq use of 2nd OS, if you use it 50/50 I am not aware of any solution.

For a noob like me, I think this would be the best way to go. I only use Windows to play games (not that frequently) so sticking USB thumbdrive is not a problem. Any tutorials on how to move the Grub2 into USB to accomplish that?
Reply
#8
Hm, I have actually only done it in the ubuntu installer. Then it is done by running the installation in "expert mode" (priority=low) and answering no when asked to install bootloader to first HD. Then you manually tell him to install to e.g /dev/sdb which with any luck is the USB. (HD normally sda).

I think what you need to do is:
sudo fdisk -l to see the disks

If the correct disk is sdb:
sudo grub-install /dev/sdb

However, I am not sure if this is enough/correct, you should do some more research.

Also, I have only done the other way around, win as default and USB bootloader pointing to a ubuntu /boot with (of course) ubuntu as default.
I didnt consider that your solution will be more complicated since it will not be enough to point to the existing /boot. Sorry. Quickfix would be to create a dummy /boot I, but still will require some research and testing.

Perhaps you should try the suggestion with boot "once" first?

By the way...when playing win games dont you need any controllers or keyboard that will sort this out?
Reply
#9
vikjon0 Wrote:By the way...when playing win games dont you need any controllers or keyboard that will sort this out?

Yes, I have a controller (Logitech Dual Action USB) but it needs a driver and it is not functional at the loader menu. Same with the remote.
Reply
#10
vikjon0 Wrote:Only workaround I can think of to avoid plugging in keyb is to install the bootloader to a USB key and insert that when you want to boot second OS. Both OS still on HD.
This is fine for low freq use of 2nd OS, if you use it 50/50 I am not aware of any solution.
The boot once GRUB option is actually miles better in my opinion in that scenario. It works beautifully in my experience (Once you get it working Smile )

I can provide you with the script to run from XBMC to do the reboot (via remote) if you wish. But first get Grub working to your liking.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#11
Thanks for all the helpful replies.

I guess I have to rethink my strategy. I am not that familiar with Linux and yesterday couldn't even boot into WinXP or XBMC. I got "Read error" on the screen. I think having two operating systems and trying to do automated dual boot may be beyond my capabilities.
Reply
#12
I got it working and it is pretty slick, so I thought I will share.

My system is Ubuntu 10.04 with Dharma beta4. So Grub2 is being used as boot loader and Ubuntu 10.10 and Win7 are alternative OSes.

1) First you need to modify your /etc/default/grub file
Important part is first two lines (this is new with version 10.04 and higher as far as I am aware)

Code:
mp@nexus:~$ cat /etc/default/grub
GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved

#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

...


2) then you recreate your grub.cfg with:

Code:
sudo grub-mkconfig > /boot/grub/grub.cfg

3) tell grub which number is your default OS (in my case is first on the list so the number is 0)

Code:
grub-set-default 0

4) to reboot to your alternative OS you do
Code:
sudo grub-reboot 1

where number 1 is Ubuntu 10.10 and number 2 will be Win7 in my case (so this need to be adjusted with your system)

And now after reboot grub will load OS number 1 from the list, after you restart again it goes back to your default OS.

All that is left is to create short script that will set number for new OS (sudo grub-reboot 1) and reboot and assign it to the remote control button.
Reply
#13
Beware, once you upgrade your kernel the numbering might go off.
So it is more futureproof to use the menu name entry rather than the id.
something like:
/usr/sbin/grub-reboot "Microsoft Windows XP Professional (on /dev/sda1)"
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply

Logout Mark Read Team Forum Stats Members Help
Dual boot - how to select OS with remote only?0