Add Libvirt (KVM) box

Bug #1824780 reported by Christopher Peeters
96
This bug affects 19 people
Affects Status Importance Assigned to Milestone
cloud-images
New
Undecided
Unassigned

Bug Description

There should be Vagrant boxes using the libvirt (KVM) provider.

This question is related to https://bugs.launchpad.net/cloud-images/+bug/1732916

tags: added: id-5cf1377b993dae2fa7743a8c
Revision history for this message
Marcus Furlong (furlongm) wrote :

+1

An official libvirt provider box is needed. Currently many use the generic/ubuntu* boxes but these are somewhat opinionated and do not work as expected in all environments. This may reflect poorly on ubuntu, even though these are not official ubuntu images.

See the current list that people will see when searching for an ubuntu libvirt box:

https://app.vagrantup.com/boxes/search?order=desc&page=1&provider=libvirt&q=ubuntu

Revision history for this message
Tadej Janež (tjanez) wrote :
Download full text (4.7 KiB)

The experience is even worse if one tries to repackage a generic/ubuntu* libvirt box.

For example, the SSH host keys are deleted when calling 'vagrant package' which in turn calls virt-sysprep (http://libguestfs.org/virt-sysprep.1.html).
They are not automatically re-generated upon start-up (https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1778386) and the user is just presented with the following error:

# INFO ssh: SSH not up: #<Vagrant::Errors::SSHConnectionReset: SSH connection was reset! This usually happens when the machine is
# ...
# DEBUG ssh: == Net-SSH connection debug-level log END ==
# INFO ssh: SSH not up: #<Vagrant::Errors::SSHConnectionReset: SSH connection was reset! This usually happens when the machine is
# ...
# taking too long to reboot. First, try reloading your machine with
# ...
(https://github.com/vagrant-libvirt/vagrant-libvirt/issues/851#issue-288659725)

The other issue is that generic/ubuntu* images hard-code the machine's host name in https://github.com/lavabit/robox/blob/dc15ea0469a153e435f272d5e1b8f680a32cebed/scripts/ubuntu1804/network.sh#L35-L38.

This makes the libvirtd's dnsmasq-dhcp daemon ignore the DHCP requests when multiple Vagrant machine are started concurrently:

Aug 12 10:34:46 toronto dnsmasq-dhcp[8718]: DHCPDISCOVER(virbr1) 52:54:00:73:70:59
Aug 12 10:34:46 toronto dnsmasq-dhcp[8718]: DHCPOFFER(virbr1) 192.168.121.119 52:54:00:73:70:59
Aug 12 10:34:50 toronto dnsmasq-dhcp[8718]: DHCPDISCOVER(virbr1) 52:54:00:45:17:d7
Aug 12 10:34:50 toronto dnsmasq-dhcp[8718]: DHCPOFFER(virbr1) 192.168.121.106 52:54:00:45:17:d7
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPDISCOVER(virbr1) 52:54:00:5a:c7:a9
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPOFFER(virbr1) 192.168.121.121 52:54:00:5a:c7:a9
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPDISCOVER(virbr1) 52:54:00:45:17:d7
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPOFFER(virbr1) 192.168.121.106 52:54:00:45:17:d7
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPDISCOVER(virbr1) 52:54:00:73:70:59
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPOFFER(virbr1) 192.168.121.119 52:54:00:73:70:59
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPDISCOVER(virbr1) 52:54:00:5a:c7:a9
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPOFFER(virbr1) 192.168.121.121 52:54:00:5a:c7:a9
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPREQUEST(virbr1) 192.168.121.119 52:54:00:73:70:59
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: Ignoring domain localdomain for DHCP host name ubuntu1804
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPACK(virbr1) 192.168.121.119 52:54:00:73:70:59 ubuntu1804
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPDISCOVER(virbr1) 52:54:00:45:17:d7
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPOFFER(virbr1) 192.168.121.119 52:54:00:45:17:d7
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPDISCOVER(virbr1) 52:54:00:5a:c7:a9
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPOFFER(virbr1) 192.168.121.119 52:54:00:5a:c7:a9
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: DHCPREQUEST(virbr1) 192.168.121.119 52:54:00:73:70:59
Aug 12 10:34:53 toronto dnsmasq-dhcp[8718]: Ignoring domain localdomain for DHCP host name ubuntu1804
Aug 12 10:34:53 toronto dnsma...

Read more...

Revision history for this message
garyx (garyx) wrote :

+1

The projects I am using for testing are now using 3 year old images because there are not official libvirt images through Vagrant. This would be great to fix and add to the vagrant images.

tags: added: id-5d8e27c4fa55f4173989ba17
Revision history for this message
Andy Botting (andybotting) wrote :

Every other distro vendor provides libvirt images except Ubuntu. It makes our CI cry.

Revision history for this message
anarcat (anarcat) wrote :

that, and virtualbox is not in good shape out there. it seems like ubuntu is happy to ship the virtualbox versions from Debian unstable, but Debian itself doesn't ship it as part of its stable releases because of serious problems with upstream management of security issues:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794466

it would probably be preferable for the cloud-images team to favor software that is better supported by the linux kernel, the community and upstream itself. :)

Revision history for this message
Bryan Seitz (seitz-a) wrote :

Bump because the unofficial Focal image has more downloads than the official. Also Virtualbox is pretty buggy!

Revision history for this message
Gauthier Jolly (gjolly) wrote :

Thanks Bryan for bumping this bug. We need to decide whether we want to invest resources in this, it will take us a few days.
In any case, I believe we should have a documentation on how to build Ubuntu Vagrant boxes for any provider.

Revision history for this message
toby cabot (caboteria) wrote :

Holiday bump as it's been a year since any activity and KVM boxes would be a wonderful 2024 gift!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.