Running rumprun for Xen in Ubuntu 16.04
Running rumprun under Xen isn’t hard, but it’s less documented than running it under KVM. This page is similar to Rumprun’s guide to building rumprun unikernels with a few Xen-specific changes.
Build the rumprun platform
Install prerequisite xen headers and build tools:
Clone their repo, cd, build:
Add binaries to PATH
You’ve now build rumprun and the binaries necessary for building, baking, running are located in rumprun/bin. You’ll want to these to your PATH variable for convenient access:
You can also add this to your ~/.bashrc to make these changes permanent.
Append the following, where [location of rumprun] represents the directory containing rumprun:
Building applications
Get some source code and use rumprun’s version of gcc to compile it. (Follow the rumprun tutorial for a more thorough explanation…)
Here, helloer.c is our source code and helloer-rumprun is the output binary.
Baking applications
I was going to make a joke here but I can’t think of anything clever right now. You need to bake it. That means running a command to add in all the kernel-y bits that makes rumprun ready for it.
Here, helloer-rumprun is the binary we just built and helloer-rumprun.bin is the the binary with the necessary rumprun pieces.
Running applications
Here’s the hard part. The rumprun command is a script that will create a Xen configuration file in /tmp and start up a Xen PV guest. For xen, it will look like this:
The -I and -W commands can be omitted if there is no need for networking. I have networking set up using a NAT, in which there exists a subnet local to the machine. Look at my article on Xen networking to see how I set up networking within rumprun.