2 Years in Homestead Vagrant on Mac — Pros and Cons

Lwin Maung Maung
5 min readOct 8, 2018

--

I am using Linux for a decade since 2007 and Got a new Macbook Pro 2015 in 2016. After switching to new Mac Book Pro, I tried to install my desktop environment in my mac. I use Laravel and as you know, laravel requires higher level of PHP than other frameworks. I installed brew, install updates and mysql and I have start using My MBP with Laravel.

My MBP is start working very well until I required newly enhanced features. I am working natively on OSX and I faced a new challenge, The system monster.

The PHP and MYSQL Server is running everytime I’m working on it and it takes an amount of CPU even if I’m not using. Some people suggests me to use MAMP, XAMPP for development but I don’t like it personally. The reason is they are limited set of features and they are not very likely to fulfill my expectations.

The other thing I hate most is localhost:8000 blah blah blah. I’m using my development environment and it is feeling naughty for my development. I like example.site or example.local. I used it on Linux using VirtualHost but I don’t want to tweak my system so much.

In the searching time, another problem arises, I installed Maverick to El Capitan, They replace with new things: PHP to 7 and Oh, my command line tools are removed.

Searching for alternate solution has become priority, so I am searching all over the net, found docker but at the time it is working as virtual Machine, so, the same in two stack, I left it.

I read Laravel Docs and found Homestead. It uses Vagrant and Virtual Machine to use the development process easier. I think I should test it but two in mind, Resource and Battery Time.

Resource

Resource is one of the most valuable thing on MBP. My book is only 128 GB of Storage and the virtual machine will eat about 8 GB of Storage. As the same way, the system will take 2 GB of Ram to process so I will only left with 6 GB of Ram. It will also eat my battery life of 8 hrs. Oh My God.

Whatever, current situation gave me pressure to change to new environment, I have to search for a better thing. Whatever VirtualBox or other, I have to test. I tried to use VirtualBox than Docker on Mac Because I don’t want the container on my virtual machine on My Mac. One step skipped.

Vagrant Homestead box installation can be seen in here(laravel 5.7). I followed the instruction but the download speed of Vagrant Homestead Box is a nightmare. I’m outside of US and it is really nightmare to wait for more than 20 hrs of frequently interrupted downloads. I added Manually at last(can be seen on StackOverflow). After launching Homestead on Vagrant, it was not as bad as I thought.

The Resource is 8GB, yes, 8GB and it eats alot. File sharing is done by nfs and save and update is so fast, like local storage and updates. The display is only console and you can run headless, so very low memory usage and about 512 MB is used (or may be lesser). Dedicated space in my dev folder and running very smoothly on host with vagrant hostupdater.

Battery Life

I’m now using Homestead Vagrant for two years and the battery life impact is not huge. This can be acceptable and homestead vagrant box can run up to 7hrs runtime in my MBP.

Vagrant Manager Up Display

Pros

The vagrant went well and I started using it. I loved it and using with daily development. One thing I have noticed is the dedicated space. It is like you have dedicated rom inside your house with test laboratory and there is multiple accessories with it. You can install everything inside homestead Vagrant and use as you wish. I updated Nodejs, installed npm packages and working with multiple sites using wordpress, drupal and Laravel. They are working very well. It will not even affecting my dev.

Some libraries which require dependencies can be installed separately without touching your host machine and they are separated. The virtualbox crashed, well, reinstall it, Solved. PHP libraries are worked well with linux and my homestead virtual machine is using ubuntu, great.

Some libraries solely works with linux and you don’t have to think about will it works on mac. You have large used linux distro in your pocket. Use it safe.

The Vagrant Homestead box can be used in both Windows, Linux and Mac systems. So, if you have need to change for some os, you can continually work with vagrant, if you don’t mind long time and big files downloaded.

Cons

The storage monster is the horrible thing, it eats up to 8 GB of SSD to work with my system to display Laravel. The other thing is if you have to work with React or Vuejs or any other frontend framework. npm run watch not really work. watch-poll is working but it takes more time to refresh the system.

The other thing with drupal installed is when drupal crashed multiple times, the host system also crashes and bring your database unusable. Holy Crap.

Another thing is vagrant Manager, Vagrant and Virtual Box is not very synchronized. Virtual Box is frequently providing updates but Vagrant is not very will synchronized. That makes you really annoying and makes your vagrant box unusable. So, before you update, please make sure your updated version of virtualBox will be supported by your vagrant or your vagrant Manager.

The battery life sometimes shot and sometimes long. Mostly Long but virtual machine will eat some battery life.

Vagrant Download outside US is very slow and bottle necked, that is really horrible and manual addition is required and extra steps will arise before actually works.

Conclusion

As personally, I recommend it, based on my two year usage. If you have to work with multi functional system, you must use vagrant Homestead with Virtualization. If you don’t have no much usage on laravel or some development purpose or using bootcamp, you should use it. Dev is much simpler and freedom in Laravel Homestead Vagrant Box. I hope that you will get enough freedom with Laravel with Homestead Vagrant.

p.s. Don’t forget to install hostupdater of vagrant plugin.

--

--