Login to Proxmox VM without SSH

There may be a situation, when you can not login with SSH to your VM hosted on Proxmox. For example the VM may hang in the boot process because of a damaged filesystem, or requests a password for an encrypted volume.

As long as you can login to your Proxmox Host you can access the console of the VM via the Webinterface. But this maybe sometimes not so handy, because e.g. copy & paste is not working, what can be a real pain if you have a complicated password.

There is a second way to login using "serial console". But this requires some preparations on your VM, before you can use this feature.

In your VM you must enable the serial console first. Login and edit the bootloader configuration:

vi /etc/default/grub

and add or update these variables

GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200"
GRUB_CMDLINE_LINUX="console=tty0 console=ttyS0,115200"

GRUB_TERMINAL=serial

Then run update-grub to regenerate the live configuration.

You also need to ensure the systemd is running a getty on the port:

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

Then reboot the VM.

After this procedure you are able to access the VM on this serial console from your Proxmox Host:

qm terminal 107

You can the the ID from the Webinterface or by this command:

qm list

You will get a text based console to your VM and can enter the password to decrypt the volume. To disconnect press ` CTRL+O` like shown in the prompt.