[libvirt] Bridge network for VM using libvirt library

Shanmuga Rajan shan at binarykarma.com
Mon Oct 20 09:24:51 UTC 2008


              I trying to create an application to manage virtual
machines using libvirt library.
Currently i am focusing with KVM hypervisor and bridge networking.

I face two issues which i cant find a solution....

First issue:

When i tried to reboot a virtual machine (using virDomain's reboot fn).
I got exception message that there was no support in the hypervisor
for reboot. is it true that we cant reboot a KVM based VM?

Second issue:

When i tried to setup a bridge network for KVM based VM.

I got error message  like this ..

"QEMU quit during console startup
bind() failed"

I have listed below my steps which i tried setup bridge network.

On Dom0


brctl addbr br0
ifconfig eth0
brctl addif br0 eth0
ifconfig br0 netmask up
route add -net netmask br0
route add default gw br0

** dom0 IP

after that i checked the network connection of the Dom0.. it was fine.
ifconfig  was fine.

then i created tun/tap device like given in the following link

sudo tunctl -b -u john
sudo ifconfig tap1 up
sudo brctl addif br0 tap1
sudo iptables -I INPUT -i br0 -j ACCEPT

then i started to define vm like this...

<domain type="kvm">
<os><type arch="i686">hvm</type>
<boot dev="hd"/>
<clock sync="localtime"/>
<disk type="file" device="disk">
<source file="/dev/FluidVM_grp/Windows_NT_2003_121560222596"/>
<target dev="hda"/>

<interface type="bridge">
<source bridge="br0"/>

<interface type="bridge">
<source bridge="br0"/>
<target dev="tap1"/>
<mac address="00:16:3e:8f:ca:4b" />

<graphics type="vnc" port="5900" listen=""/>

is anything i am missing in setting up the bridge network?

Thanks and Regards,
-- Shan

More information about the libvir-list mailing list