06 Shared folders
Mac folders inside a VM with VirtioFS: one read-only website served by nginx, one read-write drop box.
What you practice
shareswithtag,pathandreadOnly- Mounting VirtioFS in the guest (
mount -t virtiofs <tag> <dir>) - Why this lab uses
debian-13-generic: its full kernel has the virtiofs driver
Topology
| Node | Image | CPUs / memory | Addresses | Role |
|---|---|---|---|---|
web | debian-13-generic | 1 / 1GiB | mgmt 10.106.0.11 | Serves ./site, writes to ./drop |
Before you start
bash
vz image pull disk debian-13-genericRun it
bash
cd examples/06-shared-folders
vz validate
vz up
vz node ls
ssh lab@10.106.0.11 # password: labFirst boot installs packages; give it a minute or two after vz up returns.
Try it
bash
curl http://localhost:8080 # serves site/index.html from this folder
echo '<h1>changed on the Mac</h1>' > site/index.html
curl http://localhost:8080 # changed without touching the VM
ssh lab@10.106.0.11 'echo hello from the VM > /srv/drop/hello.txt'
cat drop/hello.txtClean up
bash
vz down
vz destroy --yes # deletes the overlays and state of this lab