257

I'm using Vagrant for my environment and I've got a little issue:

$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 /Users/.../base

I have initialised my project with vagrant init but for some reason vagrant up refuses to work.

1
  • 1
    The issue I had when I got this error is that I did not cd into my project directory Commented Jun 6, 2019 at 13:13

26 Answers 26

309

It looks like you may have created a Vagrant project with just vagrant init. That will create your Vagrantfile, but it won't have a box defined.

Instead, you could try

$ vagrant init hashicorp/precise32
$ vagrant up

which uses a standard Ubuntu image. The Vagrant website has a Getting Started which gives some good examples.

5
  • 20
    Gar, that was it. Why does it say "You are now ready to vagrant up your first virtual environment!" then??
    – Matt
    Commented Jun 30, 2015 at 21:55
  • @Matt - Perhaps because you can manually edit the vagrantfile and set which box to use? Commented Aug 23, 2015 at 14:02
  • 6
    If you've already done vagrant init and vagrant box add separately, you can just edit Vagrantfile and set config.vm.box to "hashicorp/precise32" or whatever box you want to use.
    – Tobi
    Commented Mar 6, 2016 at 1:28
  • 2
    I agree--vagrant is very handy, but the user experience is so full of pit traps that are easy to fall into.
    – James
    Commented May 20, 2016 at 19:40
  • Before trying anything, just run vagrant up command from the same directory where your box files are located. For example, in case of laravel homestead, run vagrant up inside from the Homestead directory.
    – ideaddict
    Commented Dec 23, 2017 at 20:33
100

If you're using OS X and used the standard install, Delete vagrant's old curl and it should now work

sudo rm /opt/vagrant/embedded/bin/curl

5
  • 7
    This fixed my issue on mac while working with local and remote boxes
    – DWils
    Commented Nov 17, 2016 at 0:13
  • 8
    why on earth does it embed curl?
    – Benjamin R
    Commented Nov 19, 2016 at 22:07
  • 3
    The -rf flag is a bit overkill here. Just sudo rm /opt/vagrant/embedded/bin/curl is enough. You should try to avoid using the -r (= recursive for travelling down directories) and the -f (= force without any questions asked) when they are not really needed. They are a powerful and dangerous tool, especially in combination with sudo...
    – Arvid
    Commented Nov 28, 2016 at 12:24
  • This worked for me using Vagrant 1.8.7 installed with brew cask install vagrant. The same box file worked fine with same Vagrant version on Ubuntu 16.04.
    – RichVel
    Commented Nov 29, 2016 at 11:46
  • You saved my couple of hours. Thanks a lot. How on earth do I know that old curl is the issue !! :/
    – Jayjitraj
    Commented Dec 5, 2016 at 4:58
97
vagrant init laravel/homestead

and then

vagrant up

Was what worked for me.

5
  • 4
    Perfect ! Thank you ! If someone can explain me why this happen I'll be glad :)
    – Baldráni
    Commented Jul 1, 2015 at 9:19
  • 2
    You need to specify a valid box type. Here are some valid box types: atlas.hashicorp.com/boxes/…
    – duhaime
    Commented Oct 28, 2015 at 22:16
  • 1
    Thanks, it was driving me crazy hehe. greetings from Chile Commented Dec 14, 2015 at 4:59
  • 2
    use --force with vagrant init if there is already a vagrantfile
    – Chuck
    Commented Mar 30, 2016 at 8:56
  • both above 2 answers fixed my problem. first remove 'curl' folder run sudo rm /opt/vagrant/embedded/bin/curl then run vagrant init laravel/homestead and then vagrant up
    – Wei Lu
    Commented Jan 10, 2017 at 21:56
46

This happened due to having a vagrant file without a defined box name. this happen when you running vagrant init with out a box name parameter.

So you have to delete the Vagrant file then

vagrant init box-title
vagrant up

I hope this could help!

2
  • The list of available boxes is here Commented May 8, 2015 at 11:04
  • this answer saved me from 3 months loop of failing to vagrant that box up, thank you ( i'm on windows 7)
    – adam
    Commented Nov 11, 2015 at 0:37
23

work to me these are the following steps:

  • cd homestead (in your directory homestead folder) OR cd Homestead
  • del vagrantfile or rm -Rf Vagrantfile
  • vagrant init laravel/homestead
  • vagrant up
0
19

Please run this in your terminal:

$ vagrant box list

You will see something like laravel/homestead(virtualbox,x.x.x)

Next locate your Vagrantfile and locate the line that says

config.vm.box = "box"

replace box with the box name when you run vagrant box list.

2
  • Note that the "Vagrantfile" is located in: C:\Users\YourUsername if you are using Windows.
    – Mooncake
    Commented Dec 19, 2016 at 8:04
  • That solved it for me because my box image mentioned in the .kitchen.yml wasn't available anymore. Tricky.
    – Horsty
    Commented Mar 1, 2017 at 9:46
18

if "Vagrantfile" already exists in this directory. Remove it before running "vagrant init". error shows then

1. rm Vagrantfile
2. vagrant init hashicorp/precise64
3. vagrant up
2
  • 1
    ==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install... This allowed for remote install which is what I preferred anyways. I am running on VirtualBox Windows Host with Ubuntu14 client Commented Jan 29, 2019 at 23:39
  • 1
    This worked for me. So the problem is that when you do vagrant init, vagrant defaults to naming your "box" in Vagrantfile to just "base"? And to make that work, you had to specify a non-default Vagrant box name?
    – Denialos
    Commented Feb 15, 2019 at 13:31
15

I know this is old, but I got exactly the same error. Turns out I was missing this step that is clearly in the documentation.

I needed to edit the Vagrantfile to set the config.vm.box equal to the image I had downloaded, hashicorp/precise32. By default it was set to base.

Here's what the documentation says:

Now that the box has been added to Vagrant, we need to configure our project to use it as a base. Open the Vagrantfile and change the contents to the following:

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise32"
end
2
  • It helps. I am using "vagrant init", the error comes. After specified "hashicorp/precise32" everything seems OK.
    – yuyue007
    Commented Feb 16, 2016 at 6:44
  • The step is in the official documentation but look at how many authors responding to this question don't include it.
    – jmdeamer
    Commented May 6, 2020 at 19:16
10

There appears to be something wrong with the embedded curl program in Vagrant. Following the advice above I just renamed it (just in case I wanted it back) and vagrant up began to work as expected.

On my mac:

♪ .vagrant.d sudo mv /opt/vagrant/embedded/bin/curl /opt/vagrant/embedded/bin/curlOLD Password:

2
  • 1
    While I'm not sure if this answers the original question it did help me. Digging into it a bit further I ran the embedded curl command and got dyld: Library not loaded: @rpath/libcurl.4.dylib Referenced from: /opt/vagrant/embedded/bin/curl_old Reason: Incompatible library version: curl_old requires version 9.0.0 or later, but libcurl.4.dylib provides version 7.0.0
    – tapi
    Commented Nov 14, 2016 at 16:29
  • 1
    I had the same issue with Vagrant 1.8.7 on OSX. The above worked.
    – Janaka
    Commented Nov 15, 2016 at 15:31
6

i experience this error too. I think it was because I failed to supply a box_url..

vagrant init precise64 http://files.vagrantup.com/precise64.box
1
  • 1
    Adding config.vm.box_url = "http://files.vagrantup.com/precise64.box" to my Vagrantfile fixed it for me.
    – millerdev
    Commented Feb 8, 2016 at 16:52
5

With me I got an error when run vagrant up is (I used Macbook pro, Mac OS: 10.12.1):

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

I tried to delete the Vagrantfile in my folder and run:

vagrant init hashicorp/precise64

then:

vagrant up

It can solved my problem. Hope this can help for someone who face the same problem.

2
  • 1
    I tried all of that several times. The only thing that worked was renaming curl. (Mac OS 10.12)
    – Vicky T
    Commented Nov 16, 2016 at 6:15
  • 1
    Worked for me too on a PC running windows 10 Commented Jan 6, 2017 at 6:43
5

I faced same issue when I ran following commands

vagrant init
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: Box file was not detected as metadata. Adding it directly...
==> 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/...../base

I corrected with

>vagrant init laravel/homestead
>Vagrant up

It worked for me.

Happy coding

5

The first and most important step before starting a Vagrant is, check which all boxes are present in your system. Use this command for getting the list of boxes available.

vagrant box list

Then move to further process that is, selecting a particular box

vagrant init ubuntu/trusty64 (I have selected ubuntu/trusty64)

then,

vagrant up

Thanks

1
  • "Next, run the [vagrant up] command in your terminal and access your project at homestead.test in your browser. Remember, you will still need to add an /etc/hosts file entry for homestead.test or the domain of your choice if you are not using automatic hostname resolution." Note: this is directly from the Laravel documentation for Homestead. It says nothing about {box-title} in that section of text, so saying passive-aggressive things like "NOTE: It would be great if you do a little bit of Google/Youtube search rather than blindly firing commands :) Thanks" is really not necessary.
    – dmcoding
    Commented Aug 3, 2020 at 16:00
4

well, actually you have to do:

vagrant up laravel/homestead

because according to homestead walkthrough you've just downloaded it: http://laravel.com/docs/5.0/homestead by:

vagrant box add laravel/homestead

so you have to launch the box you mean to use - not some random ubuntu image ;)

0
4

i've solved this problem in command line. First change directory to your vagrant file location, then init the Vagrant:

vagrant init hashicorp/bionic64

! You will need delete the old Vagrant file.

Then

vagrant up
2
  • 1
    well, you saved someone in 2021 :)
    – John D
    Commented Jun 30, 2021 at 21:24
  • 1
    :D ♥ nice John! Commented Jan 26, 2022 at 17:27
2

This work for me on Windows 10: https://stackoverflow.com/a/31594225/2400373

But it is necessary to delete the file: Vagranfile after use the command:

vagrant init precise64 http://files.vagrantup.com/precise64.box

And after

vagrant up
1

In case, you added a box and started downloading it but interrupted that download, go to ~/.vagrant.d/tmp/ and delete the partial download file, then try again.

1

I solved this problem by going to folder .vagrant.d/boxes/ under your home and changed name of the folder from laravel-VAGRANTSLASH-homestead to base. And it worked for me.

Please check if virtualization is enabled in your BIOS.

1
  • you should have run "vagrant init laravel-VAGRANTSLASH-homestead" Commented Dec 5, 2016 at 17:39
1

you can also just add the vm to your machine

vagrant box add precise32 http://files.vagrantup.com/precise32.box
0

When you do vagrant init , it replaces the vagrant file in your repo and can give you that error. So I would suggest you copy the original vagrant file from remote or a backup vagrant file and try vagrant up after that.

I came across same issue and I just copied the vagrant file from my remote repo and replaced the vagrant file I was trying to run. This synced the configurations in the vagrant file with the VM.

0

edit the vagrant file created by vagrant init in the same directory and enter the box name in the line config.vm.box = "ubuntu/trusty64" where ubuntu/trusty64 is your base box. Now vagrant up will download and set ubuntu/trusty64 as base box for you.

0

Follow the below syntax when creating the virtual box:

 $ vagrant box add {title} {url}
 $ vagrant init {title}
 $ vagrant up

See http://www.vagrantbox.es/

0

Check Homestead.yaml file carefully.Check if there is any extra space character after line ends. Then, open gitbash -> go Homestead directory -> command "vagrant up --provision".

0

Check the following entry in your Vagrantfile

Every Vagrant development environment requires a box.
You can search for boxes at https://vagrantcloud.com/search.
  config.vm.box = "base"

This is the default file setting which is created with vagrant init command. But what you need to do is do initialise vagrant environment with an OS box. For instance $vagrant init centos/7. And the Vagrantfile will look something like this:

Every Vagrant development environment requires a box.
You can search for boxes at https://vagrantcloud.com/search.
  config.vm.box = "centos/7"

This will resolve the error of not found base when doing a vagrant up.

0

try this, works to me:

  1. delete all vagrants files in the directory
  2. ~# vagrant init --template --force
  3. ~# vagrant up

done!

0

In the current directory, delete all vagrants files in the directory, then perform init and start vagrant:

mv .vagrant .vagrant_old
mv Vagrantfile Vagrantfile_old

vagrant init ubuntu/trusty64  
vagrant up  

This works.

Not the answer you're looking for? Browse other questions tagged or ask your own question.