About a year ago I moved our team to Linux virtual machine development stack. Before that people used to work on their native windows or mac apache stack… those were truly the dark ages. Switching from apache to nginx in production seemed like the perfect catalyst to make the change.

Centos hosts and VMware WorkStation/Fusion

We now have a base Centos Linux vmware machine configured with puppet. Spinning up a whole new machine takes about 5 minutes from the base clone. We have pretty snappy host desktop machine with a dozen or so vms all built running and ready for developers to pick up. When I was first testing out this set up I was hoping to use Proxmox which has a great web based console for management. Unfortunately our office network uses dhcp addresses which Proxmox had issues with. With that consideration VMware Workstation become the next logical choice running on a Centos host. Thankfully VMware guests were able to pick up a dhcp address without an issue. I have always liked Oracle’s VirtualBox but it seems quite sluggish compared to VMware’s products.

VMware has a great command line interface for host machine called vmrun. On the main vm host machine I have a bash script to start all of the vm’s via the vmrun command:

To show all running virtual machines:

Puppet checkout and apply

Puppet allows us to get a machine up to the latest configuration very rapidly. Our manifest set up nginx, mariadb, php and the samba shares for development.

In production we run the standard puppet master setup with registered clients. For these development machines that same setup seemed to have some hiccups. One hiccup was running a puppet update on a local machine over vpn when the host machine was at home. Sometimes in that situation the master could not be found. To keep it simple I decided to go with a simple code checkout into /etc/puppet then run puppet apply manifests/dev.pp This setup also allows us to test and work on our puppet configurations at the same time.

Samba shares for development

To claim a virtual machine a developer ssh’s in and then mounts the file system with SMB. The file performance is very good over our office gigabit network and works wonderfully on Mac Linux and Windows. The samba share uses the nginx/php user account which keeps the file permissions in check. If you are working from home it is best to have a local copy of vmware and a vm. Samba works over vpn but file saves seem a little too laggy for my taste.

Sharing Virtual Machines

Co-development is pretty normal on our team. We will pair up two or more developers to work on large projects. Each developer will mount the file system via samba and work away as normal. Once they are code complete we will do a code review and the files will be committed. This has been a huge time saving and performance booster for our team. Just recently we had to build out 10 new websites over a 2 month period and these machines helped make that possible.