Skip to content
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

vagrant up gets error indicatng that docker not supported #26

Open
ilearner777 opened this issue Nov 4, 2023 · 2 comments
Open

vagrant up gets error indicatng that docker not supported #26

ilearner777 opened this issue Nov 4, 2023 · 2 comments

Comments

@ilearner777
Copy link

Issue
I ran this on 2023-10-10 and vagrant successfully created a docker image.
I ran today on 2023-11-04 and now getting error described below

Environment:

  • Windows 11 Home Edition
  • Vagrant v2.4.0
  • Docker Desktop 4.25.0 (126437)

Vagrantfile Excerpt

Vagrant.configure("2") do |config|
    config.vm.box = "tknerr/baseimage-ubuntu-22.04"
    config.vm.box_version = "1.0.0"
  end

Error Message

vagrant up --provider=docker | tee ./.vagrant/docker.20231104-0845.log 2>&1
Bringing machine 'default' up with 'docker' provider...
==> default: Box 'tknerr/baseimage-ubuntu-22.04' could not be found. Attempting to find and install...
    default: Box Provider: docker
    default: Box Version: >= 0
==> default: Loading metadata for box 'tknerr/baseimage-ubuntu-22.04'
    default: URL: https://vagrantcloud.com/api/v2/vagrant/tknerr/baseimage-ubuntu-22.04
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
released.

Name: tknerr/baseimage-ubuntu-22.04
Address: https://vagrantcloud.com/api/v2/vagrant/tknerr/baseimage-ubuntu-22.04
Requested provider: docker (x64)

Additional Information

When I try to add box manually, this is the result:

$ vagrant box add tknerr/baseimage-ubuntu-22.04
==> box: Loading metadata for box 'tknerr/baseimage-ubuntu-22.04'
    box: URL: https://vagrantcloud.com/api/v2/vagrant/tknerr/baseimage-ubuntu-22.04
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: tknerr/baseimage-ubuntu-22.04
Address: https://vagrantcloud.com/api/v2/vagrant/tknerr/baseimage-ubuntu-22.04
Constraints: >= 0
Available versions: 1.0.0
@tknerr
Copy link
Owner

tknerr commented Nov 4, 2023

Hi @ilearner777 ,

hmmm... that seems really weird, I can't reproduce this (on Macbook at least, I don't have a Windows 11 available at the moment).

This is what I did:

$ vagrant box remove tknerr/baseimage-ubuntu-22.04 --all
Removing box 'tknerr/baseimage-ubuntu-22.04' (v0) with provider 'docker'...
Removing box 'tknerr/baseimage-ubuntu-22.04' (v1.0.0) with provider 'docker'...

$ vagrant init tknerr/baseimage-ubuntu-22.04 --box-version 1.0.0 --minimal
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

$ cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "tknerr/baseimage-ubuntu-22.04"
  config.vm.box_version = "1.0.0"
end

$ vagrant up --provider=docker
Bringing machine 'default' up with 'docker' provider...
==> default: Box 'tknerr/baseimage-ubuntu-22.04' could not be found. Attempting to find and install...
    default: Box Provider: docker
    default: Box Version: 1.0.0
==> default: Loading metadata for box 'tknerr/baseimage-ubuntu-22.04'
    default: URL: https://vagrantcloud.com/api/v2/vagrant/tknerr/baseimage-ubuntu-22.04
==> default: Adding box 'tknerr/baseimage-ubuntu-22.04' (v1.0.0) for provider: docker (amd64)
    default: Downloading: https://vagrantcloud.com/tknerr/boxes/baseimage-ubuntu-22.04/versions/1.0.0/providers/docker/amd64/vagrant.box
==> default: Successfully added box 'tknerr/baseimage-ubuntu-22.04' (v1.0.0) for 'docker (amd64)'!
==> default: Creating and configuring docker networks...
==> default: Creating the container...
    default:   Name: test_default_1699120553
    default:  Image: tknerr/baseimage-ubuntu:22.04
    default: Volume: /Users/tkn/tmp/test:/vagrant
    default:   Port: 127.0.0.1:2222:22
    default:
    default: Container created: b449e0835fa9ce8b
==> default: Enabling network interfaces...
==> default: Starting container...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!

@tknerr
Copy link
Owner

tknerr commented Nov 4, 2023

@ilearner777 could it be that you recently updated to vagrant 2.4.0?

In that case you likely ran into hashicorp/vagrant#13274, which had been fixed recently but not released yet.

The suggested workaround is to set the VAGRANT_HOST_ARCHITECTURE environment variable to amd64 until vagrant 2.4.1 is out, see hashicorp/vagrant#13274 (comment)

Can you check if that solves the issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants