Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used to use KVM for virtualisation and have now moved back to it, but I have a problem.

When i used to install the guest machine with virt-install i used to use the -x "extra args" part to set the console for the install and guest, but it no longer works.

Here is the command i use:

virt-install -n server01 -r 512 --os-variant=virtio26 -c /isos/c5u5.iso --nographics --noautoconsole -f /storage/vm/server01 -s 5 bus=virtio -w bridge:br0 -x "console=ttyS0 ks="

As you can see im setting the console to ttyS0, but then when i go to connect to the console with:

virsh console server01

it either wont connect or comes up with: error: Failed to get local hostname

Here is a dump of the xml, but no mention of ttyS0 either.

<domain type='qemu' id='5'>
    <type arch='x86_64' machine='rhel5.4.0'>hvm</type>
    <boot dev='cdrom'/>
  <clock offset='utc'/>
    <disk type='file' device='disk'>
      <driver name='qemu' cache='none'/>
      <source file='/storage/vm/server01'/>
      <target dev='hda' bus='ide'/>
    <disk type='file' device='cdrom'>
      <source file='/isos/c5u5.iso'/>
      <target dev='hdc' bus='ide'/>
    <interface type='bridge'>
      <mac address='54:52:00:61:ea:78'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target port='0'/>

Can anyone shed any light on this as im totally stuck.

share|improve this question

Check if the serial console is initialized inside the guest. Ubuntu seems to have removed this from their server distro ( by default ) so no ttyS0 comes up ever ( even if there is one ).

share|improve this answer – ax25 Dec 15 '10 at 20:53
Sorry, should have said im running CentOS 5.5, Ill look into this though. – ard Dec 16 '10 at 10:13

Is libvirtd is running. If it is not, virsh won't be able to connect either.

Check logs in /var/log/libvirt for other clues as well.

share|improve this answer
Yep its all running. – ard Dec 16 '10 at 10:14

Your Answer


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.