KVM Virsh Console Access for Debian and FreeBSD VMs

Submitted by Jeff on Mon, 18/06/2018 - 14:11

To provide the VMs with console access via terminal on the hypervisor:

Debian

Within the VM:

$ cp -a /lib/systemd/system/serial-getty@.service /etc/systemd/system/
$ systemctl enable serial-getty@ttyS0.service
$ systemctl start serial-getty@ttyS0.service
Access the console by typing:

Then you can simply access the VM from an SSH terminal on the host/hypervisor:

$ virsh console 'VM'

 

FreeBSD

$ nano /boot/loader.conf

And add

console="comconsole"

Edit the line which contains ttyu0 in /etc/ttys to the following:

$ nano /etc/ttys 
ttyu0   "/usr/libexec/getty std.9600"   vt100   on  secure

https://forum.ivorde.com/freebsd-virsh-console-hangs-in-escape-characte…

Category