This guide is a combination of two sources
https://www.thegeekdiary.com/centos-rhel-7-how-to-configure-serial-getty-with-systemd/
Add serial port to VM
qm set [VM ID] -serial0 socket
Shutdown completely the VM and start it again so the serial port is active.
Copy template settings for Serial Console to ttyS0 file
cp /usr/lib/systemd/system/[email protected] /etc/systemd/system/[email protected]
Update the new file like this
[Service]
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM <-- Change this parameter, add %I
Type=idle
Create a symlink and reload the console
ln -s /etc/systemd/system/[email protected] /etc/systemd/system/getty.target.wants/
systemctl daemon-reload
systemctl start [email protected]
systemctl enable [email protected]
Update GRUB
# in /etc/default/grub change the GRUB_CMDLINE_LINUX parameter so it contains both consoles like this
GRUB_CMDLINE_LINUX="quiet console=tty0 console=ttyS0,115200"
Apply changes and reboot
grub2-mkconfig -o "$(readlink -e /etc/grub2.conf)"
reboot
qm terminal [VM ID]
Hi just to confirm, the modification of : console=tty0 console=ttyS0,115200 , you do boot into the rocky vm and into the vm you add this to the grub of rocky9 ? And then, when we click in proxmox, at the vm console, we will see directly the console without having to log over ssh to the vm...
thanks for precision.