Skip to content

Commit c07e1dd

Browse files
committed
doc/src/shares: update
1 parent cba60fb commit c07e1dd

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

doc/src/shares.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
11
# Shares
22

3+
Persistent file-systems are provided by both volumes and
4+
shares. Volumes are block devices inside the virtual machine, yielding
5+
fast performance but mounted file-systems require exclusive
6+
access. Shares allow mounting an arbitrary directory tree from the
7+
host.
8+
39
In `microvm.shares` elements the `proto` field allows either of two
410
values:
511

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

9-
- `virtiofs` requires a separate virtiofsd service which is only
10-
started as a prerequisite when you start MicroVMs through a systemd
11-
service that comes with the `microvm.nixosModules.host` module.
15+
- `virtiofs` requires a separate virtiofsd service which is started as
16+
a prerequisite when you start MicroVMs through a systemd service
17+
that comes with the `microvm.nixosModules.host` module.
18+
19+
If you want to run from the command-line, start `bin/virtiofsd-run`
20+
separately.
1221

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

24+
```nix
25+
microvm.shares = [ {
26+
proto = "virtiofs";
27+
tag = "home";
28+
# Source path can be absolute or relative
29+
# to /var/lib/microvms/$hostName
30+
source = "home";
31+
mountPoint = "/home";
32+
} ];
33+
```
34+
1535
<div class="warning">
1636
When sharing a path that is on ZFS with virtiofs, the dataset must
1737
have options

0 commit comments

Comments
 (0)