-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provider: utm qemu libvirt #2468
Comments
Thanks for opening your first issue here! Be sure to follow the issue template and include your OS/Vagrant/VVV versions! Don't forget you can get support in the VVV slack at https://varyingvagrantvagrants.org/docs/en-US/slack/
|
Possibly salient notes from someone else: https://gist.github.com/aserhat/91c1d5633d395d45dc8e5ab12c6b4767
|
I don't think this is necessarily an M1 or even Mac-specific thing. QEMU/libvirt are available for all three supported operating systems, so if we can make it work this could be our first completely free cross-platform provider. I say it's worth a shot! |
I'd like to point out that libvirt already has a stable vagrant provider. I'd say that's probably the easiest place to start. |
For MacOS we ideally want something using Apples hypervisor, which is what VMWare Docker and Parallels use |
Based on what research I'd done, it seems qemu does also use hypervisor. UTM explicitly says it does as well.
and
According to https://www.naut.ca/blog/2020/08/26/ubuntu-vm-on-macos-with-libvirt-qemu/:
|
then we need the following:
This also assumes no efforts towards containerised VVV or native VVV |
This libvirt box looks the most promising at the moment on vagrant clouds box catalog: https://app.vagrantup.com/travismccollum/boxes/u20_arm64 There's also xhyve, which has been around a while and uses a port of bhyve to interface with Apples hypervisor framework https://github.com/machyve/xhyve We would need to build our own box though, and I couldn't find any information in a brief look for Apple Silicon compatibility
|
If someone was willing to roll up their sleeves with xcode and some ruby, they could bypass all of these and build something specific to VVV+MacOS This issue has a lot of interesting things in it machyve/xhyve#206 |
I mean eventually. Though I'm not normally a fan of writing ruby. |
Multipass by canonical may be a viable alternative, it uses Apples hypervisor behind the scenes on MacOS, kvm on linux, and hyper-v on Windows. There's a Vagrant plugin but it hasn't been touched in 14 months. We would need to figure out our own box system though, or if boxes even make sense for multipass, there's nothing in a search for multipass on vagrant cloud |
I'm very interested in this: I'd like to run an ubuntu x86 via vagrant on an M1 mac. The guest system runs with UTM/qemu, what is missing is the interaction with vagrant. It would be very useful in that setup because some packages I use inside the vagrant box (which is similar to the production environment) don't have available binaries for ubuntu arm... |
It may be possible to build a primitive rigged vagrant plugin by building a VM in UTM that can be downloaded that's preconfigured then using https://github.com/utmapp/UTM/wiki/URL-Scheme-%E2%80%93-Automation-for-UTM-app-&-VMs Also relevant: utmapp/UTM#3618 Possibly require us to mess with their plist format, it would require a bit of effort but it looks doable. The concern I have is shared/mounted folders may be a pain in the arse to figure out. What I would like is someone who can do the following:
This way we can try to reverse engineer some things and figure stuff out |
This is quite possible to do right now with fully native If using macOS VM guests (yes, it's possible, but there's some tricks to it... e.g. they need NVRAM, and some magic incantations. It also requires a few more unreleased gem patches.) EDIT: The other nice feature with using |
@trinitronx vagrant runs on Apple silicon, I and others have been using M1 type machines with Parallels for months.
VVV uses debian/Ubuntu type VMs, we aren't interested in MacOS guests.
I don't see much progress here, especially with Vagrant being ported to Golang. Arm64 builds on golang should be significantly easier to get going, and I expect any Arm support vagrant provides to happen there first. It makes dealing with this that much more difficult as writing a UTM provider for example means writing it in ruby with all the deprecations coming in 2.3 and 2.4, or, writing it in golang and having to wait for 2.3 for limited documentation to be released. Another primary problem is that if we send users to install VirtualBox they get an installer, run it, reboot, done. But if we send them to install QEMU it's much more difficult. That's why we hoped UTM would resolve the issue. A lot of VVV users are not technical, don't know how to program, and struggle with the most basic aspects of CLI usage. E.g. if we send users to libvirt.org or just say "you need libvirt" then ¯_(ツ)_/¯ we won't get any users, it's gibberish, years beyond the technical skill of 99% of the users who would need such a provider, making the whole endeavour pointless. |
Just noting that I'd spotted this today as a possible way of letting vagrant use qemu directly as a vagrant plugin https://github.com/ppggff/vagrant-qemu
|
Was chatting with @evertiro in slack about this, logging some potentially useful links -- to the best of my knowledge, all linked projects here are free and open source.
UTM can run virtual machines beautifully on the M1 Macs using hypervisor -- https://mac.getutm.app/ -- it also has a version that runs on iPhones and iPads, but that's less salient to our purposes. https://github.com/utmapp/UTM/
There's been some questions on their repository about adding support for Vagrant:
utmapp/UTM#2496
with some planned changes that may make it more doable:
utmapp/UTM#2280
but it is noted there that UTM is largely a wrapper about QEMU.
UTM recently added some functionality to allow exporting the QEMU arguments out of UTM, if it simplifies anyone's workflow when doing initial explorations: utmapp/UTM@48a8fc7
QEMU -- https://www.qemu.org/ -- https://gitlab.com/qemu-project/qemu/ -- is a generic and open source machine emulator and virtualizer.
libvirt -- https://libvirt.org/ -- also works as a wrapper around qemu, and reportedly runs just fine on apple silicon! https://doesitarm.com/formula/libvirt/
It also has a vagrant provider: https://github.com/vagrant-libvirt/vagrant-libvirt
Anyway, just wanted to dump some starting points and research here for some assorted ways we could get VVV running smoothly on Apple Silicon with open source tools.
The text was updated successfully, but these errors were encountered: