-2

I have Vagrant installed on my iMac but I would also like to install and run it on my MacBook. Is it possible to run the same Vagrant box across two Macs?

I have done a Vagrant up command within a shared Dropbox folder - so i'm guessing that all I need to do is install vagrant on the second mac and then navigate to the Dropbox shared folder and do vagrant up.

Would this work?

V4n1ll4
  • 5,973
  • 14
  • 53
  • 92

2 Answers2

0

Known solution:

  1. ssh to the host machine
    • user@MacBook: ssh user@imac
  2. then vagrant up; vagrant ssh.
    • user@imac: vagrant up; vagrant ssh
    • vagrant@vagrantvm:

This would be the most straight forward way I can think of.

Another option:

  • RDP to imac and run vagrant up;vagrant ssh as normal

Yet another option:

  • If your vagrant file is complete enough you should be able to vagrant up on any host to give you the same vagrant env. This relies on your use case but is how I use vagrant.
Josh_Mc
  • 31
  • 2
0

Vagrant stores the state of the machine and machine id inside the .vagrant folder. The running machine (vm) itself is handled by virtualbox/vmware or any provider your using. Lets say the virtualbox box is stored somewhere else on your system and referenced by Vagrant.

If you access the folder from two systems your basically remote controlling two different machine on two different systems. Not a good solution. Furthermore, you will run into problems if the states are different, e.g. its "up" on system one but "destroyed" on system two.

Additionally to the above solutions I propose the following:

  • Vagrant Share! Enable Vagrant http-/ssh-Share between your systems.
  • Vagrant machines should be repeatable and destroyable. Therefore, put your Vagrantfile under version control and checkout on the two systems.
  • Configure your provider to store the box itself on the dropbox.
blacklabelops
  • 4,708
  • 5
  • 25
  • 42