2

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=http://www.domain.com/c5u5.cfg"

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'>
  <name>server01</name>
  <uuid>5991cf85-db6c-2b87-b76d-07a0caae77b9</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel5.4.0'>hvm</type>
    <boot dev='cdrom'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>destroy</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' cache='none'/>
      <source file='/storage/vm/server01'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='file' device='cdrom'>
      <source file='/isos/c5u5.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <interface type='bridge'>
      <mac address='54:52:00:61:ea:78'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target port='0'/>
    </console>
  </devices>
</domain>

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

2 Answers 2

2

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 ).

2
0

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.

1
  • Yep its all running.
    – ard
    Dec 16, 2010 at 10:14

You must log in to answer this question.

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