Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
Last active January 4, 2024 10:40
Show Gist options
  • Save EmmanuelKasper/f24cc7088b206ea0ec87 to your computer and use it in GitHub Desktop.
Save EmmanuelKasper/f24cc7088b206ea0ec87 to your computer and use it in GitHub Desktop.
Proxmox Text Terminal Howto

Map a virtual serial port on the guest(ttyS0) to a pseudo terminal(pty) on the host This has to be added to /etc/pve/qemu-server/VMID.conf:

args: -device isa-serial,chardev=myChardevice,id=s -chardev pty,id=myChardevice

After starting the VM check you will see a message:

char device redirected to /dev/pts/7 (label myChardevice)

Inside the guest, you should see now the serial port:

dmesg | grep ttyS
[0.560758] 00:04: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

Inside the guest, you can now instruct systemd to start a login process on the serial port:

systemctl start serial-getty@ttyS0.service
systemctl enable serial-getty@ttyS0.service

From the host you can now start a text terminal to login to the above:

picocom /dev/pts/7

If you don't know where to find the pts terminal, you can also use the qemu monitor to find this:

qm monitor 100
Entering Qemu Monitor for VM 100 - type 'help' for help
qm> info chardev
myChardevice: filename=pty:/dev/pts/7

If you want to get a copy of the boot messages on the text terminal, you can use:

GRUB_CMDLINE_LINUX_DEFAULT="quiet console=tty0 console=ttyS0,38400n8" 

in /etc/default/grub

@Blub
Copy link

Blub commented May 5, 2015

I just noticed instead of a custom args: ... line you can also use serial0: socket, and then use qm terminal $VMID, still have to enable the serial-getty@ttyS0 service (and/or grub commandline)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment