[kwlug-disc] Networking on libvirt vs. VirtualBox

William Park opengeometry at yahoo.ca
Fri Aug 1 15:03:00 EDT 2014


On Fri, Aug 01, 2014 at 12:27:21PM -0400, Khalid Baheyeldin wrote:
> On VirtualBox, I was able as non-root to get bridged networking by doing:
> 
> vboxmanage createvm --name p1 --ostype Ubuntu_64 --register
> vboxmanage modifyvm p1  ... --nic1 bridged --bridgeadapter1 eth0 --nictype1
> 82543GC
> 
> And that provided me functional two-way networking, assigning a new IP
> address from the router, and allows incoming and outgoing networking
> transparently.
> 
> On KVM, I did:
> 
> virt-install --name p1 --ram 512 --disk path=~/p.img,size=2 --cdrom
> ./media/precise64/ubuntu-12.04.4-server-amd64.iso --boot cdrom --network
> bridge=eth0
> 
> That would not work because it requires root (VirtualBox worked without
> sudo).
> 
> So, I need to use sudo before that command. But when I do this, I get the
> error:
> 
> ERROR    Unable to add bridge eth0 port vnet0: Operation not supported
> 
> Googling for that error suggests that this command should fix it:
> 
> virsh iface-bridge eth0 br0
> 
> But it does not work, with or without sudo, with the following error:
> 
> error: failed to get interface 'eth0'
> error: this function is not supported by the connection driver:
> virInterfaceLookupByName
> 
> So, the question is, using libvirt and kvm, how does one get bridged
> networking to work?

>From memory, QEMU simply adds its tap interface to existing bridge.  I
had to setup bridge and add wlan0 (my wireless connection) to it.  Then,
the virtual machine got its IP from the wireless router.
-- 
William





More information about the kwlug-disc mailing list