linux host os + tools linux host os + tools virtualization (vagrant+virtualbox) virtualization (vagrant+virtualbox) your os (OSX/linux) your os (OSX/linux) your laptop your laptop
stackv4 = direct_stackv4_with_default_ipv4 default_console tap0 in let conduit = conduit_direct (stackv4) in http_server conduit let main = let libraries = [ "cohttp" ] in foreign ~libraries "MyApp.Main" (http @-> console @-> job) let () = register "myapp" [ main $ httpsrv $ default_console ]
module Main (S: Cohttp_lwt.Server) (C: CONSOLE) = struct let start srv console = let callback conn_id request body = …. in srv (`TCP 8080) (S.make ~callback ()) end
[ ‘bridge=br0’ ] • Linux plumbing ◦ sudo ifup br0 ◦ sudo ifconfig br0 add 10.0.0.1 ▪ this should also set up the routes • Test it ◦ telnet 10.0.0.1 8080
◦ http://we.tl/A5mQpDnEbi ◦ Based on https://github.com/mattgray/mirage-xen-virtualbox • Example projects: ◦ https://github.com/mirage/mirage-skeleton ◦ especially ‘console’, ‘stackv4’, perhaps ‘conduit_server’ • And docs to go with them: ◦ https://mirage.io/wiki/hello-world • HTTP ◦ http://roscidus.com/blog/blog/2014/07/28/my-first-unikernel/#the-http- server