Error when doing vagrant up

59,731

Solution 1

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

Solution 2

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".

Solution 3

if you renamed the default name "base"

try it:

vagrant init "your box name"

It's work for me.

also see

Share:
59,731
vamsiampolu
Author by

vamsiampolu

Updated on July 09, 2022

Comments

  • vamsiampolu
    vamsiampolu almost 2 years

    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
    
  • Optimus Prime
    Optimus Prime over 9 years
    Thanks! I was spending countless hours trying to fix this issue.
  • Badar
    Badar about 8 years
    go to .vagrant.d/boxes/ and change folder "laravel-VAGRANTSLASH-homestead" name to "base". Worked for me with this.
  • JackChance
    JackChance almost 8 years
    doesnt work for me.. Instead of looking for /my/path/to/foo it now is looking for /my/path/to/foo/foo
  • gsalgadotoledo
    gsalgadotoledo over 7 years
    Worked pretty awesome for me. Error was default: Downloading: atlas.hashicorp.com/bento/boxes/centos-7.2/versions/2.2.9/… default: An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again.
  • mercury
    mercury about 7 years
    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
  • Erikest
    Erikest almost 7 years
    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.