virsh: VM console does not show any output
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
This is what I normally add to the VMs definition, using virsh edit
Then console=ttyS0
appended in the VM's kernel line in grub.conf
Never failed me so far
Working example of using Debian jessie as host and guest operating system.
create a VM using virt-install or virt-manager In any case you will get serial console statements added to VM.xml file
-
in guest VM run the following
systemctl enable [email protected] systemctl start [email protected]
-
in guest VM in
/etc/default/grub
replaceGRUB_CMDLINE_LINUX_DEFAULT="quiet" #GRUB_TERMINAL=console
by
GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0" GRUB_TERMINAL="serial console"
-
in guest VM run the following
guest# update-grub
-
the VM console for running VM can be get by
host# virsh console VM
or start the VM with console attached
host# virsh start VM --console
Sources:
- 0pointer.de systemd for Administrators, Part XVI
- keypressure.com Testing libvirt over TLS