[libvirt] libvirt equivalent config for a kvm command line

Hi, I had been running kvm in a previous version of Ubuntu with the following command line: /usr/bin/kvm -hda /mnt/kvm/vm-images-work/nanobsd.img -net nic,vlan=26,macaddr=52:54:00:12:34:26 -net tap,vlan=26,ifname=tap26 -net nic,vlan=27,macaddr=52:54:00:12:34:27 -net tap,vlan=27,ifname=tap27 -net nic,vlan=28,macaddr=52:54:00:12:34:28 -net tap,vlan=28,ifname=tap28 -m 640 -vnc :26 -usbdevice tablet The vm shows couple if lines in console and then redirects rest of the output to serial console. I can see that in ctrl-alt-3 of vncviewer ctrl-alt-2 gives access to emulation console and 4 gives access to parallel console. After upgrading to latest Intrepid Ibex I decided to move to using virsh to manage my vms. For the above vm I am using the following xml file. <domain type='kvm'> <name>nanobsd</name> <memory>262144</memory> <currentMemory>262144</currentMemory> <vcpu>1</vcpu> <os> <type>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> </features> <clock offset='localtime'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <source file='/mnt/kvm/vm-images-work/nanotest.img'/> <target dev='hda' bus='ide'/> </disk> <interface type='bridge'> <mac address='52:54:00:12:34:31'/> <source bridge='br0'/> </interface> <interface type='bridge'> <mac address='52:54:00:12:34:32'/> <source bridge='br0'/> </interface> <interface type='bridge'> <mac address='52:54:00:12:34:33'/> <source bridge='br0'/> </interface> <serial type='vc'> <target port='2'/> </serial> <console type='pty'> <target port='0'/> </console> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='5931' listen='192.168.3.3'/> </devices> </domain> Which produces the following command line. /usr/bin/kvm -S -M pc -m 256 -smp 1 -name nanobsd -monitor pty -localtime -boot c -drive file=/mnt/kvm/vm-images-work/nanotest.img,if=ide,index=0,boot=on -net nic,macaddr=52:54:00:12:34:31,vlan=0 -net tap,fd=28,script=,vlan=0,ifname=vnet5 -net nic,macaddr=52:54:00:12:34:32,vlan=1 -net tap,fd=29,script=,vlan=1,ifname=vnet6 -net nic,macaddr=52:54:00:12:34:33,vlan=2 -net tap,fd=30,script=,vlan=2,ifname=vnet7 -serial vc -parallel none -usb -vnc 192.168.3.3:31 Problem with this configuration is that the screen freezes after couple of minuets of booting, I am not sure if this is the problem with the serial console or actual execution. I can see the serial console in ctrl-alt-2, but the window size changes. The image works perfectly in normal PC as well as if I use the previous command line. I guess I am missing some thing here, but I would be very happy if I can get the old behaviour back :) raj

Rajkumar S wrote:
Hi,
I had been running kvm in a previous version of Ubuntu with the following command line:
/usr/bin/kvm -hda /mnt/kvm/vm-images-work/nanobsd.img -net nic,vlan=26,macaddr=52:54:00:12:34:26 -net tap,vlan=26,ifname=tap26 -net nic,vlan=27,macaddr=52:54:00:12:34:27 -net tap,vlan=27,ifname=tap27 -net nic,vlan=28,macaddr=52:54:00:12:34:28 -net tap,vlan=28,ifname=tap28 -m 640 -vnc :26 -usbdevice tablet
<snip>
Which produces the following command line.
/usr/bin/kvm -S -M pc -m 256 -smp 1 -name nanobsd -monitor pty -localtime -boot c -drive file=/mnt/kvm/vm-images-work/nanotest.img,if=ide,index=0,boot=on -net nic,macaddr=52:54:00:12:34:31,vlan=0 -net tap,fd=28,script=,vlan=0,ifname=vnet5 -net nic,macaddr=52:54:00:12:34:32,vlan=1 -net tap,fd=29,script=,vlan=1,ifname=vnet6 -net nic,macaddr=52:54:00:12:34:33,vlan=2 -net tap,fd=30,script=,vlan=2,ifname=vnet7 -serial vc -parallel none -usb -vnc 192.168.3.3:31
Problem with this configuration is that the screen freezes after couple of minuets of booting, I am not sure if this is the problem with the serial console or actual execution. I can see the serial console in ctrl-alt-2, but the window size changes. The image works perfectly in normal PC as well as if I use the previous command line. I guess I am missing some thing here, but I would be very happy if I can get the old behaviour back :)
Could be memory related: previous config had 640 Mb, new config only has 256. If that isn't the issue, I'd say just boot the new kvm command directly, and remove pieces to see if there is a blatant culprit: ex. revert the -drive line to use -hda, try with 0/1/2 nics, etc. - Cole

On Thu, Nov 20, 2008 at 09:27:58AM -0500, Cole Robinson wrote:
Rajkumar S wrote:
Hi,
I had been running kvm in a previous version of Ubuntu with the following command line:
/usr/bin/kvm -hda /mnt/kvm/vm-images-work/nanobsd.img -net nic,vlan=26,macaddr=52:54:00:12:34:26 -net tap,vlan=26,ifname=tap26 -net nic,vlan=27,macaddr=52:54:00:12:34:27 -net tap,vlan=27,ifname=tap27 -net nic,vlan=28,macaddr=52:54:00:12:34:28 -net tap,vlan=28,ifname=tap28 -m 640 -vnc :26 -usbdevice tablet
<snip>
Which produces the following command line.
/usr/bin/kvm -S -M pc -m 256 -smp 1 -name nanobsd -monitor pty -localtime -boot c -drive file=/mnt/kvm/vm-images-work/nanotest.img,if=ide,index=0,boot=on -net nic,macaddr=52:54:00:12:34:31,vlan=0 -net tap,fd=28,script=,vlan=0,ifname=vnet5 -net nic,macaddr=52:54:00:12:34:32,vlan=1 -net tap,fd=29,script=,vlan=1,ifname=vnet6 -net nic,macaddr=52:54:00:12:34:33,vlan=2 -net tap,fd=30,script=,vlan=2,ifname=vnet7 -serial vc -parallel none -usb -vnc 192.168.3.3:31
Problem with this configuration is that the screen freezes after couple of minuets of booting, I am not sure if this is the problem with the serial console or actual execution. I can see the serial console in ctrl-alt-2, but the window size changes. The image works perfectly in normal PC as well as if I use the previous command line. I guess I am missing some thing here, but I would be very happy if I can get the old behaviour back :)
Could be memory related: previous config had 640 Mb, new config only has 256.
Yes, that'd be my first thought too.
If that isn't the issue, I'd say just boot the new kvm command directly, and remove pieces to see if there is a blatant culprit: ex. revert the -drive line to use -hda, try with 0/1/2 nics, etc.
My 2nd bet would be the serial port - worth removing that from the config because I know there's been QEMU bugs with serial ports before. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Thu, Nov 20, 2008 at 8:01 PM, Daniel P. Berrange <berrange@redhat.com> wrote:
My 2nd bet would be the serial port - worth removing that from the config because I know there's been QEMU bugs with serial ports before.
Serial could be the issue, I have other vms (normal linux and freebsd) running in the same box with out any problems. This image has console in serial. So having serial support is essential. It might be possible that the machine is running perfectly but the serial console is frozen. i had gone through the xml documentation but could not understand the serial configuration. If some one has an xml fragment for the serial behavour of my original kvm command line (0 - monitor, 1 - interactive shell of kvm, 2 - serial0, 3 paralell0) that would be great. raj

On Thu, Nov 20, 2008 at 7:57 PM, Cole Robinson <crobinso@redhat.com> wrote:
If that isn't the issue, I'd say just boot the new kvm command directly, and remove pieces to see if there is a blatant culprit: ex. revert the -drive line to use -hda, try with 0/1/2 nics, etc.
I will try this, thanks :) raj
participants (3)
-
Cole Robinson
-
Daniel P. Berrange
-
Rajkumar S