Issue with default Grub booting option

bellocarico

Member
Sep 17, 2022
63
8
13
I have been scratching my head on this one for a while, basically due to GPU pass-through and certain modules white/black listed as a grub option I needed to tweak the /etc/defaults/grub

The thing *works” as expected, but I'm unable to have grub selecting the first menu reference, it always defaults to the second (Advanced) and this doesn't use the custom grub config I set up so the box crashes and I need to manually be present at the console to select the right grub option at each reboot.

Proxmox VE GNU/Linux is what I want:
1738310021397.jpeg
but the default highlighted and then auto-selected option is the : Advanced options for Proxmox VE GNU/Linux

I already went through the proxmox-boot-tool refresh and update-grub/update-grub2 with no success.
So long story short: how do I make my Proxmox/grub default to the first option in the menu?

Code:
root@proxmox:~ # cat /etc/default/grub
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=10
GRUB_RECORDFAIL_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian `
GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt intel_iommu=on i915.enable_gvt=1 usbcore.autosuspend=-1 split_lock_detect=off"
GRUB_CMDLINE_LINUX=""

# If your computer has multiple operating systems installed, then you
# probably want to run os-prober. However, if your computer is a host
# for guest OSes installed via LVM or raw disk devices, running
# os-prober can cause damage to those guest OSes as it mounts
# filesystems to look for things.
#GRUB_DISABLE_OS_PROBER=false

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Code:
root@black:/etc/grub.d # ls -l
total 92
-rwxr-xr-x 1 root root   726 Mar 20  2023 000_proxmox_boot_header
-rwxr-xr-x 1 root root 10046 Nov  8  2022 00_header
-rwxr-xr-x 1 root root  6260 Nov  8  2022 05_debian_theme
-rwxr-xr-x 1 root root 14123 Nov  8  2022 10_linux
-rwxr-xr-x 1 root root 14180 Nov  8  2022 20_linux_xen
-rwxr-xr-x 1 root root  3799 Feb 11  2023 20_memtest86+
-rwxr-xr-x 1 root root 12923 Apr 19  2024 30_os-prober
-rwxr-xr-x 1 root root  1372 Nov  8  2022 30_uefi-firmware
-rwxr-xr-x 1 root root   214 Nov  8  2022 40_custom
-rwxr-xr-x 1 root root   215 Nov  8  2022 41_custom
-rw-r--r-- 1 root root   483 Nov  8  2022 README

Code:
proxmox-ve: 8.3.0 (running kernel: 6.8.12-7-pve)
pve-manager: 8.3.3 (running version: 8.3.3/f157a38b211595d6)
proxmox-kernel-helper: 8.1.0
pve-kernel-5.15: 7.4-15
proxmox-kernel-6.8: 6.8.12-7
proxmox-kernel-6.8.12-7-pve-signed: 6.8.12-7
proxmox-kernel-6.8.12-6-pve-signed: 6.8.12-6
proxmox-kernel-6.8.12-5-pve-signed: 6.8.12-5
pve-kernel-5.15.158-2-pve: 5.15.158-2
pve-kernel-5.15.102-1-pve: 5.15.102-1
ceph-fuse: 17.2.7-pve3
corosync: 3.1.7-pve3
criu: 3.17.1-2+deb12u1
glusterfs-client: 10.3-5
ifupdown2: 3.2.0-1+pmx11
intel-microcode: 3.20240910.1~deb12u1
ksm-control-daemon: 1.5-1
libjs-extjs: 7.0.0-5
libknet1: 1.28-pve1
libproxmox-acme-perl: 1.5.1
libproxmox-backup-qemu0: 1.4.1
libproxmox-rs-perl: 0.3.4
libpve-access-control: 8.2.0
libpve-apiclient-perl: 3.3.2
libpve-cluster-api-perl: 8.0.10
libpve-cluster-perl: 8.0.10
libpve-common-perl: 8.2.9
libpve-guest-common-perl: 5.1.6
libpve-http-server-perl: 5.1.2
libpve-network-perl: 0.10.0
libpve-rs-perl: 0.9.1
libpve-storage-perl: 8.3.3
libspice-server1: 0.15.1-1
lvm2: 2.03.16-2
lxc-pve: 6.0.0-1
lxcfs: 6.0.0-pve2
novnc-pve: 1.5.0-1
proxmox-backup-client: 3.3.2-1
proxmox-backup-file-restore: 3.3.2-2
proxmox-firewall: 0.6.0
proxmox-kernel-helper: 8.1.0
proxmox-mail-forward: 0.3.1
proxmox-mini-journalreader: 1.4.0
proxmox-widget-toolkit: 4.3.4
pve-cluster: 8.0.10
pve-container: 5.2.3
pve-docs: 8.3.1
pve-edk2-firmware: 4.2023.08-4
pve-esxi-import-tools: 0.7.2
pve-firewall: 5.1.0
pve-firmware: 3.14-3
pve-ha-manager: 4.0.6
pve-i18n: 3.3.3
pve-qemu-kvm: 9.0.2-4
pve-xtermjs: 5.3.0-3
qemu-server: 8.3.6
smartmontools: 7.3-pve1
spiceterm: 3.3.0
swtpm: 0.8.0+pve1
vncterm: 1.8.0
zfsutils-linux: 2.2.7-pve1
 
Last edited:
Maybe saving the last boot option is a solution for you ?
GRUB_DEFAULT="saved"
GRUB_SAVEDEFAULT="true"
Thanks, when I do, so I seem to hit a grub bug

Diskfilter writes are not supported.​

It seems like the only way to progress is to revert the changes to the grub config to let it boot properly. So back to square 1.
 
Thanks, when I do, so I seem to hit a grub bug

Diskfilter writes are not supported.​

It seems like the only way to progress is to revert the changes to the grub config to let it boot properly. So back to square 1.
Met the same situation the default selection stuck on the second one (Advanced) :(
 
Hi bellocarico, I found this may related to kernel pinning. I've pinned the kernel to a specific version, so maybe the grub.cfg would change default selected option to the second one (Advanced).
 
Last edited:
yes, kernel pinning in Grub works by pre-selecting a boot entry ;)
 
  • Like
Reactions: gonghao
Hi bellocarico, I found this may related to kernel pinning. I've pinned the kernel to a specific version, so maybe the grub.cfg would change default selected option to the second one (Advanced).
yes, kernel pinning in Grub works by pre-selecting a boot entry ;)
So let me understand... with the anticipation that I'm on ext4 and not zfs.

What am I exactly to do after upgrading the kernel?
I usually run update-grub and update-grub2, however indeed I have a kernel pinned as my motherboard is not working fine with any kernel greater than 6.5.13-6-pve, so I pinned it via proxmox-boot-tool kernel pin command.

Regardless, the Advanced option doesn't work (module errors and kernel crash) so I need to select manually the first option.

I sound confused, don't I !?! :-)

Thanks!!
 
Last edited:
inspect your grub.cfg - the options should apply to all kernel entries, also those under advanced.. maybe also post the output of "proxmox-boot-tool status"
 
inspect your grub.cfg - the options should apply to all kernel entries, also those under advanced.. maybe also post the output of "proxmox-boot-tool status"
I did that alreadys, but I don't see anything related to Kernel version? What am I missing here?

GRUB_DEFAULT=0
GRUB_TIMEOUT=10
GRUB_RECORDFAIL_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian `
GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt intel_iommu=on i915.enable_gvt=1 usbcore.autosuspend=-1 split_lock_detect=off"
GRUB_CMDLINE_LINUX=""
 
that is not grub.cfg, but /etc/default/grub - the latter is part of the input for the former. grub.cfg is in /boot or on your ESP in EFI/proxmox/grub.cfg
 
  • Like
Reactions: bellocarico
Wow thank you I missed that totally. That said... this is HUGE! I guess this is the relevant part for advanced right?

Code:
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Proxmox VE GNU/Linux' --class proxmox --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-54574949-e5df-414d-9032-cc1850ab2672' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/3bEZlG-pmsp-LLej-ICmh-M79N-yVBs-6Wpvvl/fXPF7z-xypQ-Dnes-eucR-i80F-ZXwz-Nw0lZj'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='lvmid/3bEZlG-pmsp-LLej-ICmh-M79N-yVBs-6Wpvvl/fXPF7z-xypQ-Dnes-eucR-i80F-ZXwz-Nw0lZj'  54574949-e5df-414d-9032-cc1850ab2672
        else
          search --no-floppy --fs-uuid --set=root 54574949-e5df-414d-9032-cc1850ab2672
        fi
        echo    'Loading Linux 6.8.12-8-pve ...'
        linux   /boot/vmlinuz-6.8.12-8-pve root=/dev/mapper/pve-root ro  quiet iommu=pt intel_iommu=on i915.enable_gvt=1 usbcore.autosuspend=-1 split_lock_detect=off
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.img-6.8.12-8-pve
}
submenu 'Advanced options for Proxmox VE GNU/Linux' $menuentry_id_option 'gnulinux-advanced-54574949-e5df-414d-9032-cc1850ab2672' {
        menuentry 'Proxmox VE GNU/Linux, with Linux 6.8.12-8-pve' --class proxmox --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.8.12-8-pve-advanced-54574949-e5df-414d-9032-cc1850ab2672' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_gpt
                insmod lvm
                insmod ext2
                set root='lvmid/3bEZlG-pmsp-LLej-ICmh-M79N-yVBs-6Wpvvl/fXPF7z-xypQ-Dnes-eucR-i80F-ZXwz-Nw0lZj'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='lvmid/3bEZlG-pmsp-LLej-ICmh-M79N-yVBs-6Wpvvl/fXPF7z-xypQ-Dnes-eucR-i80F-ZXwz-Nw0lZj'  54574949-e5df-414d-9032-cc1850ab2672
                else
                  search --no-floppy --fs-uuid --set=root 54574949-e5df-414d-9032-cc1850ab2672
                fi
                echo    'Loading Linux 6.8.12-8-pve ...'
                linux   /boot/vmlinuz-6.8.12-8-pve root=/dev/mapper/pve-root ro  quiet iommu=pt intel_iommu=on i915.enable_gvt=1 usbcore.autosuspend=-1 split_lock_detect=off
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd.img-6.8.12-8-pve
        }
        menuentry 'Proxmox VE GNU/Linux, with Linux 6.8.12-8-pve (recovery mode)' --class proxmox --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-6.8.12-8-pve-recovery-54574949-e5df-414d-9032-cc1850ab2672' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_gpt
                insmod lvm
                insmod ext2
                set root='lvmid/3bEZlG-pmsp-LLej-ICmh-M79N-yVBs-6Wpvvl/fXPF7z-xypQ-Dnes-eucR-i80F-ZXwz-Nw0lZj'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint='lvmid/3bEZlG-pmsp-LLej-ICmh-M79N-yVBs-6Wpvvl/fXPF7z-xypQ-Dnes-eucR-i80F-ZXwz-Nw0lZj'  54574949-e5df-414d-9032-cc1850ab2672
                else
                  search --no-floppy --fs-uuid --set=root 54574949-e5df-414d-9032-cc1850ab2672
                fi
                echo    'Loading Linux 6.8.12-8-pve ...'
                linux   /boot/vmlinuz-6.8.12-8-pve root=/dev/mapper/pve-root ro single
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd.img-6.8.12-8-pve
        }
 
yes, but that doesn't seem to be the right config file if you have pinned a 6.5 kernel ;) please post the output of proxmox-boot-tool status that I asked for!
 
yes, but that doesn't seem to be the right config file if you have pinned a 6.5 kernel ;) please post the output of proxmox-boot-tool status that I asked for!

#proxmox-boot-tool status
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
E: /etc/kernel/proxmox-boot-uuids does not exist.

Currently (due to ongoing tests on this issue) I have no pinned kernel:
# proxmox-boot-tool kernel list
Manually selected kernels:
None.

Automatically selected kernels:
5.15.158-2-pve
6.8.12-7-pve
6.8.12-8-pve
and it booted into the latest:
# uname -a
Linux black 6.8.12-8-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-8 (2025-01-24T12:32Z) x86_64 GNU/Linux
but I always select the first option in grub manually.