4

Just thinking out loud here and hoping for a second opinion.

I just got a RPi3 that I am loving. I was looking at using it as a remotely accessible WOL server. The PC I am trying to reach is dual-booted with Windows 10 and Ubuntu 17.10 in which I have configured VNC access to each. I got to thinking that even if I configure the WOL server and I send the magic packet, I still won't be able to choose what OS will be loaded (because AFAIK the magic packet isn't capable of relaying this sort of information).

So, Option 1) Write a python script that can change the grub configuration file to specify the preferred default boot option. Assuming the Ubuntu drive/filesystem is accessible from Windows, a python script would be written accordingly. More easily, a different python script would be made to run in Ubuntu (to make it easier than plainly editing the grub conf file).

Option 2) Not sure if this is even possible but what if I hosted a symlinked (via some intermediate cloud service) grub conf file on the RPi? This way, I wouldn't have to worry about changing the grub conf file from Windows OR Ubuntu, I could just do it on the RPi. What I'm not sure about here is when the change made on the RPi will be accessible to grub in relation to a boot sequence.

I'd appreciate any feedback regarding a more efficient way of accomplishing the above, issues/feasibility regarding the above, miscellaneous ideas, etc. Thanks!

2 Answers2

1

The way I solved a similar situation was defaulting grub to boot from Ubuntu. Then add an alias at the end of the file /etc/bash.bashrc that reboots to the Windows partition (number 4 for me).

alias windows="sudo grub-reboot 4 && sudo reboot"

The problem with this is that, if you are in Windows and you want to reboot to Windows again, it will first go to Ubuntu by default and you will have to ssh/VNC and reboot to Windows manually with the windows alias. This hasn't been a problem for me so far.

To reboot from Windows to either Windows or Ubuntu, you can create a script that will modify a grub file in /boot. See Is there a way for grub to automatically reboot into Windows from Windows?

Katu
  • 3,663
0

I will have to look more into this but I thought it was a good find: https://github.com/Fmstrat/diy-ipmi

It is a DIY IP KVM setup: A web-accessable IPMI / IP KVM system that provides full keyboard control, monitor view, and and the ability to reboot computers with standard motherboards remotely as if you were sitting in front of them with a keyboard and monitor. 

Obvious con: Requires purchasing (claimed less than $120) and installation of extraneous equipment

Pro: It would seem that the behavior of the setup resembles a VNC server but from any point in boot sequence or thereafter. Thus, the grub menu (or any bootloader) and any OS would be accessible remotely.