Its-Alex / backlog

Personal backlog
0 stars 0 forks source link

Try vagrant-libvirt once more #4

Closed Its-Alex closed 2 months ago

Its-Alex commented 11 months ago

I've tried vagrant-libvirt a few times and find it hard to make it works. Documentation seems to be more complete than before, since virtualbox doesn't work very well on new macbook (MX) I would like to try vagrant-libvirt again

Its-Alex commented 10 months ago

I succeed to make it works, following https://wiki.archlinux.org/title/libvirt using vagrant-libvirt docker installation

You can view it in https://github.com/Its-Alex/vagrant-libvirt-archlinux. It's pretty fast!

Its-Alex commented 10 months ago

I will try to make boot on CDROM and GPU passthrough work

Its-Alex commented 10 months ago

Drawback of using vagrant-libvirt is that it's reduced to libvirt provider boxes only

Its-Alex commented 10 months ago

Performance running in docker or outside docker:

Without docker

$ time vagrant up &> /dev/null
vagrant up &> /dev/null  24.09s user 4.97s system 44% cpu 1:05.51 total
$ time vagrant destroy -f &> /dev/null
vagrant destroy -f &> /dev/null  0.67s user 0.16s system 25% cpu 3.272 total

With docker

$ time ./scripts/vagrant up &> /dev/null
./scripts/vagrant up &> /dev/null  0.01s user 0.01s system 0% cpu 59.628 total
$ time ./scripts/vagrant destroy -f &> /dev/null
./scripts/vagrant destroy -f &> /dev/null  0.01s user 0.01s system 0% cpu 5.733 total
Its-Alex commented 10 months ago

Booting on CDROM is working fine

    # Add cdrom and boot on it
    domain.storage :file, :device => :cdrom, :path => Dir.pwd + "/xxx.iso"
    domain.boot "cdrom"
Its-Alex commented 10 months ago

GPU passthrough seems difficult with only one graphical card, I will not try

Its-Alex commented 10 months ago

It's directly possible to increase base disk size with domain.machine_virtual_size but partitions in the boxes aren't resized automatically

Its-Alex commented 10 months ago

Synced folder doesn't work out of the box for me, rsync folder is created but not synced. Maybe I missed something from the documentation.

So, I tried nfs:

config.vm.synced_folder './', '/vagrant', type: 'nfs'

And got this error:

mount.nfs: requested NFS version or transport protocol is not supported for /vagrant

When trying with another folder:

config.vm.synced_folder './archinstall-config', '/archinstall-config', type: 'nfs'
Its-Alex commented 2 months ago

I didn't find the solution. Since the POC was working I close this issue.