
Libvirt Xml Serial Console
The -extra-args line is necessary for accessing the network booted VM over a Libvirt compatible serial connection. Once virt-install generates the necessary Libvirt compatible XML the VM will begin booting and you will be automatically connected to the serial console. Serial access is provided between subsequent boots from this point onwards.
Instance-003dca-6241-4c0c-b2d5-7c7b198fe697cirros22016-10-07 481004adminadmin71524hvm/var/lib/nova/instances/82853dca-6241-4c0c-b2d5-7c7b198fe697/kernel/var/lib/nova/instances/82853dca-6241-4c0c-b2d5-7c7b198fe697/ramdiskroot=/dev/vda1 rw rootwait console=tty0 console=ttyS0 console=ttyAMA0destroyrestartdestroy/usr/bin/kvmlibvirt-82853dca-6241-4c0c-b2d5-7c7b198fe697libvirt-82853dca-6241-4c0c-b2d5-7c7b198fe697.

Just managed to get it to work:Suppose your virtual domain is myGuest, your preferred editor is vi, and your guest is installed with grub2and uses systemd. If the last assumption is not true, you might have a look at.First, install libguestfs-toolson the host: sudo apt install libguestfs-tools. You will need this when working with headless guests.Second, shut down your guest: virsh shutdown myGuest.Next, mount the virtual disk: guestmount -g myGuest -i /mnt (or use any other existing directory as mountpoint). Now in /mnt you should be able to see the filesystem of the guest.With grub2and systemd, you only have to modify the grub configuration: vi /mnt/etc/default/grub, and modify like GRUBCMDLINELINUX='console=tty0 console=ttyS0,19200n8'GRUBTERMINAL=serialGRUBSERIALCOMMAND='serial -speed=19200 -unit=0 -word=8 -parity=no -stop=1'As you will have to run update-grubon the guest, for the first start you have to also modify /mnt/boot/grub/grub.cfg. Find the default boot menu item and append the console information to the linuxentry to look similar to linux /boot/vmlinuz-4.4.0-75-generic root=UUID=76f3e237-d791-4e9d-8ad7-fe5c9165ae55 ro console=ttyS0,19200 earlyprint=serial,ttyS0,19200Maybe you need root privileges to mount and edit the files.Now restart the guest and start the virtual console: virsh start myGuest && virsh console myGuestYou should see the kernel log and then a login prompt.After logging in, don't forget to run sudo update-grub.