{"id":13571957,"url":"https://github.com/mirage/mirage-skeleton","last_synced_at":"2025-05-16T05:03:54.864Z","repository":{"id":5959803,"uuid":"7181033","full_name":"mirage/mirage-skeleton","owner":"mirage","description":"Examples of simple MirageOS apps","archived":false,"fork":false,"pushed_at":"2025-03-04T17:17:01.000Z","size":877,"stargazers_count":230,"open_issues_count":6,"forks_count":97,"subscribers_count":27,"default_branch":"main","last_synced_at":"2025-05-16T05:02:16.166Z","etag":null,"topics":["examples","mirageos","ocaml","unikernel"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mirage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-12-15T15:46:48.000Z","updated_at":"2025-04-30T10:55:49.000Z","dependencies_parsed_at":"2023-01-11T17:02:03.469Z","dependency_job_id":"82f523c4-e5ff-43b4-9256-9685e01df03f","html_url":"https://github.com/mirage/mirage-skeleton","commit_stats":{"total_commits":642,"total_committers":48,"mean_commits":13.375,"dds":0.7990654205607477,"last_synced_commit":"65dd8083f9a52758d8a3c5b12b2c9ba81abc1b4c"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirage%2Fmirage-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirage%2Fmirage-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirage%2Fmirage-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mirage%2Fmirage-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mirage","download_url":"https://codeload.github.com/mirage/mirage-skeleton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471062,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["examples","mirageos","ocaml","unikernel"],"created_at":"2024-08-01T14:01:09.279Z","updated_at":"2025-05-16T05:03:54.847Z","avatar_url":"https://github.com/mirage.png","language":"OCaml","funding_links":[],"categories":["OCaml"],"sub_categories":[],"readme":"# mirage-skeleton\n\nThis repository is a collection of **tutorial code** referred to from [the Mirage\nwebsite](https://mirage.io), **example code** for using specific devices like\nfilesystems and networks, and **higher-level applications** like\nDHCP, DNS, and Web servers.\n\n* `tutorial/` contains the tutorial content.\n* `device-usage/` contains examples showing specific devices.\n* `applications/` contains the higher-level examples, which may use several\n  different devices.\n\n## Prerequisites\n\n- Install latest OPAM (at least 2.1.0), following instructions at\n\u003chttps://opam.ocaml.org/\u003e\n\n- Install the `mirage` package with OPAM, updating your package first if\nnecessary:\n\n```\n    $ opam update -u\n    $ opam install mirage\n    $ eval `opam config env`\n```\n\n- Please ensure that your Mirage command-line version is at least 4.8.0 before\nproceeding:\n\n```\n    $ mirage --version\n    4.8.0\n```\n\n## Trivial example\n\nYou can check that your build environment is working and get a feel for\nthe normal workflow by trying to compile the `noop` application.\n\n```\n    $ cd tutorials/noop\n    $ mirage configure -t unix # initial setup for UNIX backend\n    $ make depend # install dependencies\n    $ make # build the program\n    $ ./noop # run the program\n```\n\nNote that in the general case, you may need to specify more options at\nthe `mirage configure` stage. You can find out about them with\n`mirage configure --help`. For example, you may need to specify what networking\nmethod should be used, with, e.g., `--net socket` or `--net direct` at\nthe `mirage configure` stage.\n\n## Configure, Build, Run\n\nEach unikernel lives in its own directory, and can be configured, built, and run\nfrom that location.  For example:\n\n```\n    $ cd applications/static_website_tls\n    $ mirage configure -t unix # initial setup for UNIX backend\n    $ make depend # install dependencies\n    $ make # build the program\n    $ ./https # run the program\n```\n\nIf you want to clean up `mirage`'s artifacts after building, `mirage clean`\nwill do the trick:\n\n```\n    $ cd applications/static_website_tls\n    $ mirage clean\n```\n\nThere is also a top-level `Makefile` at the root of this repository with\nconvenience functions for configuring, building, and running all of the examples\nin one step.\n\n```\n    $ make all                   ## equivalent to ...\n    $ make configure build\n    $ make clean\n```\n\n### Details\n\n\nThe `Makefile` simply invokes sample-specific `sample/Makefile`. Each of those\ninvokes the `mirage` command-line tool to configure, build and run the sample,\npassing flags and environment as directed. The `mirage` command-line tool\nassumes that the [OPAM](https://opam.ocaml.org/) package manager is present and\nis used to manage installation of an OCaml dependencies.\n\nThe `mirage` command-line tool supports four commands, each of which either\nuses `config.ml` in the current directory or supports passing a `config.ml`\ndirectly.\n\n#### To configure a unikernel before building:\n\n```\n    $ mirage configure -t [hvt|virtio|qubes|macosx|unix|xen|genode|muen|spt]\n```\n\nThe boot target is selected via the `-t` flag. The default target is `unix`.\nDepending on what devices are present in `config.ml`, there may be additional\nconfiguration options for the unikernel.  To list the options,\n\n```\n    $ mirage help configure\n```\n\nand see the section labeled `UNIKERNEL PARAMETERS`.\n\n#### To install dependencies\n\nAfter running `mirage configure`:\n\n```\n    $ make depend\n```\n\nto install the list of dependencies discovered in the `mirage configure` phase.\n\n#### To build a unikernel:\n\n```\n    $ make\n```\n\nThe output will be created next to the `config.ml` file used.\n\n#### To run a unikernel:\n\nThe mechanics of running the generated artifact will be dependent on the backend\nused.  For details, see\n[solo5's readme for hvt, virtio, etc.](https://github.com/solo5/solo5),\n[the qubes-test-mirage repository's readme for Qubes](https://github.com/talex5/qubes-test-mirage), or\n[the MirageOS website instructions on booting Xen unikernels](https://mirage.io/tmpl/wiki/xen-boot).\n\nFor the `Macosx` and `Unix` backends, running as a normal process should suffice.\n\nFor summaries by backend that assume the `hello` example, see below:\n\nUnix:\n\n```\n    $ cd hello\n    $ mirage configure -t unix\n    $ make depend\n    $ make\n    $ ./hello\n```\n\nXen:\n\n```\n    $ cd hello\n    $ mirage configure -t xen\n    $ make depend\n    $ make\n    $ sudo xl create xen.xl -c\n```\n\nHvt:\n\n```\n    $ cd hello\n    $ mirage configure -t hvt\n    $ make depend\n    $ make\n    $ solo5-hvt hello.hvt\n```\n\nVirtio:\n\n```\n    $ cd hello\n    $ mirage configure -t virtio\n    $ make depend\n    $ make\n    $ solo5-virtio-run ./https.virtio\n```\n\nMacosx:\n\n```\n    $ cd hello\n    $ mirage configure -t macosx\n    $ make depend\n    $ make\n    $ ./hello\n```\n\nQubes:\n\nSome specific setup in the QubesOS manager is necessary to be able to easily run\nMirageOS unikernels -- please see [the qubes-test-mirage readme](https://github.com/talex5/qubes-test-mirage) for details.\n\n```\n    $ cd hello\n    $ mirage configure -t qubes\n    $ make depend\n    $ make\n    $ ~/test-unikernel hello.xen unikernel-test-vm\n```\n\n#### To clean up after building a unikernel:\n\n```\n    $ make clean\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirage%2Fmirage-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirage%2Fmirage-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirage%2Fmirage-skeleton/lists"}