vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Enhancement Request: Vagrant for aarch64 and other architectures

Open AlexBaranowski opened this issue 3 years ago • 9 comments

Add aarch64 support for Vagrant

I'm trying to find Vagrant for aarch64 (I'm using EL 8):

https://rpm.releases.hashicorp.com/RHEL/8/aarch64/stable/repodata/repomd.xml - returns 404 https://rpm.releases.hashicorp.com/RHEL/8/x86_64/stable/repodata/repomd.xml - returns 200 with repomd.xml file (this is a file that describes RPM-based repository).

The very same thing is with Fedora:

https://rpm.releases.hashicorp.com/fedora/34/aarch64/stable/repodata/repomd.xml - 404 https://rpm.releases.hashicorp.com/fedora/34/x86_64/stable/repodata/repomd.xml - OK

I would love to see Vagrant on different architectures than x86_64. It could start with aarch64.

There is also the following problem - the app.vagrantup.com does not support multiple architectures.

In the company I'm working for, the Vagrant is one of the most essential QA tools. When we started our support for aarch64, we had to split our pipelines so that the x86_64 pipeline uses Vagrant when aarch64 and ppc64le don't.

AlexBaranowski avatar Oct 21 '21 09:10 AlexBaranowski

Hi Team,

I am also interested in the Linux/ARM64 (aarch64) Vagrant support/binary-release/Docker-Images. May I know, do you have any plans for the same in the near future? If required, I will be happy to contribute.

odidev avatar Oct 27 '21 05:10 odidev

Alternatively, if this is going to take a while, are there instructions for us to be able to run the vagrant compile and package routine ourselves locally instead of waiting? I would definitely like to try to get vagrant running on a Raspberry Pi using native packaging without having to go the local rvm route. The available upstream version in 18.04 is fairly old so its not as simple as adding official repo.

ju2wheels avatar Jan 24 '22 18:01 ju2wheels

Yes, we need a native Vagrant build for arm64.

In order to accommodate everyone on the team who have both Apple Silicon Macs and Intel Macs, I wanted to write something like this in my Vagrantfile:

Vagrant.configure('2') do |config|

  arch = `arch`

  config.vm.box = if arch == 'arm64'
    'whichever/ubuntu-server-20.04-arm64'
  else if arch == 'i386'
    'whichever/ubuntu-server-20.04-i386'
  end

  ...
end

but I found out that since Vagrant is running under Rosetta, the arch command always returns i386 even when it's running on an Apple Silicon Mac, so I can't decide on the box at runtime!

If anyone has a workaround, please let me know.

fredngo avatar Mar 08 '22 21:03 fredngo

If anyone has a workaround, please let me know.

I've been able to work around the issue by installing vagrant and other ruby gems from source. While this works as a proof-of-concept... technically the issue, #12559, is not resolved. So, I recommend leaving this issue open until Hashicorp folks get around to providing an official native arm64 / aarch64 build for Apple Silicon.

trinitronx avatar Mar 30 '22 03:03 trinitronx

Also interested in aarch64-darwin builds so we do not need rosetta emulation.

jhgorse avatar Mar 31 '22 22:03 jhgorse

Bumping issue to avoid the dessant/lock-threads bot 🤖 closing it prematurely...

trinitronx avatar Apr 21 '22 06:04 trinitronx

Bumping this issue, as #12559 was closed prematurely by the github-actions bot

As described by @chrisroberts here, vagrant providers on arm64 are still in the stage of limited or no support. However, it is now possible to get vagrant-libvirt working with full native support for arm64 on MacOS. It is also possible to use with VMWare Fusion Tech Preview.

Status update on all the dependencies needed to get this working with the libvirt provider can be found here

trinitronx avatar May 10 '22 23:05 trinitronx

If anyone has a workaround, please let me know.

Here's my workaround to detect whether we're using Rosetta or not: https://github.com/hashicorp/vagrant/issues/12610#issuecomment-1109906113

fredngo avatar May 19 '22 02:05 fredngo

If anyone has a workaround, please let me know.

Here's my workaround to detect whether we're using Rosetta or not: #12610 (comment)

Here is another way to detect if running on Apple Silicon arm64 or Intel x86_64. This implementation will return x86_64 when inside Rosetta, because it was designed to bootstrap the proper architecture according to whether the user is running it under Rosetta or not. However, you could still use both sysctl values to detect the different hardware.

Here's a helpful "truth table" for those sysctl values on each hardware arch with & without emulation:

sysctl Name Rosetta M1 Value Native M1 Value Intel Mac Value
hw.optional.x86_64 1 '' (empty string) 1
hw.optional.arm64 1 1 sysctl: unknown oid 'hw.optional.arm64'
sysctl.proc_translated 1 0 sysctl: unknown oid 'sysctl.proc_translated'

trinitronx avatar May 23 '22 02:05 trinitronx

I'm just chipping in to keep this alive. Please build Vagrant natively for ARM. In my case, I'm on Apple M2.

wwkimball avatar Jan 27 '23 04:01 wwkimball

Same here, Apple M2 Pro. an ARM build would fix the VMware-Desktop plugin headless issues.

ReubenBTalbott avatar Apr 13 '23 01:04 ReubenBTalbott

Pinging this issue again in hopes to raise visibility.

It would help if we had any response from Hashicorp maintainers of Vagrant as to the roadmap & future support plans for arm64 / Apple Silicon support.

In theory, the newer push towards vagrant-go would be able to be compiled natively on Arm64. However, then the question remains: Whether ruby-based plugins will still work?

I still have a use-case for vagrant-libvirt on Apple Silicon, running completely natively, as well as using qemu+ssh:// to launch QEMU / LibVirt VMs on a remote Linux host from a macOS developer workstation.

trinitronx avatar Apr 26 '23 03:04 trinitronx

I stumbled on this issue and folks you want to check this out, however it doesn't work yet somehow it's closed off.

https://github.com/hashicorp/vagrant/issues/12825

jimsmith avatar May 17 '23 14:05 jimsmith

I stumbled on this issue and folks you want to check this out, however it doesn't work yet somehow it's closed off.

https://github.com/hashicorp/vagrant/issues/12825

Brew must not have updated yet. If you download from the website it works on arm perfectly.

ReubenBTalbott avatar May 17 '23 14:05 ReubenBTalbott

Hey @ReubenBTalbott can you share screenshots of the arm64 installing (without rosetta?)

as I downloaded it directly from the website and doesn't install as it requires rosetta so it's not a native installer.

Here's my screenshots showing it being downloaded from the website and requires Rosetta..... https://github.com/hashicorp/vagrant/issues/12825#issuecomment-1551448500

I stumbled on this issue and folks you want to check this out, however it doesn't work yet somehow it's closed off. #12825

Brew must not have updated yet. If you download from the website it works on arm perfectly.

jimsmith avatar May 17 '23 14:05 jimsmith

@jimsmith it looks like the vagrant-go binary is still AMD64. Everything else is ARM64: Screenshot 2023-05-17 at 9 57 05 AM

ReubenBTalbott avatar May 17 '23 16:05 ReubenBTalbott

Also @jimsmith are you downloading the right installer? There is a separate one for ARM: Screenshot 2023-05-17 at 10 01 42 AM https://developer.hashicorp.com/vagrant/downloads

ReubenBTalbott avatar May 17 '23 17:05 ReubenBTalbott

I'd try running it without rosetta but I'm not sure how to force that.

ReubenBTalbott avatar May 17 '23 17:05 ReubenBTalbott

Also @jimsmith are you downloading the right installer? There is a separate one for ARM: Screenshot 2023-05-17 at 10 01 42 AM https://developer.hashicorp.com/vagrant/downloads

@ReubenBTalbott thanks yes I am as per my screenshots (here https://github.com/hashicorp/vagrant/issues/12825#issuecomment-1551448500)

I've downloaded ARM64 version: https://releases.hashicorp.com/vagrant/2.3.5/vagrant_2.3.5_darwin_arm64.dmg

image

And this happens: image

jimsmith avatar May 17 '23 17:05 jimsmith

@jimsmith interesting, the vagrant binary itself is ARM, so compiling from source might work for you if you can't use the installer. Question, why is installing rosetta a problem for you?

ReubenBTalbott avatar May 17 '23 17:05 ReubenBTalbott

I've downloaded ARM64 version: https://releases.hashicorp.com/vagrant/2.3.5/vagrant_2.3.5_darwin_arm64.dmg

image

The names are very similar, and the dialog shows you downloaded AMD, not ARM.

nitind avatar May 17 '23 17:05 nitind

@ReubenBTalbott because of these :)

https://github.com/hashicorp/vagrant/issues/12825#issuecomment-1440833354 https://github.com/hashicorp/vagrant/issues/12825#issuecomment-1440845771 (packer installs and runs natively on apple silicon M2) https://apple.stackexchange.com/questions/450541/drawbacks-to-apply-rosetta-to-all-apps

Also many organisations control Mac's on what software is allowed to be installed especially in controlled/regulated organisations wereby Rosetta 2 blocked by central IT due to organisations corporate IT Security policy.

jimsmith avatar May 17 '23 17:05 jimsmith

I was testing out both versions earlier, here's the vagrant_2.3.5_darwin_arm64.dmg

confirmed it's the arm64 installer.

239029010-5172844b-fdcb-4177-88e4-82260705ca74

jimsmith avatar May 17 '23 17:05 jimsmith

As I point out in: https://github.com/hashicorp/vagrant/issues/12825#issuecomment-1552130640

I see the same dialog as @jimsmith when trying to install.

jmgurney avatar May 17 '23 21:05 jmgurney

When looking for vagrant-go this repository https://github.com/hashicorp/vagrant-installers

This line shows as arm64 https://github.com/hashicorp/vagrant-installers/blob/main/.github/workflows/build-macos.yml#L113

And looking at the Github Action job it has not ran before: https://github.com/hashicorp/vagrant-installers/actions/workflows/dev-macos-installer.yml

Nor it seems has this Github Action https://github.com/hashicorp/vagrant-installers/actions/workflows/dev-macos-installer.yml

@chrisroberts will this be resolved please ?

jimsmith avatar May 17 '23 22:05 jimsmith

Hi everyone,

This issue is related to architecture metadata support within the core of Vagrant, and not architecture supported by Vagrant installers. Please use #12825 for the latter. Thanks!

chrisroberts avatar May 17 '23 22:05 chrisroberts