9

I'm running KVM on a Ubuntu 10.04 host. The guest OS is also Ubuntu 10.04 .

I am attempting to connect to the guest using the 'console' command. It appears I can establish a connection, but I get no output.

$ sudo virsh -c qemu:///system console guest1
Connected to domain guest1
Escape character is ^]
(NOTHING HERE)
^]
$

I don't have a 'serial' device configured, but I do have these 'console' devices.

<console type='pty' tty='/dev/pts/2'>
  <source path='/dev/pts/2'/>
  <target port='0'/>
</console>
<console type='pty' tty='/dev/pts/2'>
  <source path='/dev/pts/2'/>
  <target port='0'/>
</console>

Are these sufficient for a console, or do I need a serial device as well?

What do I need to do in order to get the KVM console to work?

4 Answers 4

7

I'm fairly sure you do need to configure the guest to use a serial console. You need three things for this to work:

  1. give the guest a virtual serial device of type pty (for example by adding one in the virt-manager vm info page)

  2. tell the kernel to use that for its output, by adding boot parameters like serial=tty0 console=ttyS0,115200n8 into GRUB_CMDLINE_LINUX in /etc/default/grub; then run sudo update-grub

  3. (optional) put a getty on ttyS0 so that you get a login prompt

See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=507650 for more.

1
1

One possibility is that your virtual machine does not have a serial console configured.

virsh dumpxml guest1

will show if there is a serial console configured or not. There should be something similar as

<serial type='pty'>
<target port='0'/>
</serial>
1
  • Thanks @txwikinger . I updated my question with some output from virsh dumpxml. I don't see a serial device, but I do see some console devices. Do you know if that is sufficient? Aug 9, 2010 at 18:00
1

Here it is very well explained:

Serial console for Ubuntu server 10.04 KVM guests

1

I just ran into this.

Here is what I have inthe XML config on the host (running KVM):

<serial type='pty'>
  <source path='/dev/pts/0'/>
  <target port='0'/>
</serial>
<console type='pty' tty='/dev/pts/0'>
  <source path='/dev/pts/0'/>
  <target port='0'/>
</console>

I also had to add the following in /etc/default/grub.conf in the VM (append to the "kernel" command):

kernel ..... serial=tty0 console=ttyS0,115200n8

Finally I secured the ttyS0 by adding "/etc/securetty" to enable root login from here

vi /etc/securetty
ttyS0

You might need to muck with your getty settings (as described by the other answer) as well

Hope this helps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .