menu

Questions & Answers

Vagrant: Error: Could not resolve host: (nil); Host not found

I am getting "Could not resolve host" error while trying to create a vm using vagrant and VirtualBox. I followed the instruction from http://docs.vagrantup.com/v2/getting-started/

Executed the below 2 commands

  1. vagrant init hashicorp/precise32

  2. vagrant up

Below is the error message.

C:\Users\xyz123>vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'ubuntu/trusty32' could not be found. Attempting to find and in stall... default: Box Provider: virtualbox default: Box Version: >= 0 The box 'ubuntu/trusty32' could not be found or could not be accessed in the remote catalog. If this is a private box on HashiCorp's Atlas, please verify you're logged in via vagrant login. Also, please double-check the name. The expanded URL and error message are shown below:

URL: ["https://atlas.hashicorp.com/ubuntu/trusty32"] Error: Could not resolve host: (nil); Host not found

All the help appreciated

Comments:
2023-01-23 00:00:08
Have you checked that in your VagrantFile config.vm.box is set to hashicorp/precise32?
2023-01-23 00:00:08
hello, my bad. I copied the VagrantFile content after i edited it to try to download precise32. But i get same error with hashicorp/precise32 and ubuntu/trusty32.
Answers(4) :

Following commands fixed the problem for me with vagrant 1.7.2 on Mac

brew install curl
export DYLD_INSERT_LIBRARIES=

Setting up the proxy command worked for me

export https_proxy=http://username:password@proxy_ip:proxy_port

Then

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'ubuntu/trusty64'
    default: URL: https://atlas.hashicorp.com/ubuntu/trusty64
==> default: Adding box 'ubuntu/trusty64' (v20170202.0.0) for provider: virtualbox
    default: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20170202.0.0/providers/virtualbox.box
    default: Progress: 8% (Rate: 302k/s, Estimated time remaining: 0:26:21)

Uncomment below line in Vagrantfile..

config.vm.box_check_update = false

Source: https://github.com/mitchellh/vagrant/issues/3391

You are calling a box inside a box you will you don't need to init again just vagrant up,you will need to start afresh