Skip to content

Commit

Permalink
doc/src/shares: update
Browse files Browse the repository at this point in the history
  • Loading branch information
astro committed Dec 3, 2024
1 parent cba60fb commit c07e1dd
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions doc/src/shares.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
# Shares

Persistent file-systems are provided by both volumes and
shares. Volumes are block devices inside the virtual machine, yielding
fast performance but mounted file-systems require exclusive
access. Shares allow mounting an arbitrary directory tree from the
host.

In `microvm.shares` elements the `proto` field allows either of two
values:

- `9p` (default) is built into many hypervisors, allowing you to
quickly share a directory tree

- `virtiofs` requires a separate virtiofsd service which is only
started as a prerequisite when you start MicroVMs through a systemd
service that comes with the `microvm.nixosModules.host` module.
- `virtiofs` requires a separate virtiofsd service which is started as
a prerequisite when you start MicroVMs through a systemd service
that comes with the `microvm.nixosModules.host` module.

If you want to run from the command-line, start `bin/virtiofsd-run`
separately.

Expect `virtiofs` to yield better performance over `9p`.

```nix
microvm.shares = [ {
proto = "virtiofs";
tag = "home";
# Source path can be absolute or relative
# to /var/lib/microvms/$hostName
source = "home";
mountPoint = "/home";
} ];
```

<div class="warning">
When sharing a path that is on ZFS with virtiofs, the dataset must
have options
Expand Down

0 comments on commit c07e1dd

Please sign in to comment.