vagrant, install chef/centos-6.6 - vagrant

My vagrant version is:
$ vagrant --version
Vagrant version 1.0.1
Following these instructions, vagrant init works:
$ vagrant init chef/centos-6.6
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.
But vagrant up can't find the box:
$ vagrant up
There was a problem with the configuration of Vagrant. The error message(s)
are printed below:
vm:
* The box 'chef/centos-6.6' could not be found.
What is the way to configure vagrant, or the command line option, to use chef/centos-6.6?

Chef has removed all of their boxes from atlas. They have left a comment here https://atlas.hashicorp.com/chef/ saying:
If you are looking for Bento boxes they now have their own
organization https://atlas.hashicorp.com/bento/

If you trigger a:
vagrant box add chef/centos-6.6
with the outdated source (chef) it will provide feedback leading to bento as the new source, something along the lines of:
Name: bento/centos-6.6
Provider: virtualbox
Version: 2.2.0
This eventually makes more concrete what is written on the site at the chef atlas link, that the command in your question shall now instead be:
$ vagrant init bento/centos-6.6
(replacing chef by bento)

Some time ago hashicorp moved their images to atlas. Boxes are now downloaded here:
https://atlas.hashicorp.com/boxes/search
Your box is here:
https://atlas.hashicorp.com/chef/boxes/centos-6.6
I can download the box with Vagrant 1.7.2. You are using 1.0.1.
So i think it's a version issue. You have to install a newer version.

Related

What is the url to the ubuntu/xenial64 box url for vagrant?

Where to find the url for the ubuntu/xenial64.box?
I only see version-info at https://app.vagrantup.com/ubuntu/boxes/xenial64. But what is the url for the box download?
I simply do:
$ vagrant init ubuntu/xenial64
$ vagrant up
But get:
The box 'ubuntu/xenial64' could not be found.
So I guess I need to put something in config.vm.box_url, but what?
If you keep clicking around and following the links on the Vagrant Cloud website, then eventually you find that the box is hosted at http://cloud-images.ubuntu.com
From there, you can find the latest version of the xenial box specifically hosted at:
http://cloud-images.ubuntu.com/xenial/current/
Direct link to Vagrant box: http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-vagrant.box
Sorry, was version mismatch. Newer vagrant works just fine.
I had Vagrant 1.4.x (on linux mint 17.1) and virtualbox 5. Online boxes were not found. Now I have Vagrant 1.8.1 (on linux mint 18.2) and virtualbox 5 and everything works as expected from the Vagrant manual (no url needed).
Thanks and sorry for waisting your time..
--
Oscar.

Using Vagrant to set up a VM with KVM/qemu without VirtualBox

I'm getting started Vagrant and want to use it with KVM/qemu (and the Virtual Machine Manager GUI), instead of installing VirtualBox. So I first installed Vagrant:
$ vagrant --version
Vagrant 1.9.1
$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some
As per these posts, I require vagrant-libvirt for it to work with KVM, so I installed that next:
$ vagrant plugin list
vagrant-libvirt (0.0.37)
vagrant-share (1.1.6, system)
Next, I to add a CentOS(7) box using vagrant box add "centos/7" and selected libvirt, when prompted. After which, I ran vagrant init and didn't encounter any errors:
$ vagrant init centos/7
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.
However, vagrant up seems to be erroring out, like so:
$ vagrant up
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
Here's the provider section in the Vagrantfile
config.vm.provider :libvirt do |domain|
domain.driver = "qemu"
domain.memory = 512
domain.cpus = 1
end
I tried modifying it to:
config.vm.provider :libvirt do |domain|
domain.driver = "kvm"
domain.host = 'localhost'
domain.uri = 'qemu:///system'
domain.memory = 512
domain.cpus = 1
end
I also tried vagrant up --provider=kvm, vagrant up --provider=qemu, and vagrant up --provider=libvirt too, to no avail.
Is there any step that I've missed? Or another package/dependency that needs to be installed?
Edit: After the adding centos/7 using vagrant, it shows up when running vagrant box list.
$ vagrant box list
centos/7 (libvirt, 1611.01)
Start vagrant box with command
vagrant up --provider=kvm
Although it has been said in https://seven.centos.org/2017/08/updated-centos-vagrant-images-available-v1707-01/ that
The vagrant-libvirt plugin is only compatible with Vagrant 1.5 to 1.8
You can use either the command line option --provider=kvm or you can set the VAGRANT_DEFAULT_PROVIDER environment variable:
export VAGRANT_DEFAULT_PROVIDER=kvm # <-- may be in ~/.profile, /etc/profile, or elsewhere
vagrant up
vagrant-libvirt(0.0.40) is compatible with Vagrant 2.0.2 if you are running Ruby 2.3, at least on Linux Mint 18.3 (Ubuntu 16.04). I used vagrant from the Debian download on the vagrantUp website and installed the plugin using it without any problem.

Vagrant. The box you're attempting to add doesn't support the provider you requested

I created a vagrant box using vagrant package , uploaded it and released it.
Then I did vagrant init <username>/<box> which created a Vagrantfile. I even appended the box version to the Vagrantfile.
Next I did vagrant up --provider virtualbox. This tries to get the box locally and then when it can't find it, i get the error:
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.
If you're adding a box from HashiCorp's Atlas, make sure the box is
released.
I have given virtualbox as the provider and virtual box works fine with other boxes I use.
Make sure you have virtualbox installed if you are using ubuntu.
sudo apt install virtualbox-qt
What I figured was that due to some reason vagrant had got corrupted. So doing a fresh install of vagrant did the trick.
Upgrading vagrant version through installing .deb version worked for me (download through vagrant website: https://www.vagrantup.com/downloads - choose tab "Debian" and install the package)
I suffered for 2 hours but I don't want anyone to suffer ;)
1 - access the terminal (sudo) and, remove vagrant files
$ rm -rf /opt/vagrant
$ rm -f /usr/bin/vagrant
2 - then install it again as it has probably been corrupted.
$ curl -O https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb
3 - install vagrant
$ sudo apt install ./vagrant_2.2.9_x86_64.deb
4 - confirm by viewing the installed vagrant version
& vagrant --version
be happy

Vagrant, can't download box

not sure why I'm having this issue but I can't add vagrant boxes.
Using windows 10, tried on powershell and simple command prompt. same issue. It's a relatively fresh install of windows. Maybe I'm missing some required package?
first i tried this command:
vagrant box add hashicorp/precise32
and got the error:
The box 'hashicorp/precise32' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://atlas.hashicorp.com/hashicorp/precise32"]
Error:
So I downloaded the box manually and tried this:
vagrant box add base64 file:///D:/downloads/vagrant_boxes/precise64.box
And got this error again:
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'base64' (v0) for provider:
box: Unpacking necessary files from: file:///D:/downloads/vagrant_boxes/precise64.box
box:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
The libraries on current version (as of this date) OSX don't support the version of curl bundled with Vagrant 1.8.7. I installed 1.8.6 and everything worked like a champ. To test this theory:
cd /opt/vagrant/embedded/bin
./curl --help
If you get a 'normal' reply than you should be fine or there's something else wrong.
I was using vagrant v1.8.0 when this happened. Later that day vagrant v1.8.1 was released. I didn't try that, instead I shifted back to v1.7.4 and the issue was gone.
I've been resolving this issue since I installed vagrant 1.8.1, I tried to installed lower version but i came up with the same problem. Hopefully, I solve it here:
first make sure you installed Microsoft Visual C++ 2010 SP1 Redistributable.
here is for 64bit https://www.microsoft.com/en-us/download/details.aspx?id=13523
next, download ssl version of curl in my case 64bit also. here:
https://curl.haxx.se/latest.cgi?curl=win64-ssl-sspi
now extract the curl.exe to C:\Vagrant\embedded\bin. please see your installation directory.
and then done. if your not using ssl try the no-ssl version of curl. hope helps
Check the C: \ HashiCorp \ Vagrant \ embedded \ bin \ curl.exe
case give an error, there is your problem.
To solve, just download gitbash, console2, cmder, etc ... you have curl installed, or try http://www.confusedbycode.com/curl/.
however strongly recommend gitbash or cmder
https://atlas.hashicorp.com/hashicorp/boxes/precise32
base on the offical URL.. there is only virutal box provider.
try below command:
vagrant init hashicorp/precise32; vagrant up --provider virtualbox
For MacOS users whom reinstalling new version of vagrant doesn't help:
sudo mv /opt/vagrant/embedded/lib/libiconv.2.dylib /opt/vagrant/embedded/lib/libiconv.2.dylib_
brew install libiconv
brew link --force libiconv
credits to: https://github.com/mitchellh/vagrant/issues/5782
You don`t need to add the box. Init instead of this:
vagrant init hashicorp/precise32
vagrant up
vagrant ssh
Hope it will be added in boxes list automatically.
If you want to set up local box - add it getting few steps:
D:
cd downloads/vagrant_boxes
vagrant box add base64 precise64.box
vagrant up
vagrant ssh

"Command not invoked properly" Setting up laravel homestead with Vagrant

I am trying to set up a a vagrant laravel homestead box. I have both vagrant and virtualbox installed on my Xubuntu 14.04 machine. To do this I'm running the following command
user#home: $ vagrant box add laravel/homestead
Then I get the following error
This command was not invoked properly. The help for this command is
available below.
Usage: vagrant box add <name> <url> [--provider provider] [-h]
I'm doing this exactly how the laravel and vagrant documentation shows. Why is this not working? Do I need a url?
Your syntax is correct for versions 1.5+.
If you older Vagrant you need go to https://vagrantcloud.com/<BOX_NAME>/versions and copy the full link to the latest active version of you box. (<BOX_NAME> in your case is laravel/homestead)
Then you can download like this:
vagrant box add 'laravel/homestead' https://vagrantcloud.com/laravel/homestead/version/9/provider/virtualbox.box --provider virtualbox
However I strongly advice to update your Vagrant for the latest one.

Resources