Open nileshtrivedi opened 1 year ago
One potential solution could be to have vagrant-qemu
somehow emulate the libvirt
provider. vagrant-qemu wiki seems to only document the creation of a libvirt box. I have asked them if emulation of libvirt for pre-existing boxes is somehow possible.
A second solution might be possible if Vagrant were to provide an option to force a box to work with another provider. I am not aware of a way to do this.
But this issue is for Mastodon switching to a box that does work with qemu provider and therefore, Apple M1 machines without new features like the above two.
I discovered that VirtualBox now has a Developer Preview build for Apple M1/M2 hosts. However, this doesn't actually work for me as the machine created by vagrant with ubuntu/bionic64 box gets aborted. Even if that were to be fixed, the performance will likely be terrible. These comments are explanatory:
Treat the M1 build as a very very early technical preview please, the Beta label is completely misleading and will be changed (this comes from the automated build system and aligns with the rest of the builds). There will be no official support for M1 with 7.0, not even for ARM virtualization, let alone x86 emulation on ARM.
And,
In a way the ARM64 package "slipped out", and it's not expected to work reliably. The implementation isn't complete yet (which is what you saw), and in top of that the performance is known to be extremely low. It isn't anywhere near production ready, we know. This will not change for VirtualBox 7, and the "Technology Preview" marker will stay for the foreseeable future, indicating that it won't be supported at all.
At best you'll get some really old 32-bit Linux to run to some degree, such as DSL 4.4.10. No chance even with Ubuntu 16.04 i386.
So, we do need a solution for running the Mastodon vagrant box on Apple M1/M2 machines.
Docs in question: https://docs.joinmastodon.org/dev/setup/
Vagrant needs a "provider" for managing the virtual machine with commands like
vagrant up
andvagrant ssh
. The Mastodon docs make no mention of which provider to use with Vagrant. Apple M1/M2 machines do not support VirtualBox or VMWare.There's a virtualization app for Apple M1 called UTM that uses QEMU under the hood. I found an unofficial QEMU provider for Vagrant and installed it with
brew install qemu
andvagrant plugin install vagrant-qemu
.However, Mastodon's Vagrantfile requires the box image "ubuntu/bionic64" which only supports virtualbox (
libvert
) as the provider. Which is why this is my experience with using Mastodon's Vagrant setup on Apple M1 machine:This is even after I added the following section in the Vagrantfile as suggested by vagrant-qemu README: