Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

up vote 5 down vote accepted

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.

share|improve this answer
1  
And to add a getty to ttyS0, I followed the instructions here: ubuntuforums.org/showpost.php?p=9610421&postcount=7 –  Stefan Lasiewski Aug 24 '10 at 21:32

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>
share|improve this answer
    
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? –  Stefan Lasiewski Aug 9 '10 at 18:00

Here it is very well explained:

Serial console for Ubuntu server 10.04 KVM guests

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.