For a while now I have been intending to read something on CoreOS.
CoreOS Essentials, by Rimantas Mocevicius, looked like a good place to start as it says “To use the CoreOS virtual machine, you need to have VirtualBox, Vagrant, and git installed on your computer.”
Being a huge fan of both Virtualbox and Vagrant, this worked for me… But when I tried to run the simplest of commands “vagrant up”, it didn’t actually work for me!
For completeness, let’s walk through the first steps to get a CoreOS VM up & running with Vagrant and Virtualbox.
$ git clone https://github.com/coreos/coreos-vagrant/ $ cd coreos-vagrant $ mv user-data.sample user-data $ vagrant up
What could be simpler? Only that it didn’t work! 😦
iMac-PHG:coreos-vagrant PHG$ vagrant up ==> Provider 'virtualbox' not found. We'll automatically install it now... The installation process will start below. Human interaction may be required at some points. If you're uncomfortable with automatically installing this provider, you can safely Ctrl-C this process and install it manually. ==> Downloading VirtualBox 5.0.10... This may not be the latest version of VirtualBox, but it is a version that is known to work well. Over time, we'll update the version that is installed. ==> Installing VirtualBox. This will take a few minutes... You may be asked for your administrator password during this time. If you're uncomfortable entering your password here, please install VirtualBox manually. ==> VirtualBox has successfully been installed! No usable default provider could be found for your system.
That first message immediately had me concerned, as I knew I already had a working VirtualBox install. Then, despite positive messages about VirtualBox working well, the last line became the title of this post. Something was up with Vagrant or compatibility with different versions of Vagrant and VirtualBox.
I’m not going to take up any more of your time than is necessary, after a few iterations trying to understand the problem I headed over to the Vagrant – Getting Started page.
Again, simple commands get you up and running;
$ vagrant init hashicorp/precise64 $ vagrant up
The first command worked, but “vagrant up” failed in a most unexpected way;
iMac-PHG:test PHG$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0 The box 'hashicorp/precise64' 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/precise64"] Error:
A few Google searches and it became clear the problem was with the “curl” command and I then found Vagrant box not found, in a fresh install, in a mac with an answer;
It is very common for 3rd-party software to bundle packages that they have tested to work. This case is very curious to me, as it looks like the MacOS (10.12.1) version of curl (/usr/bin/curl) works just fine but the bundled version provided by the latest version of Vagrant (1.8.7) does not.
Running the above command does indeed fix the problem:
$ sudo rm /opt/vagrant/embedded/bin/curl
iMac-PHG:test PHG$ sudo rm /opt/vagrant/embedded/bin/curl iMac-PHG:test PHG$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0 ==> default: Loading metadata for box 'hashicorp/precise64' default: URL: https://atlas.hashicorp.com/hashicorp/precise64 ==> default: Adding box 'hashicorp/precise64' (v1.1.0) for provider: virtualbox default: Downloading: https://atlas.hashicorp.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box ==> default: Successfully added box 'hashicorp/precise64' (v1.1.0) for 'virtualbox'!
This write up is intended to record my findings on this issue, and help anyone going down the same path to get to the solution quicker than I did. I certainly will look out for an update for Vagrant, to see if they address the problem. Any helpful feedback is as always most welcome! 🙂