I needed to set up a Linux virtual machine on a Windows host for working with Firefox OS. I don’t like working in slow VMs, so I did an informal test of VMWare vs. VirtualBox. I prefer to use open-source software when I can, so if VirtualBox is as fast as VMWare, or close, then I’ll just use VirtualBox.
Mozilla developers often work with VMs, and minimizing build times is a frequent topic of discussion, so I thought I’d post my results in case anyone finds them useful. If you have anything to add on the subject, please do so in the comments.
Host Software and Hardware:
- Windows 7 Professional 64-bit, all updates applied as of Sept 12, 2013
- Intel Core i7-3930K CPU @ 3.2 GHz, 6 cores
- 16gb RAM
- Ubuntu 13.04 64-bit, fully updated as of Sept 12, 2013
- Approximately the minimum number of packages installed in order to build Firefox
- VirtualBox 4.2.18
- 4 CPUs (VirtualBox does not have CPU vs. core distinction that VMWare does)
- 6002mb RAM assigned to VM
- VMWare Workstation 10, purchased
- 2 CPUs with 2 cores each, for a total of 4 cores
- 6004mb RAM assigned to VM
The test was was to create a Firefox nightly debug build (latest code as of Sept 12, 2013) with the command “time make -f client.mk”, using the “-j4″ flag for make.
VirtualBox Build Time
- real: 28m53.005s
- user: 88m32.932s
- sys: 10m6.376s
VMWare Build Time
- real: 29m31.595s
- user: 89m22.548s
- sys: 11m6.192s
Given these results, I’m just going to use VirtualBox. I’ll note, however, that graphics performance (and subsequently, UI responsiveness) in VMWare does seem to be noticeably better than VirtualBox. I don’t care, but if you do, VMWare’s advantage here is fairly noticeable even in simple interactions. VirtualBox is not bad though. Also, I didn’t test device support or too many different VM configs for the sake of tweaking performance. Take my results as a rough guide at best.
I did test VirtualBox with fewer CPUs, to test a rumor I’ve heard in the past that adding CPUs to a VM doesn’t improve performance much, or could even hurt it. That rumor seems to not be true, or is no longer true, at least with VirtualBox and my setup. Build times went from 101m, to 52m, to 28m, for 1, 2, and 4 CPUs, respectively.