15

I get this error when I do a vagrant up :

anr@anr-Lenovo-G505s ~ $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Adding box 'base' (v0) for provider: virtualbox
default: Downloading: base
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 open file /home/anr/base

This is the Vagrantfile I have:

 # -*- mode: ruby -*-
 # vi: set ft=ruby :
 Vagrant.configure('2') do |config|
   config.vm.box      = 'precise32'
   config.vm.box_url  = 'http://files.vagrantup.com/precise32.box'
   config.vm.hostname = 'bootcamp'
   config.ssh.forward_agent = true

config.vm.provider 'vmware_fusion' do |v, override|
  override.vm.box     = 'precise64'
  override.vm.box_url = 'http://files.vagrantup.com/precise64_vmware.box'
end

config.vm.provider 'parallels' do |v, override|
  override.vm.box = 'parallels/ubuntu-12.04'
  override.vm.box_url = 'https://vagrantcloud.com/parallels/ubuntu-12.04'

# Can be running at background, see https://github.com/Parallels/vagrant-parallels/issues/39
v.customize ['set', :id, '--on-window-close', 'keep-running']
end

config.vm.network :forwarded_port, guest: 3000, host: 3000

 config.vm.provision :puppet do |puppet|
   puppet.manifests_path = 'puppet/manifests'
   puppet.module_path    = 'puppet/modules'
 end

end

This is my machine setup:

 vagrant -v     Vagrant 1.6.2
 VirtualBox     4.3.2
 Linux Mint 15 Olivia Cinammon
vamsiampolu
  • 6,328
  • 19
  • 82
  • 183

7 Answers7

44

I was having this problem. I was creating the folder, and using the following commands:

vagrant init
vagrant box add hashicorp/precise64
vagrant up

and getting the error about downloading the remote file.

Try this:

create a folder,
cd folder
vagrant init hashicorp/precise64 (or whatever vm you want to run)
vagrant up

Hopefully this resolves your issue

Martin
  • 949
  • 1
  • 10
  • 15
  • Thanks! I was spending countless hours trying to fix this issue. – Optimus Prime Sep 02 '14 at 20:13
  • doesnt work for me.. Instead of looking for `/my/path/to/foo` it now is looking for `/my/path/to/foo/foo` – JackChance Jun 03 '16 at 17:38
  • From a year ago, I have lost the hope to install homestead , due to consecutive errors , but with your trick , Now i had homestead working . thx alot @Martin – mercury Mar 08 '17 at 23:52
  • Hmm, funny because if you just walk through the tutorial on the vagrant site you'll will end up right here with this problem as it leads you through those exact steps: create folder, go to folder, vagrant init, vagrant box add hashicorp/precise64, vagrant up -> error. The additional parameter to init creates a .vagrant subfolder with the additional pieces that seem to be necessary to make this work. The very first getting started page has you run vagrant init hashicorp/precise64, but it doesn't tell you where to run it and the following pages lead you down this hole, without explanation. – Erikest May 13 '17 at 15:46
4

The underlying problem is that your VM machine is mislabeled. I also realize you are targeting "precise32", but i'm using "base" as an example here.

if you were to navigate to:

~/.vagrant.d/boxes

you would see something like this:

$ ls -la

drwxr-xr-x 4 some_user staff 136 Oct 22 09:43 ./ drwxr-xr-x 10 some_user staff 340 Oct 22 09:41 ../ drwxr-xr-x 4 some_user staff 136 Jun 29 13:23 hashicorp-VAGRANTSLASH-precise32/

that last line is telling you that you have only one box, and its the precise32 box.

however, assuming you setup a default Vagrant setup like so:

$ cd ~/src/vagrant/myvm
$ vagrant init

if you look inside the Vagrant file created for you:

$ vim Vagrant

you will see the following output:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.box = "base" 
end

note that it is looking for the box named "base"! So what I did is:

$ cd ~/.vagrant.d/boxes
$ cp -R hashicorp-VAGRANTSLASH-precise32 base
$ cd ~/src/vagrant/myvm
$ vagrant up

and then you can go back and delete the "hashicorp-VAGRANTSLASH-precise32" box as it is now a duplicate.

Of course, you could have done this another way and renamed

config.vm.box = "base"

to whatever your box is called, but i found the former way better because if you wish to create a second vm based on the default box, then you would face the same problem. So its better to rename the box, instead of renaming each time you "vagrant init".

Tomasz Iniewicz
  • 4,379
  • 6
  • 42
  • 47
  • go to .vagrant.d/boxes/ and change folder "laravel-VAGRANTSLASH-homestead" name to "base". Worked for me with this. – Badar Mar 05 '16 at 23:21
1

if you renamed the default name "base"

try it:

vagrant init "your box name"

It's work for me.

also see

fire
  • 19
  • 2
0

You can solve this by simply install vagrant hostupdater

$ vagrant plugin install vagrant-hostsupdater
0

Run this command on git bash:

  1. $ vagrant box list
    the following results :
    --$ vagrant box list
    --2017/07/03 00:30:19 launcher: detected 32bit Windows installation
    --ubuntu/trusty64 (virtualbox, 20170619.0.0)
    copy boxname : ubuntu/trusty64
  2. $ vagrant init ubuntu/trusty64
  3. $ vagrant up
0

downgraded your vagrant version to 1.9.2. Download to MSI file for Windows from this link. and reboot your PC. Enable virtualization in the bios setting. Then again try with vagrant up command. This will definitely work.

Rumit Patel
  • 8,830
  • 18
  • 51
  • 70
ayush didwaniya
  • 484
  • 6
  • 4
-1

Run this command on git bash:

cp /mingw64/bin/curl.exe /c/HashiCorp/Vagrant/embedded/bin/curl.exe

with me work

Apostolos
  • 10,033
  • 5
  • 24
  • 39
  • Worked pretty awesome for me. Error was default: Downloading: https://atlas.hashicorp.com/bento/boxes/centos-7.2/versions/2.2.9/providers/virtualbox.box default: An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again. – gsalgadotoledo Sep 26 '16 at 16:30