Bridged networking configuration with virt-manager 0.8.3 has become much simpler compared to earlier versions. The recent release of virt-manager 0.8.3 now adds GUI support for bridged networking, bonding and bridging vlans. In this post I’ll outline the procedure for bridged networking since this will be the most popular use of this new GUI feature. I’ll do a follow up post on bridging vlans which will be more popular within a data center environment. One additional note is that at the time of this writing, this new GUI functionality only supports Red Hat based network configuration files so only distributions such as Fedora and CentOS will be supported by this procedure.

Let me start by saying that when the current release of virt-manager was released a couple of weeks ago, I was looking forward to using the new “interface support”. Then I was disappointed to find the GUI kept reporting the message “Libvirt connection does not have interface support”. I researched the feature set, looked at the code and it seemed I had all the pre-requisites for this feature but this message was the only thing that showed up for me.
So right now I’m sitting in a hotel writing up this post on how I stumbled upon getting this feature to work. It happened like this.
Got to the hotel, booted up my laptop (which runs Fedora 12 now ), connected the hotel provided network cable from my laptop to the socket at side of table. As it turns out this socket was a dead one and I couldn’t understand why I wasn’t getting a connection. So I tried restarting my network service a few times and still nothing. Then I spotted another network wall socket at the back of the table and tried that and it worked. Next I started up virt-manager and configured a new virtual network to NAT my KVM windows guest to the Ethernet interface. I just happened to take a peek at the “Network Interfaces” tab under Edit->Host Details on my virt-manager main window and lo and behold my host interfaces were listed!! I played around with different sequences of starting up network services and virt-manager and only one sequence works for me which is:
You’ll now be able to see your host interfaces listed under Edit->Host Details->Network Interfaces. If you have a different experience with this feature please post a comment as I’m curious about this bug. This may not be the case for remote connections. So once you’ve got your physical host interface listed you will be able to configure bridged networking using the following procedure.
First thing you need to do is create a new bridge and attach your host interface(s) to it. Virt-manager calls your host interfaces “slave interfaces” which is an accurate term to describe what happens. If you have a single Ethernet interface on your host and add this to your new bridge, your host will not have access to your Ethernet interface anymore as it is now uses your new bridge like a gateway. You create a new bridge by clicking on the plus sign at the bottom of the “Network Interfaces” tab.

You’ll get a two step dialog as shown below with a drop down list of options for interface types to create. The first and default in the list is “bridge” which is what you want to create.

After selecting next, virt-manager will name the new bridge that will be created using the convention of brX where X starts at 0 and increments everytime you create a new bridge unless using hotplug mode. You can override this name if you want. You’ll also see a list of of interfaces to add to your new bridge.

If you think you’ll need to add more interfaces then choose hotplug as the start mode. You can also select activate now if you want your bridge to be enabled immediately however this will momentarily disrupt the network interfaces on your host as it goes through the initiation process. The default option of none for start mode and “activate now” option unchecked is so that you don’t unwillingly bring down your network. Click finish and you’re done. If you’ve configured bridged networking before using previous versions of virt-manager as described in this post, you’d have to agree that this is much more automated. Kudos to the virt-manager, libvirt and netcf developers for bringing network configurations this far along.
Your new bridge will not be started by default if you used the default options when creating your new bridge. To start up your new bridge, select it in the “Network Interfaces” tab and click the “play” button which is shown in the image below.

You’ll now notice that your bridge is not greyed out anymore. You’ll also notice that if you select any of your physical interfaces attached to your bridge, it will show the status of “In use by: br0”.
The final step in this procedure is assigning your physical interface to your guest. To do this, open up a guest console within virt-manager and click the “Add hardware” button. Next, Select Hardware type of Network and click “Forward”. Virt-manager will now show an option to use your host interface connected to the bridge you just created as shown below. Select this.

Click “Forward” then Finish and you’re all done. At this point you’ll be able to access your guest machine from your local network like any other host on your network. Give this procedure and try and see how it works for you if you’re running a Red Hat based distro. As always, feel free to post questions or comments.
Comments
Debian?
Wednesday, March 17, 2010 - 09:40 EvertIs there any way to get (part of) this functionality on a Debian 5 box? Perhaps with some symlinks and other config files added? 8-)
File configuration
Wednesday, March 17, 2010 - 12:10 Bruno Mairlot (not verified)I am wondering...are these modifications for bridges and vlan, reflected on the actual system configuration ?
I mean, does it create the files for example :
/etc/sysconfig/network-scripts/ifcfg-br0
Bruno
Re: File configuration
Wednesday, March 17, 2010 - 23:52 Haydn SolomonBruno,
That's correct, it will create files such as /etc/sysconfig/network-scripts-br0. Virt-manager uses technology such as netcf to do this. You can read more about this related project in the following post.
http://www.linux-kvm.com/content/netcf-silver-bullet-network-configuration
Re: Debian?
Thursday, March 18, 2010 - 16:00 Haydn SolomonEvert,
I'm not familiar with debian configuration files but I imagine they'd be quite different. If location was the only difference then symlinks should work but it' probably not that simple. Give it a try and see. I'll also have a look at it.
doesn't have interface support
Thursday, March 18, 2010 - 23:08 daevy (not verified)I have virt-manager(0.8.3) on gentoo, but I got next message in "Network Intefaces" tab: Libvirt connection does not have interface support.
What I need install to the system(can't find netcf in portages and google)))?
p.s. sorry my English, please.
Hi, For Gentoo, Netcf is not
Friday, March 19, 2010 - 04:02 Jacques Landru (not verified)Hi, For Gentoo, Netcf is not yet in portage, but it seems there's some work about it (see http://bugs.gentoo.org/show_bug.cgi?id=295993). Maybe it will be soon integrated. Jacques Landru
under gentoo
Tuesday, March 23, 2010 - 01:44 daevy (not verified)additionally need edit libvirt ebuild, find string --without-netcf change to --with-netcf
next make new digest for ebuild and re-emerge libvirt
[gentoo]
Wednesday, March 24, 2010 - 09:28 darkbasic (not verified)I edited libvirt ebuild replacing --without-netcf with --with-netcf and I added netcf from local overlay as a libvirt dependence, but I still have "Libvirt connection does not have interface support".
I rebuild libvirt, virtinst and virt-manager and restarted libvirtd.
Re: [gentoo]
Wednesday, March 24, 2010 - 10:19 Haydn Solomondarkbasic,
I think it takes more than just re-compiling with netcf support. netcf uses a *yet* another tool called augeas. This is the tool that can interpret file formats using something called "lenses". So far only Red Hat configuration file "lenses" have been programmed is my understanding. You can read more on this project at the following link.
http://augeas.net/
Thank you for the answer, I
Wednesday, March 24, 2010 - 12:25 darkbasic (not verified)Thank you for the answer, I found a solution:
emerge --unmerge virt-manager && emerge -v aqemu-9999
The ebuild is in the rion overlay. Add:
src_prepare() {
sed -i 's/${CMAKE_BINARY_DIR}/& ${CMAKE_SOURCE_DIR}/' CMakeLists.txt
}
or the compilation will fail.
:)
Thyanks
Friday, March 26, 2010 - 14:47 Peter L (not verified)Thanks guys this was very helpful
>> I cannot choose bridged
Monday, January 10, 2011 - 02:24 david bill (not verified)>> I cannot choose bridged networking when creating a VM with virt-manager
>> connecting to a remote box. If I use X forwarding to run virt-manager on the
>> vm machine, I can choose the bridged network devices.
> Remote bridge enumeration depends on libvirt interface support, which depends
> on netcf, which I don't think knows how to speak debian network configuration.
hello hydn
> Running 'virsh iface-list' should show your bridge on the remote host: if it
> doesn't, virt-manager won't offer it as an install option.
Hmmm, it's weird, indeed:
> case:~# virsh iface-list
> error: Failed to list active interfaces
> error: this function is not supported by the hypervisor:
> virConnectNumOfInterfaces
Yes, it does not work, but virt-manager running on the host lists the
bridged network interface- and choosing it works. But virt-manager
connecting to the hypervisor through ssh, does not.
Cheers,
70-448 dumps
from host, can ping guest but can't ssh to it "no route to host"
Monday, January 10, 2011 - 22:56 kvm-noob (not verified)I can ssh successfully:
- from the guest to the guest (proving sshd running)
- from the guest to the host
but not:
- from the host to the guest
When ssh'ing from host to guest, I receive this:
ssh: connect to host 10.0.0.7 port 22: No route to host
Oddly, I can ping from the host to the guest.
My setup looks like this one...
I've never posted questions online before. Besides here, where's a good forum to post this question?
Thanks.
>> My setup looks like this
Monday, January 10, 2011 - 23:00 kvm-noob (not verified)>> My setup looks like this one...
Ooops. I mean "like the setup described in this article". I.e., I created a network bridge "br0", added my host's "eth0" interface to it, and created a NIC for the guest that uses the bridge.
when loading WinXP into
Friday, January 21, 2011 - 02:14 Adler Shy (not verified)when loading WinXP into virt-manager it gets so far then asks for the Win SP1 disk & won’t go any further without it. Service Pack 1a is actually included on the installation disk & I have successfully installed using the same disk on Virtualbox without being asked for this – I updated to the various Service Packs as normal after the install completed. In fact, when performing a normal (non-virtualisation install) the installer does not ask for Service Pack disks.
networking
Tuesday, January 25, 2011 - 09:45 Darwin (not verified)I think it takes more than just re-compiling with netcf support. netcf uses a *yet* another tool called augeas. This is the tool that can interpret file formats using something called "lenses". So far only Red Hat configuration file "lenses" have been programmed is my understanding. You can read more on this project at the following link.
what a great blog!
Thursday, March 17, 2011 - 06:22 Light (not verified)I was lucky to find your www.linux-kvm.net site.
What a marvelous post! I am just starting out in community management/marketing media and trying to learn how to do it well - resources like this web site are so helpful. As our company is based in the United States, it's all a little bit new to us. The example above is something that I worry about as well, how to show your own actual enthusiasm and share the fact that your product is useful in that case.
I edited libvirt ebuild
Tuesday, May 17, 2011 - 08:39 Anonymous (not verified)I edited libvirt ebuild replacing --without-netcf with --with-netcf and I added netcf from local overlay as a libvirt dependence, but I still have "Libvirt connection does not have interface support".
I rebuild libvirt, virtinst and virt-manager and restarted libvirtd.
from host, can ping guest but can't ssh ... SOLVED
Tuesday, May 17, 2011 - 20:42 kvm-noob (not verified)SORRY to take so long to share this "solution".
As I recall, issuing "service network restart" on either the host or guests* fixed the problem. (* I no longer have the same setup. So, I can't confirm.)
familiar
Wednesday, February 15, 2012 - 14:11 zagam2 (not verified)I'm not familiar with debian configuration files but I imagine they'd be quite different. If location was the only difference then symlinks should work but it' probably not that simple. Give it a try and see. I'll also have a look at it....Thanks
Post new comment