Skip to content

Instantly share code, notes, and snippets.

@andrewspiers
Last active August 29, 2015 14:05
Show Gist options
  • Save andrewspiers/7d87a1422765d7454da3 to your computer and use it in GitHub Desktop.
Save andrewspiers/7d87a1422765d7454da3 to your computer and use it in GitHub Desktop.
libvirt console

libvirt consoles

Getting a text console on linux guests

Check the xml of the guest has correct entries, something like this:

<serial type='pty'>
<target port='0'/>

</serial> <console type='pty'>

<target type='serial' port='0'/>

</console>

In the guest, edit /etc/default/grub to include the line:

GRUB_CMDLINE_LINUX="console=ttyS0"

I've also got:

GRUB_CMDLINE_LINUX_DEFAULT="text"

but that may not be strictly necessary.

These steps should permit you to see the boot messages from a console, (ie virsh console <domain>) but at least under debian you won't get a login prompt until you tell the system to provide one, by editing /etc/inittab and removing the comment on the line:

T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100

you can get init to reread this file once you've edited it by executing init q which should then spawn a prompt, if you already have a console session open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment