Enable KVM console access in Ubuntu

You have a ubuntu server running as a guest on a Ubuntu KVM server, well if you don’t then why not, it’s fun 😀 I do have one but when the system breaks and with all tech, it will eventually, it did for me the other night. For some reason the VPS’s file system became read only, and I didn’t notice until I was at work, without seeing anything on the screen for the actual server I couldn’t tell what was wrong. I had to wait until I got home before I could fix it. I could of easily fixed this if I had console access to the server, yes yes yes I know I should have enabled this when creating the server in the first place, well I didn’t so there. It’s easy enough to setup, here’s how you do it. PS I’m using Ubuntu 14.04 LTS

1, Edit /etc/default/grub
2, Change GRUB_CMDLINE_LINUX_DEFAULT=”” to be
GRUB_CMDLINE_LINUX_DEFAULT=”console=ttyS0,38400n8 console=tty0″
3, update grub using the command update-grub
4, cp /etc/init/tty1.conf /etc/init/ttyS0.conf
5, edit /etc/init/ttyS0.conf
6, make sure the last line reads as
“exec /sbin/getty -8 38400 ttyS0″
7, reboot the vm

You should now be able to console to the server from your kvm host with the command

virsh console xxxxxxxxx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s