Skip to content

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 ​

  • shares with tag, path and readOnly
  • 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 ​

NodeImageCPUs / memoryAddressesRole
webdebian-13-generic1 / 1GiBmgmt 10.106.0.11Serves ./site, writes to ./drop

Before you start ​

bash
vz image pull disk debian-13-generic

Run it ​

bash
cd examples/06-shared-folders
vz validate
vz up
vz node ls
ssh lab@10.106.0.11        # password: lab

First 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.txt

Clean up ​

bash
vz down
vz destroy --yes   # deletes the overlays and state of this lab