WiP image viewer using MirageOS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.merlin input: adapt to basic input handling Nov 2, 2017
.ocamlinit give up on mirage, hardcode qubes Oct 28, 2017
README.md Update README.md Oct 1, 2018
command.ml add image switching using left/right arrows and space Nov 30, 2017
config.ml input: adapt to basic input handling Nov 2, 2017
unikernel.ml add image switching using left/right arrows and space Nov 30, 2017


WiP - Eye of Mirage

This aims to be a portable image viewer based on MirageOS, using mirage-framebuffer solely using pure image rendering code - (no image libraries written in C).

The goal is to be able to use the same unikernel code to

  • be able to display an image, or a a directory containing images, on Linux/FreeBSD/MacOSX.
  • implement a QRExec-based Qubes AppVM that will display images transferred to it from other VMs.

Latest screenshot

PNG rendering of rainbow.png, with text and calibration pixel (different set of pixels) overlays on Qubes (yellow window) and SDL/Linux (blue window).

Qubes and SDL targets

Current limitations / feature list

This is very much a work-in-progress, so there's a lot of things that do not work. Off the top of my head:

  • It only displays one image, and there is no way to change.
  • Pixel color blending is not implemented; all you get is shades of red.
  • Transparency is not implemented.
  • Only PNG images are supported.
  • No scaling of the image is done.
    • Configurable zoom
  • The only target supported so far is Qubes (hardcoded). -t unix now supported
    • On which receiving images via QRexec is not implemented.
    • On which images are rendered upside-down.
  • with -t unix it should be able to open a file or directory passed on the command-line instead of having to compile them in
  • instead of ocaml-crunch for compiled-in things it should probably use the ppx_literal or whatever that ppx is called.


This is a bit of a mess since it relies on a bunch of patches that have not been upstreamed yet, working on that.

opam pin add mirage --dev -k git 'https://github.com/cfcs/mirage#fix_qubes'

opam pin add mirage-xen --dev -k git \
opam pin add mirage-qubes --dev -k git \

opam pin add mirage-framebuffer --dev -k git \
opam pin add mirage-framebuffer-qubes --dev -k git \
opam pin add mirage-framebuffer-imagelib --dev -k git \

opam install lwt ocaml-crunch mirage-clock-freestanding mirage-logs \
             mirage-runtime mirage-types-lwt ocamlbuild vchan cstruct \

Setup for Qubes

  1. Compile image to an OCaml module
mkdir images/
cp image-to-display images/image.png
ocaml-crunch -m plain -o myfiles.ml images/
  1. Follow the instructions at https://github.com/talex5/qubes-test-mirage

Building and running

make clean
mirage configure -t xen && make
../qubes-test-mirage/test-mirage eye_of_mirage.xen mirage-test