Why "vagrant up" gives me an error? - vagrant

I am installing the datasciencetoolbox and after entering the valgrant up I am receiving the following error:
dyn-72-33-239-166:psql mona$ mkdir MyDataScienceToolbox
dyn-72-33-239-166:psql mona$ cd MyDataScienceToolbox/
dyn-72-33-239-166:MyDataScienceToolbox mona$ vagrant init data-science-toolbox/dst
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
dyn-72-33-239-166:MyDataScienceToolbox mona$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The box 'data-science-toolbox/dst' could not be found.
dyn-72-33-239-166:MyDataScienceToolbox mona$ ls -la Vagrantfile
-rw-r--r-- 1 mona staff 4646 Aug 25 20:55 Vagrantfile
I am following this tutorial: DataScienceToolBox

Are you using an old version of Vagrant, perhaps? Here's what those commands do for me:
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'data-science-toolbox/dst' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'data-science-toolbox/dst'
default: URL: https://vagrantcloud.com/data-science-toolbox/dst
==> default: Adding box 'data-science-toolbox/dst' (v0.1.5) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/data-science-toolbox/dst/version/1/provider/virtualbox.box
==> default: Waiting for cleanup before exiting...
The fact that yours doesn't even attempt to retrieve the box from vagrantcloud suggests an old version, maybe.
You can get your version with $ vagrant version.

This box needs version 1.5+ so I updated to version 1.6 downloading from this website and now it is working
http://www.vagrantup.com/downloads.html

Related

Using Homestead with downloaded box file

I am trying to install laravel/homestead and following the steps described in https://laravel.com/docs/5.4/homestead .
In doing that I initially ran into problems while adding a box in "First Step", so I had to download the virtualbox file externally and added the box using that file:
$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.
$ vagrant box add laravel/homestead virtualbox/homestead.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'laravel/homestead' (v0) for provider:
box: Unpacking necessary files from: file://D:/Code/virtualbox/homestead.box
box:
==> box: Successfully added box 'laravel/homestead' (v0) for 'virtualbox'!
$ git clone https://github.com/laravel/homestead.git Homestead
Cloning into 'Homestead'...
...
$ cd Homestead ; git checkout v5.4.0
Note: checking out 'v5.4.0'.
$ bash init.sh
Homestead initialized!
My trouble is in doing vagrant up, it is still trying to download and failing. How can I tell vagrant not to download the box file anymore and use the existing box ?
$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Box 'laravel/homestead' could not be found. Attempting to
find and install...
homestead-7: Box Provider: virtualbox
homestead-7: Box Version: >= 2.0.0
==> homestead-7: Loading metadata for box 'laravel/homestead'
homestead-7: URL: https://atlas.hashicorp.com/laravel/homestead
==> homestead-7: Adding box 'laravel/homestead' (v2.1.0) for provider:
virtualbox
homestead-7: Downloading: https://atlas.hashicorp.com/laravel/boxes/homestead/versions/2.1.0/providers/virtualbox.box
I have tried naming my box in first step to homestead-7 , no luck yet. on subsequent executions of vagrant up, vagrant claims to resume from prior download , but the progress does not suggest so.
Here
Successfully added box 'laravel/homestead' (v0) for 'virtualbox'!
You have installed version 0 of the box laravel/homestead. In your version of homestead, it requires to have version greater than 2.0.0.
If you want to use your version of the box, you can add a version parameter in your json file.
{
"version": "0",
"ip": "192.168.10.10",
"memory": 2048,
"cpus": 1,
"provider": "virtualbox",
...
}

Is it possible to configure vagrant to use a box mirror?

I'm trying to try out Vagrant, but ...
$ vagrant init hashicorp/precise32
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise32' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'hashicorp/precise32'
default: URL: https://atlas.hashicorp.com/hashicorp/precise32
==> default: Adding box 'hashicorp/precise32' (v1.0.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/hashicorp/boxes/precise32/versions/1.0.0/providers/virtualbox.box
default: Progress: 3% (Rate: 62598/s, Estimated time remaining: 0:52:14)
62K/s is pretty much the fastest its been for multiple boxes I've tried including hashicorp/precise32, hashicorp/precise64, bento/debian-8.2 and some others.
Is there a Vagrant box mirror that I can configure vagrant to use or some other mechanism to allow for faster box downloads?
You can try wget on the URL as
wget https://atlas.hashicorp.com/hashicorp/boxes/precise32/versions/1.0.0/providers/virtualbox.box
There has been issue opened related to this without clear fix. vagrant uses curl internally but it might work better using wget instead.
once you have the box file you still need to add to vagrant (vagrant box add ...)

Could not open file error with Vagrant Up command

Would anyone know what I can do to solve this? I'm a noob with Vagrant.
Crystal:~ Adam$
Crystal:~ Adam$ 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/Adam/base
Crystal:~ Adam$
It looks like you have the same situation as described in this SO question: Error when trying vagrant up. My answer repeated here:
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 which uses a standard Ubuntu image. The Vagrant website has a Getting Started which gives some good examples.

Vagrant error: Failed to mount folders in Linux guest

I have a vagrant error. The log as follows:
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
default: /vagrant => /Users/diguage/box/centos
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
I Google it. StackOverflow had the same question:
Vagrant error : Failed to mount folders in Linux guest
I did it as the top answer: here. The different is that I downloaded the VBoxGuestAdditions_4.3.18.iso. But it did not work.
I try the second answer: here. It also did not work.
So, I have to ask the question.
My environment is :
Mac OSX 10.10
vagrant 1.6.3
CentOS release 6.5 (Final)
Kernel 2.6.32-431.29.2.el6.x86_64
VirtualBox 4.3.18
PS:
I used the box chef / centos-6.5. I first start the box, it was OK. But I sudo yum update,then sudo yum clean, restart the box, export the error.
Use Following is work fine for me.
vagrant plugin install vagrant-vbguest
I was having the same problem with the same setup, I noticed the problem is only with centos 6.5, so I am using chef/centos-6.6 and it has been working fine. There is very little difference between 6.5 and 6.6, so you shouldn't have any problems migrating your code over. Here's the link to the chef boxes.
EDIT
Ok, I ended up needing a 6.5 box, so I worked through it. The core issue is that the CentOS base repo doesn't include kernel headers(Ubuntu does). You first need to add the appropriate repos to your /etc/yum.repos.d/CentOS-Vault.repo, and you need to enable them. What you append should look something like this:
[C6.5-centosplus]
name=CentOS-6.5 - CentOSPlus
baseurl=http://vault.centos.org/6.5/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1
You also need to check the /etc/yum.conf file and make sure there aren't any exclusions such as:
exclude=kernel*
if so comment this out for the time being, but make sure to uncomment it at the end.
Now, you can install the necessary headers for the kernel. The headers depend on kernel-devel, so lets grab that up first.
yum install kernel-devel-$(uname -r)
Then, grab up the headers
yum install kernel-headers-$(uname -r)
Finally, you'll need the dkms package
yum install dkms
Go back and uncomment the exclusions in yum.conf and you should be good to reboot. With only that installed you could then use:
vagrant package --base MyBase
This will give you a reusable CentOS 6.5 box that you can grab on demand. Hope this wasn't too late for you.
I have experienced this using Vagrant 1.8.1, VirtualBox 5.0.18, Chef 12.10.10 host MacOSX El Capitan and guest CentOS7.
I tried installing kernel-devel inside the guest, installing the latest GuestAdittions and running yum update, but none of these worked for me, so I changed the mount type for "nfs" in both my custom synced folders and chef temporary folder, and it worked!
In Vagrantfile, my synced folders:
config.vm.synced_folder ".", "/vagrant", type: "nfs"
and my chef_solo config:
chef.cookbooks_path = ["chef/cookbooks/"]
chef.synced_folder_type = "nfs"

vagrant can't find existing box

i was add box with local file from https://dl.dropboxusercontent.com/s/x1085661891dhkz/lxc-centos6.5-2013-12-02.box
vagrant box add centos centos.box
vagrant init centos
my shell:
cheneytekimbp:vagrant-centos zicjin$ vagrant box list
centos (lxc, 0)
lucid32 (virtualbox, 0)
cheneytekimbp:vagrant-centos zicjin$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Adding box 'centos' (v0) for provider: virtualbox
default: Downloading: centos
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/zicjin/Work/vagrant-centos/centos
Add the local box file using the full path with the file protocol URI. For instance:
vagrant box add centos file:///Users/zicjin/Work/vagrant-centos/centos.box
(the exact location of course depends on where you've put the file)
$ vagrant box add CentOSMinimal https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box
$ vagrant init CentOSMinimal
$ vagrant up
If you're on windows, you can define the path as:
vagrant box add box_name "C:\Users\JohnDoe\blahblah\box_name.box"
Notice the .box at the end of the path.
Then you can cd into the directory if you're not already there and do vagrant up.
I've solved a similar issue upgrading Vagrant to the latest version and magically it works... :/

Resources