I want to automate switching between Linux and windows,
as the default, the approach is to restart the pc then select the windows from the bois
I want to write a command to do this instead
I want to automate switching between Linux and windows,
as the default, the approach is to restart the pc then select the windows from the bois
I want to write a command to do this instead
No. Not possible.
The best you can do is create a setup where you have a
/etc/default/grub.linux
/etc/default/grub.windows
as a copy of /etc/default/grub
with each a GRUB_DEFAULT
pointing to the OS to boot found from this command fgrep menuentry /boot/grub/grub.cfg
.
In Linux you can then do:
sudo cp -f /etc/default/grub.windows /etc/default/grub
sudo update-grub
reboot
and it will boot into Windows. But there is no way to do this from within Windows so this is not worth it.
The really only working method when using a dual boot is to ...
... where you need to pick the other one from GRUB each time you want to start that one.
My preference would be to have them both active at the same time. And the one you use the most to be the host and the other one to be a guest:
Install virtualbox/vmware in Ubuntu/Windows (host), then install Windows/Ubuntu (guest) in virtualbox/vmware and you can have both operating systems active at the same time. Needs a bit of memory and tinkering to find an optimal memory usage.
sudo reboot
? When asking, please provide enough detail so that your question can be answered. – Nmath Jun 29 '22 at 21:02