This is an example of using the DeferPanic Unikernel IaaS API.
Here we make a docker-like application to get and run unikernels locally on your mac.
-
virgo signup [email protected] username mypassword
-
./virgo pull eyberg/go
-
Sign up for a free account at https://deferpanic.com .
-
Cut/Paste your token in ~/.dprc.
-
Watch the demo video @ https://youtu.be/P8RUrx4jE5A .
-
Fork/Compile/Run a unikernel on deferpanic and then run it locally.
go get github.com/deferpanic/dpcli/dpcli
go install github.com/deferpanic/dpcli/dpcli
go install
echo "mytoken" > ~/.dprc
virgo pull html
Run command requires root privileges.
sudo virgo run html
# for headless mode use flag
sudo virgo run --headless html
Kill command also requires root privileges.
sudo virgo kill html
virgo log html
virgo images
virgo ps
virgo list
sudo virgo rm html
This works on OSX and Linux.
For OSX - this has been tested on {El Capitan, Sierra}. For bridge/outgoing connections you'll want to pay attention to this section.
Note: If you are running Sierra you really should upgrade to Go 1.7 - there are multiple issues.
It's known to work on {10.11.4, 10.11.5, 10.11.6, 10.12.
Qemu:
brew install qemu
TunTapOSx:
wget https://downloads.sourceforge.net/tuntaposx/tuntap_20150118.tar.gz
If you want to enable HAX (intel hardware acceleration) on Mac you have to options:
You can either roll your own kernel extension or you can download a dmg:
- boot into recovery mode (reboot && cmd-shift-R) and disable system integrity either of the two following methods:
csrutil enable --without kext
csrutil disable
-
git clone https://github.com/intel/haxm
-
build the kernel extension: (note: substitute the 10.13 for whatever is in sw_vers -productVersion)
xcodebuild -config Release -sdk macosx10.13
-
sudo chown -R root:wheel intelhaxm.kext
-
sudo kextutil intelhaxm.kext
- You should now be able to see that hax is working:
qemu-system-x86_64 -accel hax