Dual boot Windows and Fedora, after rebooting from seconday OS (Fedora) it directly boots to pimary OS (Windows) without Grub showing

I am running a laptop with dual boot Windows 10 and Fedora 40. Grub works as it should. Whenever I boot my laptop, it appears no problem on boot. I have Windows as my default entry for grub. Whenever I reboot from Windows to Windows again, it works flawlessly. The issue consists when I reboot from Fedora, and grub doesn’t come up but boots directly to Windows. It always does this. It acts as some sort of cycle. Where after booting to the second OS, it wants to boot to the primary without asking.

I have tried for a while now to tweak settings in the grub, but to no success. I managed to fix this issue once when I installed a theme on grub, but didn’t understand how I fixed it. To my avail, thinking I wouldn’t touch grub again, the next kernel update it rested it as it was.

I have tried to make Fedora as my primary entry and the same happens to the Windows in this case the second OS, after rebooting it grub won’t show and would boot directly to Fedora.

I haven’t seen any other topics regarding this problem to any other OS. I am still a beginner trying to figure out Fedora, I have a couple of months searching for a solution but to no avail.

Looking forward to hearing your advices and experiences.

Kind regards!

I have to wonder how you set windows to be the default for booting.
On every dual boot system I have used the default has always been the latest installed fedora kernel.
The grub menu is normally displayed by default during boot as well when dual booting and is hidden when only fedora is installed.

The content of the grub env file can be seen with sudo grub2-editenv - list.
A user may unhide or hide the grub menu by setting it within the environment file using sudo grub2-editenv - unset menu_auto_hide or sudo grub2-editenv - set menu_auto_hide=1.

The system can be configured to save the most recently used boot entry as the default by editing the file /etc/default/grub and adding the option GRUB_SAVEDEFAULT=true at the end of that file, followed by sudo grub2-mkconfig -o /boot/grub2/grub.cfg. This then would add the variable save_default=true into the output of the list from the grub env file shown above.
When doing so, now the system always saves the last booted kernel/OS as the default for the next boot. Setting the default in this way means that to change the default it is only necessary to select a different option from the grub menu (which means the grub menu has to be visible).

My guess would be that the BIOS was used to boot windows directly.
Is that the case @doodle ?

Choosing Fedora in the BIOS will get you to the grub prompt.
Edit: and from the grub prompt you can pick fedora or windows,

Thank you for your reply.

Yes, I have Fedora for the BIOS. The problem doesn’t consist there. It works fine, as I mentioned. Problem is I think since I am dual booting I think there is some sort of cycle going on where after rebooting from Windows and booting to Fedora works fine. After I reboot from Fedora, it boots me directly to Windows. Only on this case, does this anomaly occur, as all the other times grub works as it should.

I followed your commands, and for the
sudo grub2-editenv - list command, I got

saved_entry=gnulinux-6.8.9-300.fc40.x86_64-advanced-30649eb8-245d-41d5-b43b-34fdd003fde0
menu_auto_hide=1
boot_success=0
boot_indeterminate=0

Which I have already menu_auto_hide=1 as you said. I haven’t tried the unset menu_auto_hide.

This is also my grub config file, I have tried other tweaks to this but to no avail. I am open to other suggestions.

GRUB_TIMEOUT="5"
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT="Windows Boot Manager (on /dev/nvme0n1p1)"
GRUB_DISABLE_SUBMENU="true"
#GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau rhgb quiet rd.driver.blacklist=nouveau modprobe.>
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG="false"
#GRUB_HIDDEN_TIMEOUT="0"
#GRUB_TIMEOUT_STYLE="menu"

GRUB_SAVEDEFAULT="true"
export GRUB_COLOR_NORMAL="light-gray/black"
export GRUB_COLOR_HIGHLIGHT="white/white"
GRUB_THEME="/boot/grub2/themes/tela/theme.txt"
GRUB_BACKGROUND="/boot/grub2/themes/tela/background.jpg"
GRUB_GFXMODE="1920x1080,auto"

Thank you in advance!

This sounds like Windows “Fast Startup”, which is really hibernation. Some systems have it as a BIOS setting, but you should be able to disable it in Windows. Some Windows updates will enable it (maybe the updates that reboot multiple times).

Thank you for your reply!

I disabled according to your guide. I have still hibernation enabled as I do use that, but still the same sistuation. Should I also try to remove hibernation as well?

Hybernation on recent systems with SSD’s can be more trouble than it is worth for the small amount of time and battery power saved when booting Windows.

Hibernation stores a “snapshot” of the system state on disk in hyberfil.sys (see Windows documentation: How to Disable and Re-enable Hibernation. Windows fastboot uses this “snapshot” when booting from power off by setting the UEFI BootNext variable to Windows. Fedora’s efibootmgr can view and adjust UEFI variables. Some things you can try:

  • UEFI “BIOS” update: your UEFI “BIOS” may not fully support dual boot configurations. Check with the vendor for updates or use Fedora’s fwupdtool.

  • change GRUB_DEFAULT to saved.

  • in a Fedora terminal, use efibootmgr to get the hex value XXXX assigned to Fedora and thensudo efibootmgr -n XXXX to set the hex value of BootNext to the Fedora value. On my dual boot system, BootNext is not set and Fedora is first in the BootOrder list.

  • enabling the Gnome menu to see if that comes up when rebooting from linux,

  • disabling hibernation in Windows.

Posting the details of your system (e.g., output from inxi -Fzxx) may help others with the same problem find this topic.

Dear George, I thank you very much for your time and information you provided. I read the hibernation docs and links and learned some new things, however I still can’t remove hibernation as it helps with my productivity.

  1. I tried first the Fedora’s fwupdtool and didn’t find any updates for my firmware.
  2. I tried before to change GRUB_DEFAULT to saved and what it does is saves the last system you booted, I don’t want that. I only want grub to appear at all times when I boot my system. This skips the grub completely.
  3. I also tried efibootmgr to change the BootNext, but again I want grub to be shown not to boot on system directly.
  4. Gnome menu does come up after rebooting from Linux.

Here are also my system details. I will do a fresh installation of Fedora as I don’t like my current setup anymore, so I will see if this problem still occurs there.

I am leaving this thread still open as I haven’t found the solution yet, but this is the closest I have been so far.

System Output

System:
Kernel: 6.8.9-300.fc40.x86_64 arch: x86_64 bits: 64 compiler: gcc
v: 2.41-34.fc40
Desktop: GNOME v: 46.1 tk: GTK v: 3.24.41 wm: gnome-shell dm: GDM
Distro: Fedora Linux 40 (Workstation Edition)
Machine:
Type: Laptop System: HP product: HP ZBook 15 G3 v: N/A
serial: Chassis: type: 10
serial:
Mobo: HP model: 80D5 v: KBC Version 10.75 serial:
part-nu: M9R62AV UEFI: HP v: N81 Ver. 01.55 date: 04/07/2022
Battery:
ID-1: BAT0 charge: 54.6 Wh (78.9%) condition: 69.2/90.1 Wh (76.7%)
volts: 12.2 min: 11.4 model: Hewlett-Packard Primary serial:
status: not charging
CPU:
Info: quad core model: Intel Core i7-6700HQ bits: 64 type: MT MCP
arch: Skylake-S rev: 3 cache: L1: 256 KiB L2: 1024 KiB L3: 6 MiB
Speed (MHz): avg: 800 high: 801 min/max: 800/3500 cores: 1: 800 2: 800
3: 800 4: 801 5: 800 6: 800 7: 800 8: 800 bogomips: 41599
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel HD Graphics 530 vendor: Hewlett-Packard driver: i915
v: kernel arch: Gen-9 ports: active: eDP-1 empty: DP-1, DP-2, DP-3,
HDMI-A-1, HDMI-A-2, HDMI-A-3 bus-ID: 00:02.0 chip-ID: 8086:191b
Device-2: NVIDIA GM107GLM [Quadro M2000M] vendor: Hewlett-Packard
driver: nvidia v: 550.78 arch: Maxwell pcie: speed: 2.5 GT/s lanes: 16
ports: active: none off: DP-5 empty: DP-4,DP-6 bus-ID: 01:00.0
chip-ID: 10de:13b0
Display: wayland server: X.org v: 1.20.14 with: Xwayland v: 23.2.6
compositor: gnome-shell driver: X: loaded: modesetting,nvidia
unloaded: fbdev,nouveau,vesa alternate: nv dri: iris
gpu: i915,nvidia,nvidia-nvswitch display-ID: 0
Monitor-1: DP-5 model: HP Z24i G2 res: 1920x1200 dpi: 94
diag: 611mm (24.1")
Monitor-2: eDP-1 model: LG Display 0x046f res: 1920x1080 dpi: 141
diag: 396mm (15.6")
API: OpenGL v: 4.6 vendor: intel mesa v: 24.0.7 glx-v: 1.4 es-v: 3.2
direct-render: yes renderer: Mesa Intel HD Graphics 530 (SKL GT2)
device-ID: 8086:191b display-ID: :0.0
API: Vulkan v: 1.3.280 surfaces: xcb,xlib,wayland device: 0
type: integrated-gpu driver: N/A device-ID: 8086:191b device: 1
type: discrete-gpu driver: N/A device-ID: 10de:13b0 device: 2
type: cpu driver: N/A device-ID: 10005:0000
API: EGL Message: EGL data requires eglinfo. Check --recommends.
Audio:
Device-1: Intel 100 Series/C230 Series Family HD Audio
vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus-ID: 00:1f.3
chip-ID: 8086:a170
Device-2: NVIDIA GM107 High Definition Audio [GeForce 940MX]
vendor: Hewlett-Packard driver: snd_hda_intel v: kernel pcie:
speed: 8 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:0fbc
API: ALSA v: k6.8.9-300.fc40.x86_64 status: kernel-api
Server-1: JACK v: 1.9.22 status: off
Server-2: PipeWire v: 1.0.6 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa
type: plugin
Network:
Device-1: Intel Ethernet I219-LM vendor: Hewlett-Packard driver: e1000e
v: kernel port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15b7
IF: enp0s31f6 state: down mac:
Device-2: Intel Wireless 8260 driver: iwlwifi v: kernel pcie:
speed: 2.5 GT/s lanes: 1 bus-ID: 03:00.0 chip-ID: 8086:24f3
IF: wlp3s0 state: up mac:
Bluetooth:
Device-1: Intel Bluetooth wireless interface driver: btusb v: 0.8
type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 bus-ID: 1-12:4
chip-ID: 8087:0a2b
Report: hciconfig ID: hci0 rfk-id: 0 state: down
bt-service: enabled,running rfk-block: hardware: no software: no
address:
Drives:
Local Storage: total: 715.41 GiB used: 129.98 GiB (18.2%)
ID-1: /dev/nvme0n1 vendor: Samsung model: MZVKW512HMJP-000H1
size: 476.94 GiB speed: 31.6 Gb/s lanes: 4 serial: temp: 31.9 C
ID-2: /dev/sda vendor: Patriot model: P210 256GB size: 238.47 GiB
speed: 6.0 Gb/s serial:
Partition:
ID-1: / size: 236.89 GiB used: 129.5 GiB (54.7%) fs: btrfs
dev: /dev/sda3
ID-2: /boot size: 973.4 MiB used: 436.7 MiB (44.9%) fs: ext4
dev: /dev/sda2
ID-3: /boot/efi size: 598.8 MiB used: 45.8 MiB (7.7%) fs: vfat
dev: /dev/sda1
ID-4: /home size: 236.89 GiB used: 129.5 GiB (54.7%) fs: btrfs
dev: /dev/sda3
Swap:
ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 37.0 C pch: 40.5 C mobo: N/A
Fan Speeds (rpm): N/A
Info:
Memory: total: 32 GiB available: 31.22 GiB used: 4.18 GiB (13.4%)
Processes: 346 Power: uptime: 15m wakeups: 0 Init: systemd v: 255
target: graphical (5) default: graphical
Packages: pm: flatpak pkgs: 40 Compilers: gcc: 14.1.1 Shell: Bash
v: 5.2.26 running-in: gnome-terminal inxi: 3.3.34

I assume you mean Windows hybernation. When Windows is hybernating you can’t boot Fedora.

I can understand how hybernation helps: I only need Windows when reporting problems with artifacts to creators in large enterprises who only have “corporate standard” Windows. I’ve noticed that booting Windows can be a slow process, and for my use case I need to apply updates to ensure the problem isn’t fixed with an update – this week that took most of an afternoon and part of the following morning. I use WSL in Windows to get access to Linux. I have used Whitewater Foundary Fedora remix for WSL but currently have Debian in order to check that things I do in Fedora will not break in Debian. In my field, it is common for users to have Windows workstations to read the memos from HQ, but use command-line and web interfaces (Rstudio, Jupyter, etc.) with remote corporate cloud data centre systems for actual work.

Fedora runs well on the inexpensive “refurbished” systems being dumped by large enterprises because a) they don’t meet the Windows 11 requirements, and b) desktops are no longer suitable due to changes like work from home with shared cubicles at work. You might find that having a dedicated system for Fedora helps productivity.

That can be achieved by doing the following.
sudo grub2-editenv - unset menu_auto_hide as shown here.

1 Like

God dammit, this has been the solution all the time! How come I didn’t come across this thread. Its in the thread but for anyone else coming across this problem don’t forget after inserting the command run
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
in order to save the config. It is in the thread that you shared but just in case anyone forgets it.

Thank you, thank you a ton! I also appreciate all the replies of everyone in this thread. I am closing this thread now.