In a Universal Blue distribution (in my case Bazzite, but I wouldn’t expect it to be Bazzite-specific), how can I set the default entry for grub? I am dual booting with Windows and on my pc it currently boots Bazzite by default. I have also installed Bazzite on my laptop, however I haven’t had time to fully configure it there, so I would like to set Windows as the default boot option on my laptop (for now).
I couldn’t find any documentation about it regarding Universal Blue or Fedora Atomic, I already tried editing /etc/default/grub as you would in traditional distributions but that doesn’t work.
You can’t set it on your BIOS?
Well I can set the BIOS boot order to Windows, but then it bypasses the grub menu completely and to select Bazzite I would have to use the BIOS boot menu.
Ideally I would still want to have the grub menu so that on each boot I have at least a few seconds where it waits and displays the boot entries before booting the selected entry, instead of having to quickly spam the BIOS key and hope that it’s in time before Windows boots.
I did exactly that recently, but unfortunately I am not currently at my Bazzite box to review the details.
There is a GRUB configuration file, probably at /etc/default/grub
, where you change the value of the parameter GRUB_DEFAULT=0
to the item you want to pick (If you only dual-boot, then Windows is probably number 2, because it’s indexed from zero).
Then there’s some ujust
script you run, I believe it was something in the sense of update-grub
or regenerate-grub
, and that’s it.
Ah, on the second reading I noticed you did already find the config file. So my guess is that you just need to run the correct ujust
command to rebuild the GRUB configuration for the change to take effect.
You can run ujust --choose
to see all the available operations and pick the right one.
Hm I solved it somehow, but I don’t know what it was that made it work. From the bits and pieces I could gather around, what I did originally was:
I read that you could set the default entry not only by number, but also by text, so I’d rather have that because even if the order of the entries change, the default boot option stays the same.
So I ran sudo cat /boot/grub2/grub.cfg | grep "Windows Boot Manager"
to get the correct menu entry, which returned 'Windows Boot Manager (on /dev/nvme0n1p1)'
, so I put that as GRUB_DEFAULT. And I think I ran ujust regenerate-grub
after that, but somehow that didn’t work.
But just now that I edited /etc/default/grub for the second time to be sure and reran ujust regenerate-grub
it works.
I thought maybe the quotes were the cause of it not working (the entry in grub.cfg had single quotes and I used double quotes in /etc/default/grub) but now that I tried both it doesn’t seem to matter.