[kwlug-disc] Networking on libvirt vs. VirtualBox
unsolicited
unsolicited at swiz.ca
Sat Aug 2 09:42:30 EDT 2014
This was with your amazon images, not Lori's native images?
Seems to me part of your issue / intent was to automate everything as
much as you could. Thus Lori's note of some manual root networking
(manual bridge) setup you were trying to avoid. But with your
reconfigure below, are you not back to the manual work you were trying
to avoid?
I noted with your link reference that they show how to add additional
packages at instantiation time to the machine, but it's not apparent to
me that you'd be able to put a reconfigure, not just a load, in there.
On 14-08-01 08:19 PM, Khalid Baheyeldin wrote:
> And once you do all that, things will work, but there will be a timeout
> while the VM attempts to contact Amazon EC2, and fails, so the VM will not
> be ready for you to login for several minutes.
>
> To avoid that, log into the VM, then do:
>
> $ sudo dpkg-reconfigure cloud-init
>
> Then unselect all the datasources except the NoCloud one, and then the VM
> will boot real fast ...
>
>
> On Fri, Aug 1, 2014 at 6:02 PM, Khalid Baheyeldin <kb at 2bits.com> 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> 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> 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>
>>>> 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
>>>>> http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Khalid M. Baheyeldin
>>>> 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, 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, 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
>
More information about the kwlug-disc
mailing list