Get started easily with CoreOS on OS X

Today we are going to learn how to easily run CoreOS VM without VirtualBox/Vagrant on your Mac.

This setup is specific to OS X as it uses xhyve which is built on top of Hypervisor.framework introduced in OS X 10.10.

App uses new corectl tool to manage xhyve based VMs.

Please download latest version of CoreOS VM App from https://github.com/TheNewNormal/coreos-osx

The CoreOS VM App does not have any dependencies to download, as everything what is needed is included in it. The only few things which are going be downloaded automatically are CoreOS ISO file needed to run VM and docker and fleetctl clients for OS X

When you run App for the first time it checks that you have iTem2 installed, if not it gets installed automatically to Applications folder. You get asked the disk size you want for the VM and which CoreOS release channel to use (you can change it later too) and that's it.

All App’s files get installed under “~/coreos-osx folder”, none of your other files/folders get changed at all.

You will find a small icon with the CoreOS image in your taskbar and clicking on it you will see such menu:

There as you can see you can Start, Halt and reload the VM, ssh to it, open pre-set OS Shell:

with docker, fleet and etcd pre-set to VM’s IP and required ports:

DOCKER_HOST=tcp://192.168.64.3:2375  
FLEETCTL_ENDPOINT=http://192.168.64.3:2379  
ETCDCTL_PEERS=http://192.168.64.3:2379  

When you start VM Docker Registry v2 gets started on 192.168.64.1:5000 so you can push you docker images there and share e.g with other VMs you might be running on your Mac.

If you destroy VM (via menu) Docker registry will persist it, as it is running as OX S tool and docker images are stored directly on your Mac’s disk not in the VM.

Fleet-UI from menu will open in your default web browser the list of currently running CoreOS fleet units:

DockerUI (the web interface for docker) will show running docker containers and etc info about docker images:

From the App menu you can easily upload docker images to VM, update fleetctl and docker OS X clients after you downloaded the lastest CoreOS ISO version and etc.

You can check running VM with corectl tool:

$ corectl ps 
[corectl] found 1 running VMs, summing 2 vCPUs and 2048MB in use.
- core-01, beta/877.1.0, PID 1502 (detached=true), up 6m47.506766498s

More on corectl tool:

$ corectl -h
Usage:  
  corectl [flags]
  corectl [command]

Available Commands:  
  rm          Removes one or more CoreOS images from local fs
  kill        Halts one or more running CoreOS instances
  ls          Lists locally available CoreOS images
  load        Loads CoreOS instances defined in an instrumentation file.
  version     Shows corectl version information
  ps          Lists running CoreOS instances
  pull        Pulls a CoreOS image from upstream
  run         Starts a new CoreOS instance
  ssh         Attach to or run commands inside a running CoreOS instance
  put         copy file to inside VM

Conclusion:

We have learned how it is easily to install and use CoreOS VM on OS X without any needs of installing and using VirtualBox.