[kwlug-disc] Networking on libvirt vs. VirtualBox

L.D. Paniak ldpaniak at fourpisolutions.com
Fri Aug 1 18:20:59 EDT 2014


I regularly install 12.04 and 14.04 Ubuntu vanilla isos in KVM using
virt-manager as a regular user.  The only subtlety is when bridging to
an external physical adapter which I solve using a manually defined
bridge (as root) like you described earlier.  It appears Network Manager
in 14.04 supports bridges so this may not be necessary.

What type of disk do you use for your VM in KVM?


On 08/01/2014 06:02 PM, Khalid Baheyeldin wrote:
> I was able to get a working VM up finally on KVM.
>
> Using more or less the tricks here
>
> http://mojodna.net/2014/05/14/kvm-libvirt-and-ubuntu-14-04.html
>
> In a nutshell, start with the Ubuntu Amazon EC2 images (not the
> regular server ISO image), then create and use an additional init ISO
> image so it would allow password login, then once you login you can
> add your ssh key.
>
> By adding a MAC address, you get your DHCP server to assign it a known
> IP address, and then you can ssh to that. No VNC required, no console!
>
> But, yet again, all this was not needed with VirtualBox ... sigh ...
>
>
> On Fri, Aug 1, 2014 at 5:05 PM, Khalid Baheyeldin <kb at 2bits.com
> <mailto:kb at 2bits.com>> wrote:
>
>     Another difference between libvirt and VirtualBox.
>
>     I was able to take the Ubuntu Server stock .iso file, and install
>     it inside of VirtualBox normally. That includes installing grub in
>     the virtual disk's MBR.
>
>     With libvirt, grub installation does not complete, with no errors.
>     The step proceeds, then returns to the tasks.
>
>     So, I am unable to have a working VM with KVM and libvirt so far
>     because of grub aborting.
>
>
>     On Fri, Aug 1, 2014 at 4:03 PM, Khalid Baheyeldin <kb at 2bits.com
>     <mailto:kb at 2bits.com>> wrote:
>
>         After defining br0 in the host's network, if I specify
>         bridge=br0, it works fine, but only with sudo, which is annoying.
>
>         VirtualBox did not need any host changes, and did not require
>         sudo.
>
>         Is there a way to do this on kvm/libvirt?
>
>
>         On Fri, Aug 1, 2014 at 3:03 PM, William Park
>         <opengeometry at yahoo.ca <mailto:opengeometry at yahoo.ca>> wrote:
>
>             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
>
>
>             _______________________________________________
>             kwlug-disc mailing list
>             kwlug-disc at kwlug.org <mailto:kwlug-disc at kwlug.org>
>             http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>
>
>
>
>         -- 
>         Khalid M. Baheyeldin
>         2bits.com <http://2bits.com>, Inc.
>         Fast Reliable Drupal
>         Drupal optimization, development, customization and consulting.
>         Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
>         Simplicity is the ultimate sophistication. --   Leonardo da Vinci
>         For every complex problem, there is an answer that is clear,
>         simple, and wrong." -- H.L. Mencken
>
>
>
>
>     -- 
>     Khalid M. Baheyeldin
>     2bits.com <http://2bits.com>, Inc.
>     Fast Reliable Drupal
>     Drupal optimization, development, customization and consulting.
>     Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
>     Simplicity is the ultimate sophistication. --   Leonardo da Vinci
>     For every complex problem, there is an answer that is clear,
>     simple, and wrong." -- H.L. Mencken
>
>
>
>
> -- 
> Khalid M. Baheyeldin
> 2bits.com <http://2bits.com>, Inc.
> Fast Reliable Drupal
> Drupal optimization, development, customization and consulting.
> Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
> Simplicity is the ultimate sophistication. --   Leonardo da Vinci
> For every complex problem, there is an answer that is clear, simple,
> and wrong." -- H.L. Mencken
>
>
> _______________________________________________
> kwlug-disc mailing list
> kwlug-disc at kwlug.org
> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20140801/5929ac2f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 538 bytes
Desc: OpenPGP digital signature
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20140801/5929ac2f/attachment.sig>


More information about the kwlug-disc mailing list