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
vagrant init hashicorp/precise32
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
Following commands fixed the problem for me with vagrant 1.7.2 on Mac
brew install curl
export DYLD_INSERT_LIBRARIES=
Uncomment below line in Vagrantfile..
config.vm.box_check_update = false
Source: https://github.com/mitchellh/vagrant/issues/3391
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)
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
Related
But I am getting while downloading vagrant box
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'box-cutter/centos72' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
The box 'box-cutter/centos72' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Vagrant Cloud, 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://vagrantcloud.com/box-cutter/centos72"]
Error: Could not resolve proxy: cdn.boxcutter.io
enter image description here
$ vagrant up --provider virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos/7' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'centos/7'
default: URL: https://vagrantcloud.com/centos/7
==> default: Adding box 'centos/7' (v1905.1) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/centos/boxes/7/versions/1905.1/providers/virtualbox.box
==> default: Box download is resuming from prior download progress
default: Download redirected to host: cloud.centos.org
default:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
The requested URL returned error: 416
I try to setup a vagrant with a CentOS7.2.
I've found this on Atlas: https://atlas.hashicorp.com/brightcove/boxes/centos7.2
But when I set on my VagrantFile with
config.vm.box = "brightcove/centos7.2"
and
config.vm.box_url = "https://atlas.hashicorp.com/brightcove/boxes/centos7.2"
I get this error:
vagrant_centos$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'brightcove/centos7.2' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'https://atlas.hashicorp.com/brightcove/boxes/centos7.2'
default: URL: https://atlas.hashicorp.com/brightcove/boxes/centos7.2
==> default: Adding box 'brightcove/centos7.2' (v1.0.14) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/brightcove/boxes/centos7.2/versions/1.0.14/providers/virtualbox.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't resolve host 'xivagrantbox.vidmark.local'
vagrant_centos$
It seems like the box is not correctly hosted anywhere. on the atlas page, there's a warning mentioning
Atlas failed to verify the existence of this external box. It may have
been moved and is no longer available.
and if you try to go to the download page, it tries to redirect you to the xivagrantbox.vidmark.local site which obviously does not exist
$ curl https://atlas.hashicorp.com/brightcove/boxes/centos7.2/versions/1.0.14/providers/virtualbox.box
<html><body>You are being redirected.</body></html>
how to move from there:
You might want to contact the provider of this box so he can fix the link
You can search for another box
You can build the box yourself using tool like packer, https://github.com/boxcutter/centos has template for centos7.2
I get it with vagrant init boxcutter/centos72-desktop
$ vagrant init boxcutter/centos72-desktop
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.
(lab)luis#spinoza:~/lab/sandbox/akd-iac/vagrant_cos$ vi Vagrantfile
And then:
$ vagrant up
...
$
C:\Users\shubham\myvagrant>vagrant up
Bringing machine 'sparkvm' up with 'virtualbox' provider...
==> sparkvm: Box 'sparkmooc/base2' could not be found. Attempting to find and in
stall...
sparkvm: Box Provider: virtualbox
sparkvm: Box Version: >= 0
==> sparkvm: Loading metadata for box 'sparkmooc/base2'
sparkvm: URL: https://atlas.hashicorp.com/sparkmooc/base2
The box 'sparkmooc/base2' 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/sparkmooc/base2
Error: Unknown SSL protocol error in connection to atlas.hashicorp.com:443
vagrant cannot download the box sparkmooc/base2 from atlas due to SSL issue. You can do the following
$ vagrant box add sparkmooc/base2 --insecure
$ vagrant up
After running below commands getting a failure without proper error message:
$ vagrant init hashicorp/precise32
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise32' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise32'
default: URL: https://atlas.hashicorp.com/hashicorp/precise32
==> default: Adding box 'hashicorp/precise32' (v1.0.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/hashicorp/boxes/precise32/versions/1.0.0/providers/virtualbox.box
==> default: Box download is resuming from prior download progress
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Failed writing body (1576 != 7240)
By default vagrant downloads boxes(images) in home directory (~/.vagrant.d). If home has no enough space to store downloaded content you get this error.
To fix: setup default home to a different file system which has enough space
export VAGRANT_HOME=/data/vagrant/