vagrant icon indicating copy to clipboard operation
vagrant copied to clipboard

Enhancement Request: Provide buils for ARM

Open Tcharl opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. Vagrant on ARM (libvirt & parallels) is more and more required due to the efficience of these machines

Describe the solution you'd like A dedicated build and installer for arm

Describe alternatives you've considered Tried building from the sources and follow multiple tutorial but everything is for sure cumbersome

Tcharl avatar Aug 02 '22 10:08 Tcharl

I echo @Tcharl and +1 this request. Being able to download the relevant package (.deb. and .rpm) from the hashicorp website would sure be useful. And making sure these are also available via your package repository would be appreciated.

I am doing more and more work on Arm based silicon (Mac osX and Linux based)....

sbates130272 avatar Aug 22 '22 14:08 sbates130272

Yes, please make a native arm binary, or better yet, a universal binary.

jmgurney avatar Feb 02 '23 18:02 jmgurney

Looks like arm native builds aren't fully supported. installed Ruby 3.1.3 and attempted to do a bundle install and it failed with:

linking shared-object grpc/grpc_c.bundle
Undefined symbols for architecture arm64:
  "_ruby_abi_version", referenced from:
     -exported_symbol[s_list] command line option
ld: symbol(s) not found for architecture arm64

jmgurney avatar Feb 02 '23 19:02 jmgurney

Mac users don't want to nor should install Rosetta 2 to run software on Apple Silicon M2 chip, therefore a native installer is really needed here, I've transitioned over from Intel chipset to M2 and other software vendors have solved this problem already (Vscode, Google Drive, Docker Desktop, Iterm2, Spotify but to name a few)

$ brew install hashicorp/tap/hashicorp-vagrant
==> Downloading https://releases.hashicorp.com/vagrant/2.3.4/vagrant_2.3.4_darwin_amd64.dmg
Already downloaded: /Users/jim.smith/Library/Caches/Homebrew/downloads/42e309b6a372ee35af42017a677ef41507b8d183dcbd7b4f1af172c9070e4dee--vagrant_2.3.4_darwin_amd64.dmg
==> Installing Cask hashicorp-vagrant
==> Running installer for hashicorp-vagrant; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
installer: This package requires Rosetta 2 to be installed.
                Please install Rosetta 2 and then try again.
                    `sudo softwareupdate --install-rosetta`

installer: Error - Vagrant can’t be installed on this computer.

jimsmith avatar Feb 22 '23 21:02 jimsmith

packer installs and runs natively on apple silicon M2

$ brew tap hashicorp/tap
$ brew install hashicorp/tap/packer
==> Fetching hashicorp/tap/packer
==> Downloading https://releases.hashicorp.com/packer/1.8.6/packer_1.8.6_darwin_arm64.zip
######################################################################## 100.0%
==> Installing packer from hashicorp/tap
🍺  /opt/homebrew/Cellar/packer/1.8.6: 3 files, 195.4MB, built in 3 seconds
==> Running `brew cleanup packer`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
$ packer --version
1.8.6

jimsmith avatar Feb 22 '23 21:02 jimsmith

Hi everybody,

This has been resolved in the latest Vagrant release.

Cheers!

chrisroberts avatar May 17 '23 00:05 chrisroberts

Hi @chrisroberts

I just tried this and few things...

The version from that release says 2.3.5 however it's only 2.3.4 that is available and it doesn't work.

image
$ brew install hashicorp/tap/hashicorp-vagrant
==> Downloading https://releases.hashicorp.com/vagrant/2.3.4/vagrant_2.3.4_darwin_amd64.dmg
######################################################################## 100.0%
==> Installing Cask hashicorp-vagrant
==> Running installer for hashicorp-vagrant; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
installer: This package requires Rosetta 2 to be installed.
                Please install Rosetta 2 and then try again.
                    `sudo softwareupdate --install-rosetta`

installer: Error - Vagrant can’t be installed on this computer.
==> Purging files for version 2.3.4 of Cask hashicorp-vagrant
Error: Failure while executing; `/usr/bin/sudo -E LOGNAME=test USER=test USERNAME=test -- /usr/sbin/installer -pkg /opt/homebrew/Caskroom/hashicorp-vagrant/2.3.4/vagrant.pkg -target /` exited with 1. Here's the output:
installer: This package requires Rosetta 2 to be installed.
                Please install Rosetta 2 and then try again.
                    `sudo softwareupdate --install-rosetta`

installer: Error - Vagrant can’t be installed on this computer.

jimsmith avatar May 17 '23 09:05 jimsmith

Works on mine :-).

brew install hashicorp/tap/hashicorp-vagrant
==> Tapping hashicorp/tap
Cloning into '/opt/homebrew/Library/Taps/hashicorp/homebrew-tap'...
remote: Enumerating objects: 3222, done.
remote: Counting objects: 100% (256/256), done.
remote: Compressing objects: 100% (157/157), done.
remote: Total 3222 (delta 154), reused 185 (delta 99), pack-reused 2966
Receiving objects: 100% (3222/3222), 604.85 KiB | 1.11 MiB/s, done.
Resolving deltas: 100% (2022/2022), done.
Tapped 2 casks and 25 formulae (75 files, 821.4KB).
==> Downloading https://releases.hashicorp.com/vagrant/2.3.4/vagrant_2.3.4_darwin_amd64.dmg
Already downloaded: /Users/charliemordant/Library/Caches/Homebrew/downloads/42e309b6a372ee35af42017a677ef41507b8d183dcbd7b4f1af172c9070e4dee--vagrant_2.3.4_darwin_amd64.dmg
==> Installing Cask hashicorp-vagrant
==> Running installer for hashicorp-vagrant; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
Password:
installer: Package name is Vagrant
installer: Upgrading at base path /
installer: The upgrade was successful.
🍺  hashicorp-vagrant was successfully installed!

Cheers, and thanks vagrant community!

Tcharl avatar May 17 '23 13:05 Tcharl

That downloads 2.3.4 and that is AMD64 image as you'll see in your output :)

It doesn't work for arm which is this issue :) LOL

my output: Downloading https://releases.hashicorp.com/vagrant/2.3.4/vagrant_2.3.4_darwin_amd64.dmg <-- notice no arm64

your output: Downloading https://releases.hashicorp.com/vagrant/2.3.4/vagrant_2.3.4_darwin_amd64.dmg Already downloaded: /Users/charliemordant/Library/Caches/Homebrew/downloads/42e309b6a372ee35 which you have cached.

Is your mac silicon chipset or intel chipset ?

Also do you have Rosetta 2 installed ?

Works on mine :-).

brew install hashicorp/tap/hashicorp-vagrant
==> Tapping hashicorp/tap
Cloning into '/opt/homebrew/Library/Taps/hashicorp/homebrew-tap'...
remote: Enumerating objects: 3222, done.
remote: Counting objects: 100% (256/256), done.
remote: Compressing objects: 100% (157/157), done.
remote: Total 3222 (delta 154), reused 185 (delta 99), pack-reused 2966
Receiving objects: 100% (3222/3222), 604.85 KiB | 1.11 MiB/s, done.
Resolving deltas: 100% (2022/2022), done.
Tapped 2 casks and 25 formulae (75 files, 821.4KB).
==> Downloading https://releases.hashicorp.com/vagrant/2.3.4/vagrant_2.3.4_darwin_amd64.dmg
Already downloaded: /Users/charliemordant/Library/Caches/Homebrew/downloads/42e309b6a372ee35af42017a677ef41507b8d183dcbd7b4f1af172c9070e4dee--vagrant_2.3.4_darwin_amd64.dmg
==> Installing Cask hashicorp-vagrant
==> Running installer for hashicorp-vagrant; your password may be necessary.
Package installers may write to any location; options such as `--appdir` are ignored.
Password:
installer: Package name is Vagrant
installer: Upgrading at base path /
installer: The upgrade was successful.
🍺  hashicorp-vagrant was successfully installed!

Cheers, and thanks vagrant community!

jimsmith avatar May 17 '23 13:05 jimsmith

I don't see why this is closed as the installer itself doesn't work nor the brew installation.

MacBook Pro Apple M2 Max doesn't work sadly @chrisroberts

Brew installer doesn't work: https://github.com/hashicorp/vagrant/issues/12825#issuecomment-1551095299

ARM64 Direct download: https://developer.hashicorp.com/vagrant/downloads https://releases.hashicorp.com/vagrant/2.3.5/vagrant_2.3.5_darwin_arm64.dmg

Still requires Rosetta.

image

AMD64 https://releases.hashicorp.com/vagrant/2.3.5/vagrant_2.3.5_darwin_amd64.dmg image

jimsmith avatar May 17 '23 13:05 jimsmith

I can confirm that the arm64 labeled download for 2.3.5 requires rosetta to install. It looks like vagrant-go in core.pkg/Payloadcore.pkg/bin requires x86-64:

$ file *
vagrant:    Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
vagrant (for architecture x86_64):	Mach-O 64-bit executable x86_64
vagrant (for architecture arm64):	Mach-O 64-bit executable arm64
vagrant-go: Mach-O 64-bit executable x86_64

That looks like the only file that isn't a universal binary.

jmgurney avatar May 17 '23 21:05 jmgurney

As I have pointed out at the below issue comment it does not appear that the mac arm64 Github Action build has ran before for in the https://github.com/hashicorp/vagrant-installers repo.

@chrisroberts https://github.com/hashicorp/vagrant/issues/12548#issuecomment-1552160740

jimsmith avatar May 17 '23 22:05 jimsmith

Hi everyone,

I'm re-opening this issue due to the prompt macOS provides when rosetta is not installed, however, the Vagrant installer is a universal installer. The only non-universal file is the vagrant-go binary as it is only included for testing. I was unaware of this behavior on macOS, my apologies.

We will be releasing a point release soon to address a few issues and I'll be sure it includes a universal binary of vagrant-go to prevent the current behavior being encountered during installation.

Cheers

chrisroberts avatar May 17 '23 22:05 chrisroberts

Development build is available with updated vagrant-go binary here: https://github.com/hashicorp/vagrant/releases/tag/2.3.6.dev%2B5009580690-66edc80

chrisroberts avatar May 18 '23 17:05 chrisroberts

Thanks @chrisroberts

After downloading https://github.com/hashicorp/vagrant/releases/download/2.3.6.dev%2B5009580690-66edc80/vagrant_2.3.6.dev_darwin_universal.dmg the installer prompts to install Rosetta.

image image

jimsmith avatar May 22 '23 07:05 jimsmith

@jimsmith I'm working on getting an arm vm setup so i can test this (since removing rosetta is a whole thing). In the meantime, if you could confirm that it is the same with the proper 2.3.6 release, that would be much appreciated. My initial guess is that it may have to do with how Ruby is being put together but I'm going to have to investigate a bit.

chrisroberts avatar May 22 '23 21:05 chrisroberts

@chrisroberts absolutely no problem, I'll do this tomorrow first thing for 2.3.6 release as it's quite late here in the UK (11:17pm) and will post back the results first thing tomorrow for you.

jimsmith avatar May 22 '23 22:05 jimsmith

See the same thing here.

Also, confirmed that all the binaries are dual architecture.

jmgurney avatar May 22 '23 23:05 jmgurney

@chrisroberts confirmed that it's the same with 2.3.6 release: https://releases.hashicorp.com/vagrant/2.3.6/vagrant_2.3.6_darwin_arm64.dmg

jimsmith avatar May 23 '23 07:05 jimsmith

I have a development build that I think will resolve this issue.

chrisroberts avatar Jun 01 '23 18:06 chrisroberts

Still seeing the Rosetta installation prompt.

image

Machine: M2 with macOS 13.3 (never installed Rosetta).

jetxr avatar Jun 02 '23 07:06 jetxr

@jetxr Thank you for testing it! There must still be a standalone x86 in there somewhere. I'll run another search and see if I can track it down.

chrisroberts avatar Jun 02 '23 15:06 chrisroberts

Alright, another development build which includes the changes in hashicorp/vagrant-installers#281. After a bit more digging, it appears that this configuration setting within the installer should suppress the rosetta prompt and install correctly.

chrisroberts avatar Jun 02 '23 16:06 chrisroberts

Thanks @chrisroberts! It works now without Rosetta.

jetxr avatar Jun 03 '23 05:06 jetxr

Awesome, thank you for the confirmation @jetxr!

chrisroberts avatar Jun 05 '23 15:06 chrisroberts

Thanks @chrisroberts I can confirm that development build installs without Rosetta for me as well:

$ vagrant --version
Vagrant 2.3.7.dev

jimsmith avatar Jun 05 '23 15:06 jimsmith