Usually, my first step after setting up a new Ubuntu guest is to enable console access in order gain shell access on the newly created VM.
Step 1 – Activate the serial console in the guest
Change the GRUB_CMDLINE_LINUX_DEFAULT to:
Don’t forget to update Grub
Step 2 – Create the serial console in the guest
cp /etc/init/tty1.conf /etc/init/ttyS0.conf nano /etc/init/ttyS0.conf
Edit ttyS0.conf and replace the tty1 with ttyS0 in the last line so it will read something like “exec /sbin/getty -8 38400 ttyS0”.
Reboot the VM.
Step 3 – Log in from the host
virsh console myvm
This is it! You just gained console access to your VM.
Tip: To exit the console, hit CTRL-]. It doesn’t matter where the ] is located on your keyboard, you have to press the key below the <BACKSPACE> key and on the left side of the <ENTER> key.