I also have a similar problem. I need 1.4.3 and can't update to 1.7.4. After a lot of experiments I think I found a solution. It involves some ugly hacking but it did the trick for me. I wrote a gist describing how I did it:
https://gist.github.com/arielpontes/b2d783fde85e1b3237b8
Let me know if it works for the versions you want :)
[ UPDATE ] Here's a copy/paste from the instructions in the gist:
Vagrant 1.4.3 doesn't work with newer versions of VirtualBox (>4.3). During this experiment I messed up all my installations several times, so I'm installing everything from scratch (just go to the download page, download the dmg and run the pkg installer normally).
2. Hack the Vagrant 1.4.3 installation
$ sudo mv /Applications/Vagrant /Applications/Vagrant\ 1.4.3
$ sudo ln -Fs /Applications/Vagrant\ 1.4.3/bin/vagrant /usr/bin/vagrant
* This is for legacy Vagrant versions, which are installed in /Applications/Vagrant
.
3. Install Vagrant 1.7.4
Vagrant 1.7.4 is organized differently from 1.4.3 and, when running a command that requires application data for the first time (e.g. vagrant box list
), it will update its file structure, breaking the 1.4.3 installation. To prevent this from happening, run:
$ sudo mv ~/.vagrant.d ~/.vagrant143.d
* You can run this after installing 1.7.4, just make sure you don't run any vagrant command before.
Now you're safe to install Vagrant 1.7.4. When you're done you can check if everything is ok:
$ rehash
$ vagrant -v
Vagrant 1.7.4
* If you're still getting 1.4.3, just open a new shell.
4. Hack the Vagrant 1.7.4 installation
$ sudo mv /opt/vagrant /opt/vagrant174
$ sudo ln -Fs /opt/vagrant174/bin/vagrant /usr/bin/vagrant
* This is for new Vagrant versions, which are installed in /opt/vagrant
.
5. Create shell commands to switch Vagrant
Add these lines to your ~/.bash_profile (or ~/.zshrc or whatever you use):
alias vagrant143='sudo ln -Fs /Applications/Vagrant\ 1.4.3/bin/vagrant /usr/bin/vagrant && mv ~/.vagrant.d ~/.vagrant174.d && mv ~/.vagrant143.d ~/.vagrant.d'
alias vagrant174='sudo ln -Fs /opt/vagrant174/bin/vagrant /usr/bin/vagrant && mv ~/.vagrant.d ~/.vagrant143.d && mv ~/.vagrant174.d ~/.vagrant.d'
That's it!
Now you can easily switch between versions by running vagrant143
or vagrant174
:
$ vagrant143
$ vagrant -v
Vagrant 1.4.3
$ vagrant174
$ vagrant -v
Vagrant 1.7.4
Note that your vagrant boxes will be stored separately, so if you add a box while using a version of Vagrant it won't be visible from the other version:
$ vagrant143
$ vagrant box add trusty64
$ vagrant box list
trusty64 (virtualbox)
$ vagrant174
$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.
These are all a bunch of ugly hacks and I can't promise a new Vagrant version won't break it, but for the moment it does the trick for me.
Hi Ariel, glad you found a solution. Could you perhaps post the solution (or a summary of it) here? That way all the necessary info about the problem and its solution is contained in the same page. Thanks! – bertieb – 2015-08-25T09:24:41.287
thanks Ariel! my company finally ugraded to 1.7 but I like your solution – itsjavi – 2015-09-11T15:22:31.823