<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.

  1. create a VM using virt-install or virt-manager In any case you will get serial console statements added to VM.xml file

  2. in guest VM run the following

    systemctl enable [email protected]
    systemctl start [email protected]
    
  3. in guest VM in /etc/default/grub replace

    GRUB_CMDLINE_LINUX_DEFAULT="quiet"
    #GRUB_TERMINAL=console
    

    by

    GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0"
    GRUB_TERMINAL="serial console"
    
  4. in guest VM run the following

    guest# update-grub
    
  5. 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