Enable serial console for img build in grub?

Hi,

I think it is handy to enable serial console in grub for the .img build, so when user just want to try out the img, they could have serial console to the img instance by virsh console . I noticed also when ipfire img instance startup, it automatically runs setup script for initial setup including networking, this would be easier for user to try out ipfire quickly, what do you think?

now I workaround this by converting the img to qcow2
qemu-img convert -O qcow2 ipfire2.img /tmp/ipfire2.qcow2

then virt-edit /tmp/ipfire2.qcow2 /etc/default/grub with addition of following:

GRUB_CMDLINE_LINUX="rd.auto panic=10 console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop==1"

also virt-edit /tmp/ipfire2.qcow2 /boot/grub/grub.cfg with:

linux   /vmlinuz-6.6.15-ipfire root=UUID=06d532fa-33fb-4365-8b8d-40313b216ba7 ro rd.auto panic=10 console=tty0 console=ttyS0,115200n8
2 Likes

@vincentmli
are there any drawbacks that prevent a successful
boot when having both: console=tty0 AND console=ttyS0,115200n8
enabled at the same time :question:

sorry I don’t know enough about having both console=tty0 AND console=ttyS0,115200n8

1 Like

Only the second parameter is fully used so the fist tty is not working. (It display the kernemessages but not repond to keyboard.)

The flashimage allow switching between tty and ttyS0 at first boot since a while and for the ISO in uEFI mode we have added this selection in core191.

1 Like

@vincentmli
roger that :white_check_mark:
@arne_f
linux console seems to be kind of adventurous :person_shrugging:

more console :partying_face: here:
β€˜_tty0 AND ttyS0 at the same time’