KVM Guests not booting

bootkvm-virtualization

I have installed KVM on Ubuntu Oneiric Server 64 AMD.

uname -a 
Linux myhostname 3.0.0-12-server #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

I tried creating a guest with the same OS. First I tried this:

vmbuilder kvm ubuntu \
--suite oneiric --flavour virtual --arch amd64 \ 
--libvirt qemu:///system \
--ip 192.168.0.100 \
--hostname myguest \
--part vmbuilder.partition \ 
--user adminUser --name fullname--pass defaultPass \
--addpkg apache2 --addpkg apache2-utils --addpkg tomcat6 --addpkg mysql-client \
--addpkg mysql-server --addpkg wwwconfig-common --addpkg dbconfig-common \
--addpkg apache2.2-common --addpkg unattended-upgrades --addpkg vim \ 
--addpkg openssh-server \ 
--mem 2048 \
--bridge br0

(for this i needed to configure the serial console separately btw)

Then this:

virt-install \ 
--connect qemu:///system -n myguest -r 2048 -f myguest.qcow2 \
-s 12 -c ubuntu-11.10-server-amd64.iso --vnc --noautoconsole --os-type linux \
--os-variant ubuntuOneiric --accelerate --network=network:default

In both cases the guest is generated successfully. Then I try to start the guest:

virsh start myguest
virst list --all

Id Name                 State
----------------------------------
4 myguest               running

Next I try to connect to the console:

virsh --connect qemu:///system console myguest
Connected to domain myguest
Escape character is ^]

Nothing happens after that. The behaviour is the same for both guests.
I also tried to connect remotely.

In some cases KVM then goes up to 100% CPU usage. Right now it is not using CPU.

When connecting remotely the console output was a bit more interesting:

Booting from Harddisk

And nothing else. Also I cannot call virsh shutdown myhost, I can only use the destroy command.

Can anyone point out any mistakes I have probably made?

dpkg --list | grep qemu

ii  qemu-common                      0.14.1+noroms-0ubuntu6.2             
ii  qemu-keymaps                     0.15.50-2011.08-0ubuntu4              
ii  qemu-kvm                         0.14.1+noroms-0ubuntu6.2               
ii  qemu-kvm-extras                  0.15.50-2011.08-0ubuntu4                
ii  qemu-system                      0.15.50-2011.08-0ubuntu4                
ii  qemu-user                        0.15.50-2011.08-0ubuntu4                
ii  python-vm-builder                0.12.4+bzr469-0ubuntu1        
ii  libvirt-bin                      0.9.2-4ubuntu15.2         
ii  libvirt0                         0.9.2-4ubuntu15.2                   
ii  python-libvirt                   0.9.2-4ubuntu15.2                                 
ii  virtinst                         0.600.0-1ubuntu1                        

The only log output I see in /var/log/libvirt/libvirt.log happens when I destroy the guest and tried to connect to the console before:

11:49:28.072: 1441: error : qemuMonitorIO:576 : internal error End of file from monitor

Best Answer

In order to connect to the serial console, you need the guest to support it first. This means the guest must have console=ttyS0 appended to the kernel start line in grub.conf. This also means the libvirt config for the VM should contain the following:

<serial type='pty'>
  <target port='0'/>
</serial>
<console type='pty'>
  <target type='serial' port='0'/>
</console>
Related Topic