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.

First step is to ensure your VM has a "serial" device, you can do this in the Hardware settings of the VM in the Web-Interface or with this command on the Proxmox Host:

qm set 107 -serial0 socket

In your VM you must enable the serial console. Login and edit the grub 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.

💡
Tip: when you start the VM and immediately connect you will be able to see most of the boot messages.

You can do it like this:

qm start 107 && qm terminal 107

Updated:

  • new a paragraph to add a serial port to VM