With Vagrant you’re getting a fast, easy, local and secure development platform for Windows, MacOS or Linux. Fully configured and ready to use in some minutes with all services preconfigured. Don’t waste your time with manual configuration or installation. Vagrant is the right tool for it.
I’m not using Boot2Docker because of the missing host to guest file sharing (Samba or fast VM specific sharing). Also Windows developers need their development environment and within a Busybox you can’t develop nicely. IMHO a docker container is not a real development environment and it should be customisable by each developer for their needs so is switched to Vagrant with Ubuntu base image.
VMware or Parallels also provides much faster virtualisation, network and filesystem access than VirtualBox and these solutions don’t have any critical bugs like host crashes or dropped network packages I’ve sometimes got with VirtualBox.
But if anyone want to use VirtualBox my Vagrant VM have support also for VirtualBox..
You just need one of these virtualisation solutions, for Windows you should go for VMware Workstation (Player is not supported for Vagrant) and for MacOS you should go for Parallels.
Then you also need git (or you have to download the ZIPed package) and Vagrant.
Vagrant is a terminal tool so if you want something with a graphical interface try Vagrant Manager.
Here are the steps for brining up the Vagrant VM with terminal commands:
# Clone git repository
git clone --recursive --config core.autocrlf=false https://github.com/mblaschke/vagrant-development.git devvm
# Jump into devvm directory
# Customize the vm.yml with your favorite editor
# Setup Docker environment (only linux and mac, only once)
# Start vm
# Enter VM
vagrant up can take some times – mostly 20 minutes – and will install a bunch of packages to a Ubuntu base distribution. Most of these packages are development tools.
Also the provisioning will install a mail sandbox so all emails will be redirected to an internal postfix server – even if you send them to an outside mailserver!
For Windows developers there is also a Samba share but you can also use SSH/SCP sharing.
Also a HTTP and HTTPS reverse proxy (Apache2) is setup which redirects all *.vm domains to port 8000 (Docker containers).
CliTools are also pre-installed and pre-configured.
In your home directroy there is a /home/vagrant/projects/ folder where you can put your Docker instances or projects. This folder is located on the second data disk with 60 GiB storage.
You can also use project sharing via NFS if you’re working under MacOS – your MacOS home directory is available in the VM so you can connect to Docker daemon from your MacOS and start Docker containers as in VM. NFS sharing is a little bit slower so make sure your caching files are not transfered via NFS.
If you’re an advanced Vagrant user you can also create an rsync or unison share which will be much faster but you need at least twice the disk space.
Hint: Provisioning of the VM is done with ansible and customized provisioning is planed for the next version.
If you got any success stories or some suggestions just leave a comment – thanks.