vamsiampolu
vamsiampolu

Reputation: 6622

Error when doing vagrant up

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

Upvotes: 15

Views: 63080

Answers (7)

ayush didwaniya
ayush didwaniya

Reputation: 514

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.

Upvotes: 0

dungna2401
dungna2401

Reputation: 11

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

Upvotes: 1

fire
fire

Reputation: 21

if you renamed the default name "base"

try it:

vagrant init "your box name"

It's work for me.

also see

Upvotes: 2

Ivaiylo Kadiyski
Ivaiylo Kadiyski

Reputation: 1

You can solve this by simply install vagrant hostupdater

$ vagrant plugin install vagrant-hostsupdater

Upvotes: 0

adilson barbosa
adilson barbosa

Reputation: 9

Run this command on git bash:

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

with me work

Upvotes: 0

Martin
Martin

Reputation: 979

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

Upvotes: 45

Tomasz Iniewicz
Tomasz Iniewicz

Reputation: 4469

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

Upvotes: 5

Related Questions