Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.


  Search this Thread
Old 11-02-2010, 10:01 PM   #1
LQ Newbie
Registered: Aug 2010
Posts: 2

Rep: Reputation: 0
Set tap device in libvirt xml for virt-manager?


I'm using wireless on my kvm host so have set up a tap device. I can launch my guest using this command:

sudo kvm /path/to/guest.img -net nic,macaddr=DE:AD:BE:EF:90:26 -net tap,ifname=tap0,script=no

This gives me everything I need network-wise with full access to

How do I set these parameters in /etc/libvirt/qemu/guest.xml so it starts with these settings when using virt manager? I've tried:

<interface type='ethernet'>
  <target dev="tap0" />
And various incarnations without luck. It seems virt-manager complains mostly about "tap0 is not a bridge device".

Old 11-03-2010, 11:38 AM   #2
Registered: Feb 2010
Location: USA
Distribution: RHEL
Posts: 36

Rep: Reputation: 15
libvirt won't present a non-NAT or loopback interface unless it is bridged.

If you have the bridge-utils package installed, you would run:

brctl addbr br0
brctl addif br0 tap0
(br0 could be renamed if that name is undesirable of unavailable)

Once you run this, you will notice tap0 appears to be in a downed state, this is normal...all control over tap0 should be exercised over br0 instead. Now you can use br0 as the interface for your guest and libvirt shouldn't complain.

If you are using RHEL/CentOS/Fedora, this article is shows the steps to create/use bridges in the distros config files so you don't have to manually do it.

link: Creating an RHEL 5 KVM Networked Bridge Interface

Last edited by module0000; 11-03-2010 at 11:40 AM. Reason: appending
Old 11-04-2010, 03:20 AM   #3
LQ Newbie
Registered: Aug 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Hi. Thanks, this lets the guest (ubuntu) see the bridge/interface but I can't connect to the network.

Once you run this, you will notice tap0 appears to be in a downed state
It looked to me like tap0 was still up.

I'm way out of my depth but I get the feeling that any attempt at bridging on wireless won't work and if libvirt requires a bridge I'm outta luck. I'll just have to launch my guests via the command line.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Hacking libvirt/virsh/virt-manager/virt-install at Xen 4.0 Dom0 on top of Ubunt LXer Syndicated Linux News 0 05-06-2010 02:50 PM
LXer: Virt-install&Virt-manager at Xen 4.0-rc8 ( pvops) Dom0 on top Ubuntu K LXer Syndicated Linux News 0 03-26-2010 09:41 PM
No shared physical device networking in virt-manager in RHEL 5.4 digdoug Red Hat 3 09-29-2009 12:40 PM
Virt-manager in RHEL5.1 has empty Shared Physical Device list msennott Linux - Enterprise 2 04-07-2008 08:45 PM
"libvirt.libvirtError: virDomainCreateLinux() failed" when virt-install sailer_sh Red Hat 0 06-15-2007 02:29 AM > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration