Skip to content

MirageOS unikernels used for bobkonf 2019 tutorial

Notifications You must be signed in to change notification settings

hannesm/mirageos-bobkonf2019-tutorial

Repository files navigation

MirageOS tutorial at bobkonf 2019

Build Status

In this repository are some example unikernels, used as tutorial introduction at Bobkonf 2019.

The only real prerequisite is opam >= 2.0.0. Any macOS or Linux/BSD system should be fine.

To get started, install first some OCaml tools:

$ opam version
2.0.0 (or higher)
$ opam init
$ opam update
$ opam switch create 4.07.1
..takes some time, compiles OCaml..
$ eval `opam env` # set's environment variables, need to be repeated in every new shell (.shrc is your friend)!
$ opam install merlin ocp-indent mirage utop
merlin instructions (setting up emacs, vim, etc.)
$ mirage --version
3.5.0 (at least)

Now, we're ready to get started with the first example in 00-hello! :)

$ mirage configure --help #outputs configure man page
$ mirage configure #configures the unikernel for unix
$ make depend #installs opam dependencies
$ mirage build #or make, compiles the unikernel
$ ./main.native

For the hypervisor

$ mirage configure -t hvt && make depend && mirage build
#configures the same unikernel for hvt (kvm)
#compiles the unikernel. providing solo5-hvt and hello.hvt
$ ./solo5-hvt hello.hvt #executes the unikernel as virtual machine

Command-line arguments

$ ./solo5-hvt hello.hvt -l \*:debug
$ ./solo5-hvt --net=tap0 dns_client.hvt --ipv4=10.0.42.5/24 --ipv4-gateway=10.0.42.1 -l debug
$ ./solo5-hvt --mem=16 --net=tap0 dns_client.hvt --help
$ ./solo5-hvt --mem=16 --net=tap0 dns_client.hvt --ipv4=10.0.42.5/24 --ipv4-gateway=10.0.42.1 --hostname=example.com

Releases

No releases published

Packages

No packages published