Solved How to increase vt console size in VirtualBox image

D

Deleted member 65953

Guest
I am running the FreeBSD-13.0-RELEASE-amd64.vhd VM image in VirtualBox (on a non-FreeBSD host). However, the console is small:
freebsd-13-in-virtualbox.png


Is there a way to increase the console's dimensions when using vt in the VHD VirtualBox image distributed by FreeBSD?

I have read this thread: Increase VT size on VirtualBox, and enabled "System > Motherboard > Enable EFI (special OSes only)" in the VirtualBox settings for the FreeBSD VM image:

freebsd-13-virtualbox-motherboard-settings.png


However, FreeBSD gets stuck during boot when EFI is enabled:

VirtualBox_FreeBSD 13.0_21_12_2021.png


Apparently, this occurs because I am supposed to install FreeBSD from scratch to use EFI (instead of using the VHD image downloaded from freebsd.org). Is there a way to increase the vt console size in the VirtualBox image provided by FreeBSD instead of installing FreeBSD from scratch?
 
Last edited by a moderator:
However, FreeBSD gets stuck during boot when EFI is enabled:
I see this error in VirtualBox system EFI firmware when syscons(4) is used.

In another thread you have set syscons(4) as console driver (/boot/loader.conf - kern.vty=sc). Have you removed the entry?

If not, without changing firmware to BIOS, at the Boot menu enter "3. Escape to loader prompt", enter set kern.vty=vt and boot. When the system is in multi user mode, edit /boot/loader.conf, remove entry, and set to increase the window size efi_max_resolution.

Or use Width x Height, or use a predefined value like 720p. Details in loader.conf(5).

If you want a smaller font size see loader.conf(5) screen.font. A selection of fonts can be found in /boot/fonts.
 
I see this error in VirtualBox system EFI firmware when syscons(4) is used.

In another thread you have set syscons(4) as console driver (/boot/loader.conf - kern.vty=sc). Have you removed the entry?

If not, without changing firmware to BIOS, at the Boot menu enter "3. Escape to loader prompt", enter set kern.vty=vt and boot. When the system is in multi user mode, edit /boot/loader.conf, remove entry, and set to increase the window size efi_max_resolution.

Or use Width x Height, or use a predefined value like 720p. Details in loader.conf(5).

If you want a smaller font size see loader.conf(5) screen.font. A selection of fonts can be found in /boot/fonts.

My mistake. Indeed the boot was stuck because I still had kern.vty=sc in /boot/loader.conf.

Realizing my mistake, I changed /boot/loader.conf to this:

Code:
kern.vty=vt
efi_max_resolution="800x600"
screen.font="10x18"

With this change (and a reboot), I managed to get a larger console size for vt in VirtualBox (with EFI enabled). I think my problem is mostly solved. Thank you for your help.

Two problems remain:
  • When I try to increase the console size further by using efi_max_resolution="1280x680" (followed by a reboot), the console size remains at 800x600. Why is that?
  • The /sbin/poweroff command doesn't seem to work properly when EFI is enabled. poweroff gets stuck at "uhub0: detached":
VirtualBox_FreeBSD 13.0-poweroff.png
 
kern.vty=vt
It's not necessary to set vt(4) explicitly, the system defaults to it.

  • When I try to increase the console size further by using efi_max_resolution="1280x680" (followed by a reboot), the console size remains at 800x600. Why is that?
Ah, Ok, I haven't used custom EFI screen resolutions for a long time, only predefined, like 720p or 1080p. I didn't thought about this issue more carefully.

The value for efi_max_resolution must be one the EFI frame buffer is capable of.

To get a list of possible screen resolutions, escape to loader prompt at the boot menu, execute gop list, choose a value for use.

With this subject opened (I forgot about this method), it's also possible to set the EFI screen resolution in /boot/loader.conf with the gop command, for example:
Code:
exec="gop set 5"

The /sbin/poweroff command doesn't seem to work properly when EFI is enabled. poweroff gets stuck at "uhub0: detached":
That seems to be a bug, but a resolvable one. Choose in Settings -> System -> Motherboard -> Chipset: ICH9 (instead of PIIX3).
 
Back
Top