hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.02k stars 4.42k forks source link

Vagrant support on Mac M1 with Qemu #13294

Open flmmartins opened 7 months ago

flmmartins commented 7 months ago

Is your feature request related to a problem? Please describe.

I have a scenario where I need to create an image with Packer using M1. I am using packer QEMU builder and I create a vagrant box with libvirt (which is the only option supported in packer at the moment for M1) using post processors.

Sadly I cannot use vagrant with libvirt after installed the plugin because I fall into this issue with this error:

Error Error while connecting to Libvirt: Error making a connection to libvirt URI qemu:///system: Call to virConnectOpen failed: Failed to connect socket to '/usr/local/var/run/libvirt/virtqemud-sock': No such file or directory

Then I tried to workaround it using virt-manager:

arch -x86_64 brew install virt-manager # not available on M1 but through roseta
brew services start libvirt 
virt-manager -c "qemu:///session" --no-fork

Also does not work.

Then I tried to use vagrant qemu plugin but since I want to use ubuntu I have to convert the image which then also does not work.

Then I try to do some workarounds if I can have the packer qemu image to be converted to be used as a vagrant box myself but also that does not work.

So despite having are many "solutions" out there for Mac M1 none of it seems to work nicely.

Describe the solution you'd like Oficial vagrant qemu support with libvirt OR Oficial vagrant utm support: https://github.com/hashicorp/vagrant/issues/12518

I can understand why UTM might not be viable at this point but using having full support on QEMU via libvirt on Mac M1 or some support would be nice.

Describe alternatives you've considered You may be reading this and think: That's a problem from packer but if I download a Bento qemu image from Vagrant cloud I cannot run on my M1 as well. So even if you remove packer from the scenario it would be nice to have an alternative