Good day! Recently there was an urgent need to remotely reboot into another operating system on a work computer. If everything is simple in the case of a reboot from linux to windows - it is enough to fix the / etc / default / grub file and update the bootloader itself, then vice versa, it is a bit more difficult to boot from Windows, but you can
.
So let's get started!
Given:Windows xp
Ubuntu 11.04 installed on Ext4 file system
Actually, the GRUB bootloader itself, configured to boot Windows.
')
Preparing GRUB configuration filesTo remotely restart the machine from Windows to Linux, not being able to select the operating system in the list at startup, we will make two versions of the /boot/grub/grub.cfg file, each of which will be configured to start only one OS. To do this, open the file / etc / default / grub, find the line grub_default in it and set the value of the desired operating system - for example, I have the number 5 for Windows and 0 for Ubuntu (0 is the first line in the boot window, 1 is the second and t .d.) Save the file, then restart GRUB with update-grub. At this point, the /boot/grub/grub.cfg file is re-created on the system. The resulting file is saved in any convenient place, and we repeat the editing of the grub-default line, but for a different OS. Update rudely with the command and save the second copy of the file. The main thing is to decide which file belongs to which operating system.
Ext2Fsd - tool for working with ExtSo, two versions of the bootloader settings are ready, but in order to drop them on the Ext4 partition from Windows, a driver program such as Ext2Fsd is needed. You can download the latest version 0.51 from the official site
http://www.ext2fsd.com/ . Reboot to Windows and install the downloaded program.
After installation, we run the program, assign any letter to the partition with Linux (“Change Drive Letter” item), and select “Ext2 Management” (F3 key) from the context menu, where we remove the “Read Only” checkbox.

In general, the function of writing to sections with the Ext4 file system is initially disabled, and therefore it should be used with caution, at your own peril and risk, as warned by the developers on the program website.

Next, we use the usual explorer XP - we find the grub.cfg file created earlier, which is responsible for loading Linux, and we replace it with the file in the /boot/grub/grub.cfg directory.
After that, just in case, I turn off writing to a disk with Linux (I tick “Read only” again), and calmly restart the computer. Now when rebooting, linux will automatically start. We are waiting for a minute and connect our favorite client - VNC, SSH, etc.
Everything, it is possible to work in the necessary operating system!