Boot GRUB to entry not booted to last time?
The procedure created thanks to this, this and that; untested:
- Boot Ubuntu.
- Modify
/etc/default/grub
and setGRUB_DEFAULT=saved
there. - In the same file set
GRUB_TIMEOUT
to a non-negative integer. You may even wantGRUB_TIMEOUT=0
(meaning "boot immediately without displaying the menu"). - Use
grub-set-default
to set your default entry as Ubuntu. Update your GRUB config (
update-grub
).-
Use
grub-reboot
to point GRUB to Windows on the next boot only. The code from this answer may be your starting point:grub-reboot "$(grep -i 'windows' /boot/grub/grub.cfg|cut -d"'" -f2)"
Verify if it works, just reboot. After you get it right, go back to Ubuntu and make the
grub-reboot
command run automatically whenever Ubuntu starts (e.g. put it in/etc/rc.local
).
Now your machine will boot Ubuntu by default. When it boots, GRUB is told to start Windows once on the next boot. So your second boot will run Windows. The third boot should behave exactly as the first one -- and so on.