This is how we run & manage our local development environment. It runs in a VirtualBox virtual machine and Vagrant is a software like Chef but for managing it.
- install VirtualBox
- install Vagrant
- read the Vagrant documentation
- Create a Web directory on your desktop
~/Desktop/Web
- Clone the following reps into the "Web" directory
- Clone
[email protected]:Updater/rails_vagrant.git
- On the command line run the following from "Web/rails_vagrant"
vagrant up
This bootstraps a vagrant box and configures it using the vagrant
chef role.
We'll mount the "~/Desktop/Web" Host directory to "/var/www" on the dev box. All apps will run from this directory. So clone or move all your repos to this directory
The box is on a local virtual network with IP 192.168.33.11
At present we don't have any port forwarding setup.
You can use vagrant to ssh into the box
vagrant ssh
You can also SSH to it directly using the private key found in the vagrant repo directory .vagrant/machines/default/virtualbox/private_key
Mac Example:
/Users/{USER}/Desktop/Web/vagrant/.vagrant/machines/default/virtualbox/private_key
- On localhost using port 2222 (since 2222 is forwarded to 22)
- The IP of the box on the local network
192.168.33.10
To start a your local machine after it's been shutdown:
vagrant up
@windows Be sure to shutdown Pageant (upstream bug for net-ssh module net-ssh/net-ssh#92)
To update the vagrant box
- Run
vagrant provision
on the host machine inrails_vagrant
folder.
vagrant destroy
If you see the following error:
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterface, interface IHostNetworkInterface
VBoxManage: error: Context: "int handleCreate(HandlerArg*, int, int*)" at line 66 of file VBoxManageHostonly.cpp
Run sudo launchctl load /Library/LaunchDaemons/org.virtualbox.startup.plist
in your local machine
- Each box uses the same Node & Client