Configuration on the host
Add a virtual serial port to the VM:
qm set -serial0 socket
or
echo “serial0: socket” >> /etc/pve/qemu-server/.conf
Configuration on the guest
Enable and start serial console on the guest VM:
systemctl enable serial-getty@ttyS0.service
systemctl start serial-getty@ttyS0.service
Instruct grub2 to send the boot messages on the serial port by editing /etc/default/grub and adding:
GRUB_CMDLINE_LINUX=”quiet console=tty0 console=ttyS0,115200″
For the change to take effect, run: update-grub
Connecting to the Serial Terminal
qm terminal <VMID>
and press enter a second time to get the prompt.
NOTE: if it seems this is not working, and if you have defined ttyS1, you can connect to it with the command:
qm terminal -iface serial1