#1 How to setup a headless dual boot system
Posted: Mon Jul 05, 2021 1:02 pm
I have several dedicated crunching systems which are headless, meaning they have no monitor, keyboard or mouse connected to them. I installed Windows 7 on them but wanted the option to boot and run them under linux should the need arise. Setting up a dual boot system is the obvious answer, except how do you choose which OS to boot when your system doesn't have a monitor or keyboard? Turns out it's fairly easy to set up.
First, Windows should be installed. Next install Ubuntu server. There's plenty if info on the web about how to install Ubuntu after Windows to create a dual boot system. Just follow those. If anyone has questions, just ask though. If you don't want to install a seperate disk for linux and have enough free space on your current Windows partition, you can shrink the Windows partition to create free space to install Ubuntu. If windows is installed after linux, just run...
sudo update-grub
After you have a dual boot system working, you need to tweak the grub boot configuration. Edit the file /etc/default/grub and change the line that looks like this...
GRUB_DEFAULT=0
To this...
GRUB_DEFAULT=saved
Save the file and run...
sudo update-grub
The default OS is linux. If you reboot, it will default to linux. But there is a way to make it boot to Windows on just the next re-boot, then revert back to linux as the default. You need to verify which boot option Windows is listed under. On my installs its 4, but to be sure reboot and pay attention to which position Windows is listed in. They're not numbered on the screen though. Just a list. Windows is always the last option and if there are 3 choices, then Windows will be option 2. If there are 4 choices, WIndows will be option 3.
Now if you are running linux and want to boot to Windows run...
grub-reboot 2 (or whatever option number Windows was in on the Grub boot options)
You can make a script file to run the reboot commands with a single command. Put this in a file and save it as boot-win...
/etc/init.d/boinc-client stop
grub-reboot 2
shutdown -r now
Be sure to change the permissions of the file boot-win by running...sudo chmod 777 /boot-win
To run it and reboot to windows run...
sudo /boot-win
NOTES:
-Any time windows restarts, it will always boot to linux.
-If you plan to install Windows on the same disk as linux, be sure to give Windows enough disk space. I would go no less than 100GB and even then it will limit how to can bunker, software installs, etc.
-If you install Windows after linux, you will need to re-install grub. See this...https://askubuntu.com/questions/83771/r ... -windows-7
First, Windows should be installed. Next install Ubuntu server. There's plenty if info on the web about how to install Ubuntu after Windows to create a dual boot system. Just follow those. If anyone has questions, just ask though. If you don't want to install a seperate disk for linux and have enough free space on your current Windows partition, you can shrink the Windows partition to create free space to install Ubuntu. If windows is installed after linux, just run...
sudo update-grub
After you have a dual boot system working, you need to tweak the grub boot configuration. Edit the file /etc/default/grub and change the line that looks like this...
GRUB_DEFAULT=0
To this...
GRUB_DEFAULT=saved
Save the file and run...
sudo update-grub
The default OS is linux. If you reboot, it will default to linux. But there is a way to make it boot to Windows on just the next re-boot, then revert back to linux as the default. You need to verify which boot option Windows is listed under. On my installs its 4, but to be sure reboot and pay attention to which position Windows is listed in. They're not numbered on the screen though. Just a list. Windows is always the last option and if there are 3 choices, then Windows will be option 2. If there are 4 choices, WIndows will be option 3.
Now if you are running linux and want to boot to Windows run...
grub-reboot 2 (or whatever option number Windows was in on the Grub boot options)
You can make a script file to run the reboot commands with a single command. Put this in a file and save it as boot-win...
/etc/init.d/boinc-client stop
grub-reboot 2
shutdown -r now
Be sure to change the permissions of the file boot-win by running...sudo chmod 777 /boot-win
To run it and reboot to windows run...
sudo /boot-win
NOTES:
-Any time windows restarts, it will always boot to linux.
-If you plan to install Windows on the same disk as linux, be sure to give Windows enough disk space. I would go no less than 100GB and even then it will limit how to can bunker, software installs, etc.
-If you install Windows after linux, you will need to re-install grub. See this...https://askubuntu.com/questions/83771/r ... -windows-7