virt-manager and bridge problem

linux-jxf2:/home/haha # /etc/xen/scripts/network-bridge status  

 ============================================================ 
 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000  

     link/ether 20:6a:8a:7e:62:81 brd ff:ff:ff:ff:ff:ff  

     inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0  

 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000  
     link/ether 20:6a:8a:7e:62:81 brd ff:ff:ff:ff:ff:ff  
     inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0  
   
 bridge name    bridge id        STP enabled    interfaces  
 eth0        can't get info Operation not supported  
   
 default via 192.168.1.1 dev eth0  
 169.254.0.0/16 dev eth0  scope link  
 192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.4  
 192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.6  
   
 Kernel IP routing table  
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  
 0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0  
 169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0  
 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0  
 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1  
 ============================================================ 
 linux-jxf2:/home/haha # /etc/xen/scripts/network-bridge start  
     eth0      device: Broadcom Corporation NetLink BCM57785 Gigabit Ethernet PCIe (rev 10)  
 /etc/xen/scripts/xen-network-common.sh: line 90: : -ne: unary operator expected  
 Waiting for peth0 to negotiate link...........(link isnt in running state)  
     eth0      name: Broadcom Ethernet controller  
     eth0      Warning: Bridge eth0 already exists!  
     eth0      Ports: <peth0>  
     eth0      forwarddelay (see man ifcfg-bridge)  not ready. Proceeding in background.  
 Starting DHCP4 client on eth0. . . . . . . .   
     eth0      DHCP4 continues in background  
 linux-jxf2:/home/haha # /etc/xen/scripts/network-bridge status  
 ============================================================ 
 3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DORMANT qlen 1000  
     link/ether c0:18:85:08:95:99 brd ff:ff:ff:ff:ff:ff  
     inet 192.168.1.6/24 brd 192.168.1.255 scope global eth1  
 3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state DORMANT qlen 1000  
     link/ether c0:18:85:08:95:99 brd ff:ff:ff:ff:ff:ff  
     inet 192.168.1.6/24 brd 192.168.1.255 scope global eth1  
   
 bridge name    bridge id        STP enabled    interfaces  
 eth1        can't get info Invalid argument  
    
 default via 192.168.1.1 dev eth1  
 169.254.0.0/16 dev eth0  scope link  
 192.168.1.0/24 dev eth1  proto kernel  scope link  src 192.168.1.6  
 192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.4  
   
 Kernel IP routing table  
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  
 0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1  
 169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0  
 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1  
 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0  
 ============================================================ 

Virt-manager shows error

linux-jxf2:/home/haha # virt-manager  

 

 (virt-manager:10066): GConf-WARNING **: Client failed to connect to the D-BUS daemon:  
 Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.  
 

 So every time I need to start Virtual Machine Manager in Yast, and before that I need to execute /etc/xen/scripts/network-bridge. Or it would be wrong as follows.
 

 Error starting domain: POST operation failed: xend_post: error from xen daemon: (xend.err 'Device 0 (vif) could not be connected. Hotplug scripts not working.') 
  
 Traceback (most recent call last): 
   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper 
     callback(asyncjob, *args, **kwargs) 
   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 117, in tmpcb 
     callback(*args, **kwargs) 
   File "/usr/share/virt-manager/virtManager/domain.py", line 1098, in startup 
     self._backend.create() 
   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 554, in create 
     if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self) 
 libvirtError: POST operation failed: xend_post: error from xen daemon: (xend.err 'Device 0 (vif) could not be connected. Hotplug scripts not working.') 

And one more question, how did xen choose the interface to be used as bridge ? It’s confusing since network-bridge choose different in sometimes. For example, if I use the wireless card eth1 to surf the Internet in dom0, the network-bridge command will use eth1 as the bridge while I use the wired card eth0 to connect the Internet, it will choose the eth0. So it’s it the mechanism of xen to choose the connected interface as the bridge automatically?

Besides, if I want to run network-bridge command correctly, I need to stop NetworkManager. I don’t know why since I need NetworkManager to get my wifi connected. It’s very controversal.

If I were to guess, you haven’t set up your bridge yet. Any bridges creating using vir-manager would be named “virbr” with some number appended, eg virbr0. If you had setup a bridge using “classic networking” using YAST, you’d see a bridge “br” with some number appended.

Also, there <may> be a problem connecting virt manager to your local machine. Try starting virt manager manually (first) to see if there really is a problem or simply a temporary issue.

You can also list active and availble bridges with either the “ip addr” or “brctl” commands.

So assuming you are using virt manager, open it (connecting to local machine)

  1. Highlight some machine (any will do just to manage virtual networking in general)
  2. Edit >Connection Details
  3. Click on Virtual Networks tab
  4. A Default network should be configured. If you want to use this, select (click) default and view the details to the right. Make sure “Autostart: On Boot” is checked. If it has to be checked, click the button at the bottom of list to start the network. Also note the Device Name so you can run the above commands again to list bridge devices and verify active and available.
    4a. If the Default virtual network isn’t configured properly, Click the “+” button to add a new network. And, of course make sure it’s configured to start on boot unless you want to manually start.

You can have any number of virtual networks enabled and active at the same time.

You’re exactly right, it seems that the default setup typically sets up on eth0 but that is generally to be expected since that is the only likely interface common to all systems.

You should create virtual networks as I described that bind to your wireless interface instead. And, a word of caution… only connect one interface to your physical network at a time, <never> connect both wireless and wired simultaneously unless you perform some sort of advanced interface configuration like bonding.

So, for instance on my laptop I rarely use the default network.
Instead, I have virtual networks set up on my wireless interface, one with NAT and another for “Host Only” networking.

HTH,
TSU

After some additional thought,
You might also have been able to piece together what I posted above to get a clearer idea what your situation is…

Your “network bridge” command fails because eth0 isn’t likely connected to anything, or your OS isn’t actively routing through it because you’re using wireless. This likely would be the case whether a hard wire is plugged in or not because I assume your wireless and wired networks are using the same network address space (rememver my warning not to try to connect with both wired and wireless simultaneously? This is a consequence).

Do what I describe which is to create new networks bound to your wireless adapter and everything will work fine.
And, of course remember to configure your Guest VMs to use the correct bridge (which won’t be default)

TSU

If I were to guess, you haven’t set up your bridge yet. Any bridges creating using vir-manager would be named “virbr” with some number appended, eg virbr0. If you had setup a bridge using “classic networking” using YAST, you’d see a bridge “br” with some number appended.

Yes, I didn’t set any bridge. I thought the virt-manager would automatically do that. Could you tell me the detailed procedures to set a bridge?

Also, there <may> be a problem connecting virt manager to your local machine. Try starting virt manager manually (first) to see if there really is a problem or simply a temporary issue.

You can also list active and availble bridges with either the “ip addr” or “brctl” commands.

After reboot, I execute the virt-manager at the very first place. However the error stays the same. And ip addr shows:

linux-jxf2:/home/haha # ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
    link/ether 20:6a:8a:7e:62:81 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether c0:18:85:08:95:99 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.7/24 brd 192.168.1.255 scope global eth1

So assuming you are using virt manager, open it (connecting to local machine)

  1. Highlight some machine (any will do just to manage virtual networking in general)
  2. Edit >Connection Details
  3. Click on Virtual Networks tab
  4. A Default network should be configured. If you want to use this, select (click) default and view the details to the right. Make sure “Autostart: On Boot” is checked. If it has to be checked, click the button at the bottom of list to start the network. Also note the Device Name so you can run the above commands again to list bridge devices and verify active and available.
    4a. If the Default virtual network isn’t configured properly, Click the “+” button to add a new network. And, of course make sure it’s configured to start on boot unless you want to manually start.

You can have any number of virtual networks enabled and active at the same time.

How to connect to local machine use virt-manager? I can only connect dom0 with GUI virt-manager in yast.

So you mean I cannot create a bridge if the wired and wireless connections are both down? Even if I didn’t need to communicate with other machines? I just want to establish a virtual inner network with eth0 as the bridge and keep dom0 online with wireless card (eth1).

Connecting to Dom0 on the Local Machine is the same as connecting generally to Local Machine. It is the most basic Dom and virt manager has to connect to it before it can do anything else.

You configure the virtual bridge used (virtual network) by inspecting and if necessary modifying the Network Device properties of the individual Guest VM. Typically, a newly installed Guest will be configued to use the first available listed bridge (typically br0 or virbr0), so you may wish to configure a different bridge device.

Your “ip addr” is not listing any Linux bridge device so either it hasn’t been created successfully or is configured to start on boot. If it’s visible in virt manager as I described, start and enable it to start on boot. If it’s not listed, then a new virtual network (with its bridge device) needs to be created.

TSU

A functional Linux bridge device needs an active, working physical interface.

If you’re using Network Manager, this is simple to address.
Within Network Manager, open the properties of your existing wired connection(which of course uses eth0).
Ordinarily, all Network Manager connections are configured by default to connect on logon which allows the system boot to have already detected which physical network interfaces are active and then manage only those.
You can over-ride this behavior by setting your wired connection property to connect “on boot” which will make the physical interface available regardless whether it’s connected to an active physical interface or not.

After that, any virtual networks bound to eth0 will work regardless whether there is an actual physical connection or not.

TSU

Thanks for your help, I solved the problem of bridge, however why can’t the dom0 connect to Internet while other VMs can after the br0 working? It’s it because the bridge take over the eth0? I’m now using the wireless card eth1 to surf online for dom0, but I don’t think it a good solution since many computers have only one network card.

I don’t know the reason why direct access to the physical interface is disabled, but it’s described often in documention and likely is just how the tun/tap functionality works. You’ll find this the default behavior of anything that uses this functionality including tunnelling, but in that case there is a clear security reason for that behavior.

TSU