254

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.

qaisjp
  • 722
  • 8
  • 31
user3677022
  • 2,551
  • 2
  • 12
  • 4

26 Answers26

304

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.

jsingh
  • 1,256
  • 13
  • 24
BrianC
  • 10,591
  • 2
  • 30
  • 50
  • 20
    Gar, that was it. Why does it say "You are now ready to `vagrant up` your first virtual environment!" then?? – Matt Jun 30 '15 at 21:55
  • @Matt - Perhaps because you can manually edit the vagrantfile and set which box to use? – Cyclonecode Aug 23 '15 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. – Toby Mar 06 '16 at 01:28
  • 1
    I agree--vagrant is very handy, but the user experience is so full of pit traps that are easy to fall into. – James May 20 '16 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 Dec 23 '17 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

Antony Stubbs
  • 13,161
  • 5
  • 35
  • 39
abulbul
  • 1,159
  • 1
  • 8
  • 14
  • 7
    This fixed my issue on mac while working with local and remote boxes – DWils Nov 17 '16 at 00:13
  • 8
    why on earth does it embed *curl*? – Benjamin R Nov 19 '16 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 Nov 28 '16 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 Nov 29 '16 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 Dec 05 '16 at 04:58
96
vagrant init laravel/homestead

and then

vagrant up

Was what worked for me.

noobmaster69
  • 2,985
  • 3
  • 27
  • 44
  • 4
    Perfect ! Thank you ! If someone can explain me why this happen I'll be glad :) – Baldráni Jul 01 '15 at 09:19
  • 2
    You need to specify a valid box type. Here are some valid box types: https://atlas.hashicorp.com/boxes/search?utf8=%E2%9C%93&sort&provider=virtualbox&q=debian – duhaime Oct 28 '15 at 22:16
  • 1
    Thanks, it was driving me crazy hehe. greetings from Chile – Cristian Bustos Dec 14 '15 at 04:59
  • 2
    use --force with vagrant init if there is already a vagrantfile – Chuck Mar 30 '16 at 08: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 Jan 10 '17 at 21:56
45

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!

the
  • 21,007
  • 11
  • 68
  • 101
Muhammad Hamed
  • 1,229
  • 9
  • 19
  • The list of available boxes is [here](https://atlas.hashicorp.com/boxes/search?utf8=%E2%9C%93&sort&provider=virtualbox&q=debian) – Aleksey Potapov May 08 '15 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 Nov 11 '15 at 00: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
nasty
  • 6,797
  • 9
  • 37
  • 52
Gabriel
  • 237
  • 2
  • 7
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.

techraf
  • 64,883
  • 27
  • 193
  • 198
  • Note that the "Vagrantfile" is located in: C:\Users\YourUsername if you are using Windows. – Mooncake Dec 19 '16 at 08:04
  • That solved it for me because my box image mentioned in the .kitchen.yml wasn't available anymore. Tricky. – Horsty Mar 01 '17 at 09: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
Manoj Budha Ayer
  • 325
  • 2
  • 14
  • 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 – yardpenalty.com Jan 29 '19 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 Feb 15 '19 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
techraf
  • 64,883
  • 27
  • 193
  • 198
Steve Perry
  • 556
  • 4
  • 11
  • It helps. I am using "vagrant init", the error comes. After specified "hashicorp/precise32" everything seems OK. – yuyue007 Feb 16 '16 at 06:44
  • The step is in the official documentation but look at how many authors responding to this question don't include it. – jmdeamer May 06 '20 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:

nicholasf
  • 281
  • 2
  • 6
  • 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 Nov 14 '16 at 16:29
  • 1
    I had the same issue with Vagrant 1.8.7 on OSX. The above worked. – Janaka Nov 15 '16 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
welterw8
  • 106
  • 1
  • 7
  • 1
    Adding `config.vm.box_url = "http://files.vagrantup.com/precise64.box"` to my Vagrantfile fixed it for me. – millerdev Feb 08 '16 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.

lee
  • 7,955
  • 8
  • 44
  • 60
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

Manish Nakar
  • 4,286
  • 1
  • 18
  • 13
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

SMshrimant
  • 638
  • 9
  • 15
  • "Next, run the [vagrant up] command in your terminal and access your project at http://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 Aug 03 '20 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 ;)

Łukasz Rysiak
  • 2,898
  • 1
  • 22
  • 19
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
Marcelo Guedes
  • 1,419
  • 11
  • 10
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
juanitourquiza
  • 2,097
  • 1
  • 30
  • 52
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.

rubo77
  • 19,527
  • 31
  • 134
  • 226
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.

techraf
  • 64,883
  • 27
  • 193
  • 198
Badar
  • 1,430
  • 1
  • 15
  • 19
1

you can also just add the vm to your machine

vagrant box add precise32 http://files.vagrantup.com/precise32.box
Doron Segal
  • 2,242
  • 23
  • 22
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.

captainchhala
  • 831
  • 1
  • 7
  • 14
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/

Samir Sadek
  • 1,620
  • 1
  • 17
  • 20
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".

Asad Zaman
  • 475
  • 5
  • 10
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.

redzack
  • 1,521
  • 8
  • 20
0

try this, works to me:

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

done!

Marcelo Guedes
  • 1,419
  • 11
  • 10
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.

Malar Kandasamy
  • 839
  • 2
  • 10
  • 17