Mar
12

Better network performance in Docker/Test Kitchen with Virtualbox on Mac

Posted in : virtualbox, docker, test-kitchen, and mac

If you’ve experienced really slow downloads from within VirtualBox on Mac, chances are you’re using the default NIC for your NAT interface.

I’ve seen docker’s pull taking ages when a layer size is more than a couple MB and chef installer taking more than 10mn to download the package…

Here’s how to fix it in docker-machine and test-kitchen.

For docker-machine

Check what’s your docker-machine VM’s name:

docker-machine ls

it will give you something like the following (could be different depending of your config):

NAME           ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default        -        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.5

if it’s Running, then stop it first:

docker-machine stop default

then change the NIC to use the PCnet-FAST III (Am79C973) instead of the default Intel PRO/1000 MT Desktop (82540EM):

VBoxManage modifyvm "default" --nictype1 "Am79C973"

And finally start it, it will now use the new NIC with “hopefully” improved speed:

docker-machine start default

For test-kitchen

Update your kitchen.yml or kitchen.local.yml to have your vagrant driver include the customize config below:

driver:
  name: vagrant
  customize:
    nictype1: "Am79C973"

Enjoy using all your available bandwidth!!

We're available to help your business.
If you're interested, please fill the contact form on our website.
You can also reach us via Twitter: @OpenhoodTeam
and LinkedIn: Openhood Sàrl.

blog comments powered by Disqus