1.9.1
Win 7 Pro
Centos 7
config.vm.box_url = "https://user:[email protected]/repository/vagrant/centos.json"
{
"name": "centos6",
"description": "centos6",
"versions": [{
"_comment": "centos6",
"version": "1.1.0",
"providers": [{
"name": "virtualbox",
"url": "https://repo.private.com/repository/vagrant/centos.box",
"checksum_type": "sha1",
"checksum": "865754195939814ce12650beb7ad8480ab882"
}]
}]
}
INFO subprocess: Starting process: ["C:\HashiCorp\Vagrant\embedded\bin/curl.EXE", "-q", "--fail", "--location", "--max-redirs", "10", "--user-agent", "Vagrant/1.9.1 (+https://www.vagrantup.com; ruby2.2.5)", "--continue-at", "-", "--location-trusted", "--output", "C:/Users/Rak/.vagrant.d/tmp/box0859c2ac170fe9a512c4c8f2cc573831412d8197", https://repo.private.com/repository/vagrant/centos.json"]
INFO subprocess: Starting process: ["C:\HashiCorp\Vagrant\embedded\bin/curl.EXE", "-q", "--fail", "--location", "--max-redirs", "10", "--user-agent", "Vagrant/1.9.1 (+https://www.vagrantup.com; ruby2.2.5)", "--continue-at", "-", "--location-trusted", "--output", "C:/Users/Rak/agrant.d/tmp/box0859c2ac170fe9a512c4c8f2cc573831412d8197", "https://repo.private.com/repository/vagrant/centos.box"]
The requested URL returned error: 401 Unauthorized
An error occurred while downloading the remote file. The error essage, if any, is reproduced below. Please fix this error and try gain.
The requested URL returned error: 401 Unauthorized
INFO interface: Machine: error-exit ["Vagrant::Errors::DownloaderError", "An error occurred while downloading the remote file. The error\nmessage, if any, is reproduced below. Please fix this error and try\nagain.\n\nThe requested URL returned error: 401 Unauthorized"]
We have a private server where we store our vagrant boxes and we use json to maintain versions.
"vagrant init centos6 https://repo.private.com/repository/vagrant/centos.json" gives us the vagrantfile with box_url as expected.
We change the url to add credentials like user:[email protected]/repository/vagrant/centos.json
When we do a vagrant up, we get an 401 because vagrant doesnt reuse the credentials for downloading the box. As shown in the log, during the curl for json it passes the credentials correctly where-as when it tries to download the right version/box the credentials are missing
401 error downloading the box
You might need to add VAGRANT_SERVER_URL on top of your Vagrantfile.
ENV["VAGRANT_SERVER_URL"] = "https://repo.private.com"
If i set the VAGRANT_SERVER_URL variable and
@rakeshm707
can you try:
config.vm.box = "https://user:[email protected]/repository/vagrant/centos.json"
Just in case someone ends up, here is what i have done :
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Just in case someone ends up, here is what i have done :