Skip to content

Instantly share code, notes, and snippets.

@ailispaw
Last active June 15, 2016 20:57
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ailispaw/7c95167b6261f1c7aa22 to your computer and use it in GitHub Desktop.
Save ailispaw/7c95167b6261f1c7aa22 to your computer and use it in GitHub Desktop.
Manage boot2docker-xhyve from the menu bar

Control boot2docker-xhyve from the menu bar

I got a contribution from @saljam at boot2docker-xhyve on GitHub as below.
Running boot2docker xhyve on boot · ailispaw/boot2docker-xhyve Wiki

It allows us to launch boot2docker-xhyve on booting Mac OS X.

In addition, I found LaunchControl that enables us to manage lanuchd and edit its configuration files with GUI.
And also it has a menu bar item which we can control launchd daemons/services from.

I'd like to share it here.

Requirements

How to do it

Step 1: Install the Requirements

$ git clone https://github.com/mist64/xhyve
$ cd xhyve
$ make
$ cp build/xhyve /usr/local/bin/ # You may need sudo.
$ git clone https://github.com/ailispaw/boot2docker-xhyve
$ cd boot2docker-xhyve
$ make
$ curl -OL http://www.soma-zone.com/download/files/LaunchControl_1.20.2.tar.bz2
$ tar jxf LaunchControl_1.20.2.tar.bz2
$ mv LaunchControl.app /Applications

Step 2: Edit boot2docker.xhyve.plist with LaunchControl

  1. Open LaunchControl.app.

  2. Select Global Daemons at the top of the left column.
    *) You may ask your password to give it the root privilege.

  3. Click + at the bottom right corner of the left column to create a new plist file for boot2docker-xhyve.

  4. Rename local.job at File column with boot2docker.xhyve or whatever you want.

  5. Rename Label at the top of middle column as well.

  6. Drag & Drop WorkingDirectory from the right column to the middle.

  7. Replace / with the directory where you've placed boot2docker-xhyve.
    ex.) /Users/ailispaw/Documents/Codes/GitHub/boot2docker-xhyve

  8. Replace /usr/bin/env at Program to run box with ./xhyverun.sh.

  9. Drag & Drop EnvironmentVariables from the right column to the middle.

  10. Replace VAR at Name column with PATH.

  11. Replace VAL at Value column with your PATH environment variable that includes the path where you've installed xhyve.
    ex.) /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

  12. Uncheck a checkbox at the next to boot2docker-xhyve at the left column as below, if you don't want to lanuch it on booting Mac OS X.

  13. and Save it.

Step 3: Make it managable from the menu bar

  1. Select and highlight boot2docker-xhyve at the left column.

  2. Select Job menu and QuickLaunch submenu at the menu bar.

  3. Check Enable QuickLaunch at Preferences of LaunchControl menu.

Done. Now you see a new menu bar item.

FAQ

Q: I chose Start submenu at the menu bar item, but nothing happened.

You may need to open LaunchControl.app and select Global Daemons again to give it the root privilege at the first time after booting Mac OS X.

Resources

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