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

Default provider architecture is not used for 'unknown' box architecture #13312

Closed alexgit2k closed 5 months ago

alexgit2k commented 6 months ago

Description

One of the architecture can be selected as "Default provider architecture" which is then marked with a star on the frontend. If no architecture is supplied (like with vagrant init) it looks like vagrant wants to fetch the box for architecture unknown and is not using the architecture which has been set as default.

Alma Linux has no box for the unknown architecture, therefore vagrant init is not working:

Rocky Linux has a box for the unknown architecture, therefore vagrant init is working:

Expected behavior

Provisioned box.

Actual behavior

The box you're attempting to add has no available version that
matches the constraints you requested. Please double-check your
settings. Also verify that if you specified version constraints,
that the provider you wish to use is available for these constraints.

Box: almalinux/9
Address: https://vagrantcloud.com/api/v2/vagrant/almalinux/9
Constraints: 9.3.20231118
Available versions: 9.0.20220513, 9.0.20220531, 9.0.20220715, 9.0.20220802, 9.0.20220823, 9.0.20220830, 9.0.20221003, 9.0.20221102, 9.1.20221117, 9.2.20230513, 9.3.20231118

Reproduction information

Vagrant version

2.4.0

Host operating system

Windows 10

Guest operating system

Almalinux 9, Rocky Linux 9

Steps to reproduce

Not working
  1. vagrant init --box-version 9.3.20231118 --minimal almalinux/9
  2. vagrant up
Working
  1. vagrant init --box-version =3.0.0 --minimal rockylinux/9
  2. vagrant up

Vagrantfile

Not working
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "almalinux/9"
  config.vm.box_version = "9.3.20231118"
end
Working
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "rockylinux/9"
  config.vm.box_version = "=3.0.0"
end
chrisroberts commented 6 months ago

Hi there. This has the host operating system listed as Linux and the guest operating system listed as Windows. However, the vagrant init is setting up a Linux guest. Is this issue being encountered on Windows host systems?

alexgit2k commented 5 months ago

@chrisroberts My mistake, corrected it now in the issue. Happens on a Windows-host with Linux-guests.

chrisroberts commented 5 months ago

Thanks for the clarification. Closing as a dup of #13274 which is fixed by #13278. This comment includes a workaround. The 2.4.1 release will include the fix which will be out at the end of the week.

Cheers!

alexgit2k commented 5 months ago

Thank you very much Chris! I can confirm that with the changes in #13278 it is now working: