Serial Console Output with the UEFI loader - churchers/vm-bhyve GitHub Wiki
If you using loader="grub"
, the required command get automatically injected for correct serial output. Unfortunatly, modern Linux distributions like Ubuntu 20.20 LTS are requiring UEFI to boot properly without modification of the upstream image. To enable proper output, we have to alter the grub configuration in the guest.
Create a file /etc/default/grub.d/99-bhyve.cfg with the following content:
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
Now run update-grub
to activate the new settings. After the next reboot, vm console <guest>
should output the console content.
Create a file /etc/default/grub.d/99-bhyve.cfg with the following content:
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --speed=115200"
Now run sudo update-grub
to activate the new settings. After the next reboot, vm console <guest>
should output the console content.
Following the sample template and Red Hat's official documentation, open /etc/default/grub
and update with the following content:
GRUB_CMDLINE_LINUX_DEFAULT=""
# Retain previous value (...) add add console config"
GRUB_CMDLINE_LINUX="... console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL_OUTPUT="serial console"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
Now run grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
to activate the new settings. After the next reboot, vm console <guest>
should output the console content.
Following the sample template and Red Hat's official documentation, perform the following commands as root:
kernelopts=$(grub2-editenv - list | grep kernelopts)
grub2-editenv - set "$kernelopts console=tty0 console=ttyS0,115200"
Note: If are desperate and cannot type in a pipe symbol (|
) through VNC, type Alt+124
. See here for reference.
After the next reboot, vm console <guest>
should output the console content.