• Stars
    star
    874
  • Rank 50,220 (Top 2 %)
  • Language
    Nix
  • License
    MIT License
  • Created almost 3 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

NixOS MicroVMs

MicroVM.nix

Handbook: HTML Markdown β€’ Matrix chat β€’ Changelog β€’ Support the project

Demo GIF

A Nix Flake to build NixOS and run it on one of several Type-2 Hypervisors on NixOS/Linux. The project is intended to provide a more isolated alternative to nixos-container. You can either build and run MicroVMs like Nix packages, or alternatively install them as systemd services declaratively in your host's Nix Flake or imperatively with the provided microvm command.

Project Presentation (video)

At a glance

  • MicroVMs are Virtual Machines but use special device interfaces (virtio) for high performance.
  • This project runs them on NixOS hosts.
  • You can choose one of five hypervisors for each MicroVM.
  • MicroVMs have a fixed RAM allocation (default: 512 MB) but can be shrunk using microvm-balloon
  • MicroVMs have a read-only root disk with either a prepopulated /nix/store or by mounting the host's along with an optional writable overlay. This filesystem can be built as either squashfs (smaller) or erofs (faster).
  • You define your MicroVMs in a Nix Flake's nixosConfigurations section, reusing the nixosModules that are exported by this Flake.
  • MicroVMs can access stateful filesystems either on a image volume as a block device, or alternatively as a shared directory hierarchy through 9p or virtiofs.
  • Zero, one, or more virtual tap ethernet network interfaces can be attached to a MicroVM. qemu and kvmtool also support user networking which requires no additional setup on the host.

Hypervisors

Hypervisor Language Restrictions
qemu C
cloud-hypervisor Rust no 9p shares
firecracker Rust no 9p/virtiofs shares
crosvm Rust 9p shares broken
kvmtool C no virtiofs shares, no control socket
stratovirt Rust no 9p/virtiofs shares, no control socket

Installation

nix registry add microvm github:astro/microvm.nix

(If you do not want to inflict this change on your system, just replace microvm with github:astro/microvm.nix in the following examples.)

Start writing your own NixOS MicroVM definitions

nix flake init -t microvm
$EDITOR flake.nix
nix run .#my-microvm

Examples

Run MicroVMs on your local machine

nix run microvm#qemu-example
nix run microvm#firecracker-example
nix run microvm#cloud-hypervisor-example
nix run microvm#crosvm-example
nix run microvm#kvmtool-example
nix run microvm#stratovirt-example

Run a MicroVM example with nested MicroVMs on 5 different Hypervisors

nix run microvm#vm

Check networkctl status virbr0 for the DHCP leases of the nested MicroVMs. They listen for ssh with an empty root password.

Experimental: run graphical applications in cloud-hypervisor with Wayland forwarding

nix run microvm#graphics neverball

Commercial support

Accelerate your operations and secure your infrastructure with support from the maker of microvm.nix and a team of virtualization experts. Contact Cyberus Technology: https://www.cyberus-technology.de/contact


Looking for help or customization?

Get in touch with Numtide to get a quote. We make it easy for companies to work with Open Source projects: https://numtide.com/contact

More Repositories

1

gitpop

More popular than Git*ub
JavaScript
583
star
2

deadnix

Scan Nix files for dead code
Rust
362
star
3

socksify-ruby

Redirect any TCP connection initiated by a Ruby script through a SOCKS5 proxy
Ruby
161
star
4

skyflake

NixOS Hyperconverged Infrastructure on Nomad/NixOS
Nix
132
star
5

bitford

BitTorrent Client in a Chrome Packaged App
JavaScript
97
star
6

prittorrent

BitTorrent Content Distribution for Podcasts
Erlang
92
star
7

nix-openwrt-imagebuilder

Build OpenWRT images in Nix derivations
Nix
90
star
8

buzzrelay

Source to relay.fedi.buzz: relay the streaming API of Mastodon instances
Rust
64
star
9

remcached

Ruby EventMachine memcached client
Ruby
50
star
10

erlang-collectd

Send collectd statistics from your Erlang applications
Erlang
49
star
11

node-oembed

oEmbed consumer library for node.js & tools
JavaScript
37
star
12

em-dns

tmm1's em/dns_cache for asynchronous DNS resolving from EventMachine
Ruby
35
star
13

chaosbay

BitTorrent Tracker with upload & browsing, written on the 25th Chaos Communication Congress
Erlang
34
star
14

bitlove-ui

Bitlove.org on Yesod
JavaScript
31
star
15

noattach

Instant Personal Temporary File Sharing
JavaScript
19
star
16

firetail

HTTP REST to XMPP PubSub with node.js
JavaScript
18
star
17

rexml-dropin

Drop-in replacement for REXML using libxml-ruby and libxml-parser-ruby (expat binding)
Ruby
17
star
18

harvester

Web-based feed aggregator in Ruby
Ruby
13
star
19

norrent

Norrent is going to be a BitTorrent toolkit for node.js
JavaScript
13
star
20

collectd

Some personal modifications to collectd, the kick-ass data collector
C
13
star
21

lxc-top

Bird's eye view of Linux Containers
Ruby
13
star
22

ifdyndnsd

Watch netlink for interface address updates to do DynDNS just like nsupdate does (RFC2136 + RFC2845)
Rust
12
star
23

ruby-sasl

Simple Authentication and Security Layer (RFC 4422) for Ruby
Ruby
12
star
24

irssi-xmpp

Modifications to irssi-plugin-xmpp from CVS
C
12
star
25

deadnix-action

Workflow to find and delete dead nix code
12
star
26

hashvortex

Playing with the BitTorrent DHT in Haskell
Haskell
11
star
27

libxml-ruby

Make LibXML-Ruby's SAX parser a SAX push parser
11
star
28

em-asyncns

Resolve domain names from EventMachine with libasyncns
Ruby
11
star
29

s3erl

Erlang bindings for Amazon S3 storage web service
Erlang
11
star
30

utf8cleaner

Efficiently clean your UTF8 for Ruby in C
C
11
star
31

tokio-xmpp

XMPP with Rust and Tokio [MOVED]
10
star
32

rad1o-rust

Run Rust on the rad1o embedded hardware from Chaos Communication Camp 2015
Rust
9
star
33

spacesocket

WebSocket server for Node.js not invented here
JavaScript
9
star
34

tigger

XMPP Multi-User Chat Bot
Nix
9
star
35

superhighway

Superfeedr.com-powered feed reader webapp for standalone installation
JavaScript
9
star
36

faucheuse

Feed Aggregator (Harvester rewrite in Erlang)
Erlang
8
star
37

rust-waveshare-4inch-tft-touch-shield

Embedded Rust implementation of display+touchscreen drivers for STM32F429
Rust
8
star
38

node-vnc-client

VNC client implementation in JavaScript for node.js
JavaScript
8
star
39

dat-osm-import

Import OpenStreetMap data into dat
JavaScript
7
star
40

rust-pulse-simple

Simple Pulseaudio crate for the Rust language
Rust
7
star
41

pile

Programmatically Illuminated Lightening Environment
Rust
7
star
42

b-runner

JavaScript
7
star
43

sawrocket

Portable Raw Socket API for Firefox OS & Chrome Packaged Apps
JavaScript
7
star
44

dat-elasticsearch-upload

Upload from dat into ElasticSearch
JavaScript
7
star
45

sub2text

XMPP PubSub bridge in Erlang
Erlang
7
star
46

libpulse-sys

**Outdated!** Replaced by https://github.com/jnqnfe/pulse-binding-rust
Rust
7
star
47

node-collectdout

Periodically send values out to a Collectd server for statistics
JavaScript
6
star
48

superradar

Persistent Web Feed Reader powered by Superfeedr
JavaScript
6
star
49

rust-lpc43xx

Register definitions for the NXP LPC43xx microcontroller platform, generated through svd2rust
Rust
6
star
50

feedmonster

Push Parsing XML in Ruby
Ruby
5
star
51

sigh

HTTP signatures for ActivityPub in Rust
Rust
5
star
52

ceilingled

Yet another hackerspace illumination
CoffeeScript
5
star
53

atomstreamr

Ruby interface to http://updates.sixapart.com/atom-stream.xml
4
star
54

erlxslt

Dirty little libxslt Port for Erlang
Erlang
4
star
55

nix-cache-cut

Trim Nix binary caches according to GC roots
Rust
4
star
56

bitorama

A BitTorrent gadget on node.js
JavaScript
4
star
57

channels-xep

Condensing the Buddycloud channels protocol into a single document
4
star
58

jerry

The incredibly simple Jabber MUC client to run in screens
Ruby
3
star
59

ejabberd

Clone of Proccess One's Erlang jabber implementation from SVN.
Erlang
3
star
60

rust-kenburns

Ken Burns effect slideshow with Glium in Rust
Rust
3
star
61

youtube_to_feed

Free my content for Podcast feeds!
JavaScript
3
star
62

rust-protobuf-iter

Iterate over Protobuf messages while decoding on the fly
Rust
3
star
63

rust-sgtl5000

I2S/I2C sound output driver. Does not work.
Rust
3
star
64

network-protocol-xmpp

My branch of Network.Protocol.XMPP for Haskell
Haskell
3
star
65

spacemsg

Connecting sensors with 0mq
Haskell
3
star
66

exif-annex

node.js script to put EXIF metadata into git-annex using ffmpeg's ffprobe
JavaScript
3
star
67

superfeedr.github.com

Superfeedr's Blog
2
star
68

rust-r0ket

Embedded Rust on the CCCamp2011 r0ket badge
Rust
2
star
69

mcbench

memcached benchmark
Haskell
2
star
70

sharing2

Sharing Is Caring reimplemented
Haskell
2
star
71

openarena-distro

I accidently the whole OpenArena
2
star
72

h3c

Program β€œDie Drei C” in Haskell
Haskell
2
star
73

rust-osm-pbf-iter

Parse OpenStreetMap .pbf dumps while trying to avoid copying
Rust
2
star
74

osm-poi-db

Extract POIs from OSM PBFs and put them into LevelDB, ready for nearby query
JavaScript
2
star
75

dresden-haushalt

Visuallizing Public Data
JavaScript
2
star
76

democropticon

My Open Data Playground
JavaScript
2
star
77

underpass-turbo

[WIP] OSM query engine with zero runtime dependencies
Rust
2
star
78

HTTPbis

Clone of the Haskell HTTP package
Haskell
2
star
79

rust-lpc13xx

Peripheral access API for NXP LPC13xx microcontrollers generated through svd2rust
Rust
2
star
80

lazy_bencoding

Lazy BEncoding parser that gives you iterators over byte slices
Rust
2
star
81

ruby-feed-parser-benchmark

Ever wanted to know what was the most effiscient Ruby Library to parse feed, check this benchmark.
Ruby
2
star
82

luft-heatmap

Luftdaten.info visualisiert
CSS
1
star
83

rust-hash2hwaddr

Hashes anything to a private MAC address
Rust
1
star
84

moers-haushalt

Converts some XML to CSV
JavaScript
1
star
85

prittorrent2

Next-gen Bitlove.org backend
JavaScript
1
star
86

dht22-rs

Rust implementation for reading from DHT22 1-wire humidity/temperature sensor
Rust
1
star
87

remind2ics

Remind to iCalendar converter
Haskell
1
star
88

petze

Service monitoring not invented here
CoffeeScript
1
star
89

hashimi

Hash Torrents in da Browser
JavaScript
1
star
90

strom

STream Real-time Online Media
Rust
1
star
91

srtsplit

Split SRT subtitle files with too long lines
Rust
1
star
92

podleech

Download Podcast Enclosures
Shell
1
star
93

osm-pbf-parser

streaming open street maps protocol buffer parser
JavaScript
1
star
94

t1mel1ne

Who has got the longest Github profile timeline?
1
star