25.04.1 Boot Console Screen Resolution

Greetings all,

I recently upgraded one of my TrueNAS systems from CORE (13.0-U6.7) to SCALE (25.04.1 Fangtooth.)

No issues encountered during the upgrade process. (Thanks iX developers!)

However, after completing the upgrade/install, I noticed that during the SCALE boot up sequence (which appears to be occurring post GRUB execution after the handoff to the linux O/S) that the boot console screen display resolution switches over to a much higher display resolution than it was originally when I was on CORE. Once there, it stays on this higher resolution output for the remainder of the start up sequence.

The increased boot console screen display resolution is causing an issue with my console display monitor (…which expects a lower resolution output for the console screen.)

Consequently, is there a way to tell Fangtooth to reduce the console display screen output resolution so it will be at the same resolution that it was in CORE?

All the best,
Bill

I don’t use SCALE so this is merely a suggestion. Update your grub with one of the following vga= options.

Color Depth 800x600 1024x768 1152x864 1280x1024 1600x1200
8 bit vga=771 vga=773 vga=353 vga=775 vga=796
16 bit vga=788 vga=791 vga=355 vga=794 vga=798
24 bit vga=789 vga=792 vga=795 vga=799

Note that system updates will most likely overwrite any changes to the grub.cfg file. I see someone has devised a workaround which may work for you…

Thanks for the suggestion @MikeO3. I’ll give that a try and see if it resolves my issue. I use a rack mounted display console here for my TrueNAS CLI, so replacing it would be an expensive option.

All the best,
Bill

Well… @MikeO3 's previous suggestion seemed likely to solve my issue. So I
found the original ā€œ/etc/default/grub.d/truenas.cfgā€ file as follows:

GRUB_DISTRIBUTOR=ā€œTrueNAS Scaleā€
GRUB_TIMEOUT=10
GRUB_DISABLE_RECOVERY=ā€œtrueā€
GRUB_CMDLINE_LINUX_DEFAULT=ā€œlibata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=Nā€
GRUB_TERMINAL_INPUT=ā€œconsoleā€
GRUB_TERMINAL_OUTPUT=ā€œconsoleā€
GRUB_CMDLINE_LINUX=ā€œā€

I remounted ā€œboot-pool/ROOT/25.04.1/usrā€ as rw and edited ā€œ/usr/local/bin/truenas-grub.pyā€ to add the following directives to the "config = " portion of the script:

    'GRUB_GFXMODE=1024x768',
    'GRUB_GFXPAYLOAD_LINUX="keep" ',

After saving truenas-grub.py and a reboot I found ā€œ/etc/default/grub.d/truenas.cfgā€ had added the additional directives as follows:

GRUB_DISTRIBUTOR=ā€œTrueNAS Scaleā€
GRUB_TIMEOUT=10
GRUB_GFXMODE=1024x768
GRUB_GFXPAYLOAD_LINUX=ā€œkeepā€
GRUB_DISABLE_RECOVERY=ā€œtrueā€
GRUB_CMDLINE_LINUX_DEFAULT=ā€œlibata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=Nā€
GRUB_TERMINAL_INPUT=ā€œconsoleā€
GRUB_TERMINAL_OUTPUT=ā€œconsoleā€
GRUB_CMDLINE_LINUX=ā€œā€

Looked good, so I then remounted the boot-pool as rw and ran ā€œupdate-grubā€ to update grub boot loader… Rebooted again with high hopes and… no joy. I’ll have to investigate further to see where I’m going off the rails. :frowning: <grrr…>

All the best,
Bill

1 Like

Ok here’s the addendum to the ā€˜set console display resolution’ investigation:

First, I found that ā€˜GRUB_TERMINAL_OUTPUT=ā€œconsoleā€ā€™ needed to be set as ā€˜GRUB_TERMINAL_OUTPUT=ā€œgfxtermā€ā€™ to allow the grub GFX setups to have effect.

Afterwards… still ā€˜no cigar’ on getting the linux kernel to recognize the grub GFX settings as directed.

So I next spent some time looking through the framebuffer docs and kernel command line parameters at www.kernel.org. I found on [The kernel’s command-line parameters — The Linux Kernel documentation] that there is a [video=] switch available on every linux machine with a FrameBuffer. The config parameters are documented on [https://www.kernel.org/doc/Documentation/fb/modedb.rst].

I then added the [video=1024x768@60me] switch to the default linux cmd line in the truenas-grub.py script and that solved the kernel issue.

The script generated truenas.cfg file in /etc/default/grub.d/ is now:

GRUB_DISTRIBUTOR=ā€œTrueNAS Scaleā€
GRUB_TIMEOUT=10
GRUB_GFXMODE=1024x768
GRUB_GFXPAYLOAD_LINUX=ā€œkeepā€
GRUB_DISABLE_RECOVERY=ā€œtrueā€
GRUB_CMDLINE_LINUX_DEFAULT=ā€œlibata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N video=1024x768@60meā€
GRUB_TERMINAL_INPUT=ā€œconsoleā€
GRUB_TERMINAL_OUTPUT=ā€œgfxtermā€
GRUB_CMDLINE_LINUX=ā€œā€

I then did an ā€œupdate-grubā€ to activate the changes in grub and we’re now in business.

I still need to rewrite the ā€˜advanced serial console’ portion of the truenas-grub.py script so that the serial portion runs correctly in ā€œconsoleā€ mode rather than ā€œgfxtermā€ mode when serial output is selected (…though I don’t use a serial console here.) It would be nice to be able to input the console resolution parameters in the web UI and have it propagate over to the low level system. (Perhaps a feature request is up coming?) :slight_smile:

I’m still not sure why the GRUB2 parameters devoted to this purpose (i.e.: GRUB_GFXMODE and GRUB_GFXPAYLOAD_LINUX) aren’t passing gfx cfgs over to the kernel. However, it all works now and my console monitor is running at the correct screen resolution.

All the best,
Bill

OK… So after some time, review, wading through incomplete documentation (which always seems to lag behind the actual software), and some head scratching; I believe that I have found a better way to accomplish console video output resolution changes.

By using the existing TrueNAS middleware ā€œmidclt call system.advanced.updateā€ call from the TrueNAS shell, you can pass the additional Linux kernel parameter ā€œvideo=HxVx@Rā€ into the system ā€œkernel_extra_optionsā€ variable, which will change the console resolution at the next boot up without resorting to changing any system scripts (…which is probably a process heavily frowned upon by the TrueNAS folks.)

So for my console video application the middleware shell command is:

midclt call system.advanced.update ā€˜{ā€œkernel_extra_optionsā€: ā€œvideo=1024x768@60meā€}’

Since the middleware facility to add additional kernel options already exists in TrueNAS, it seems that it would be a fairly straightforward process to add an item to the advanced options section of the GUI to send Linux boot parameters over to the kernel without having to access the shell. That maybe an item the developers might consider in the future.

All the best,
Bill

doesn’t seem to work for me when trying to remove these invalid amd entries
GRUB_CMDLINE_LINUX_DEFAULT="libata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1
kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N libata.allow_tpm=1 int
el_iommu=on zfsforce=1 nvme_core.multipath=N"

They don’t seem to be in the db, but somehow keep getting added to the truenas.cfg file

All of those additional options are being added to the truenas.cfg file by the middleware python script at boot time. While I haven’t done any specific research on this, I would suspect that if your using a ā€˜non-AMD’ processor, those options are likely to be ignored by the kernel and thus have no effect on your system.

If you have an specific interest in items passed to the kernel, you can review The kernel’s command-line parameters — The Linux Kernel documentation for further details.

All the best,

Bill

yes, they are hard coded into the python-grub script.
config = [
f'GRUB_DISTRIBUTOR="{vendor}"',
'GRUB_TIMEOUT=10',
'GRUB_DISABLE_RECOVERY="true"',
'GRUB_CMDLINE_LINUX_DEFAULT="libata.allow_tpm=1 amd_iommu=on iommu=pt '
'kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N'
f'{f" {kernel_extra_options}" if kernel_extra_options else ""}"',
]
spew out a bunch of errors for me as mine is intel and I don’t want iommu passthrough.

would have thought they would test for the CPU environment and at least give iommu options.

Very interesting… I use an Intel i3-6100 cpu on my scale system here. I have the same grub default parameters defined by the middleware in my ā€˜GRUB_CMDLINE_LINUX_DEFAULT’. However, I have seen no iommu or kvm related errors as you describe occurring on that system during boot up.

I’m currently running TrueNAS community edition v25.10.0.1. Just some thoughts… could it be a software revision related issue? Could it be related to kvm being enabled by default in the BIOS?

All the best,

Bill