Skip to content

Instantly share code, notes, and snippets.

@erwindev
Last active November 2, 2017 23:14
Show Gist options
  • Select an option

  • Save erwindev/5701c595176891a06c2dd85e3ddb62dc to your computer and use it in GitHub Desktop.

Select an option

Save erwindev/5701c595176891a06c2dd85e3ddb62dc to your computer and use it in GitHub Desktop.

Running Docker in your Mac without using VirtualBox

I finally got a chance to try out xhyve as a possible replacement to VirtualBox for running virtual machines. Xhyve is a hypervisor which is built on top of OSX’s Hypervisor.framework that allows users to run virtual machines in user space. It is basically what Docker for Mac uses under the hood! Now why would I want to do this as it seems more work than just using VirtualBox or Docker for Mac. First off, I am a geek and doing something like this is pretty freaking cool. Second, I wanted to compare speed and performance of using xhyve with using VirtualBox or Docker for Mac when doing software development using docker. Anyway, here are the steps that I had to go through to start using xhyve.

Install xhyve

$ brew update
$ brew install --HEAD xhyve
$ xhyve -h 

Installdocker and docker-machine

$ brew install docker docker-machine

Install docker-machine-driver-xhyve

$ brew install docker-machine-driver-xhyve

Create a VM

$ docker-machine create dev --driver xhyve
$ eval $(docker-machine env dev)
$ docker run ubuntu:16.04 /bin/echo 'Hello World!'

There you go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment