Skip to content
86% off$349 $48.86code BF2026

Docs

Hermitbox docs29 pages

Shared folder "permission denied" from Documents in a Mac VM

Getting "ls: reading directory '.': Permission denied" on a shared Mac folder in a Linux VM? Move the share out of Documents and Downloads, then mount it.

Updated 5 min read

On this page

You shared a Mac folder with a Linux VM, mounted it, and ls inside the guest prints this, even as root:

text
ls: reading directory '.': Permission denied

Newly created files may still be readable, which makes it more confusing. This page covers what is known about the error, how to move the share, how to check the mount, and what to send us if none of it helps.

Why it happens

The error comes from one report by a Multipass user (Multipass is a different VM tool, built on QEMU). Their shared ~/Documents subfolder failed to list in the guest, even as root, although newly created files could be read. They traced it to an Apple access control list (ACL) on some system folders such as ~/Documents, and moving the work folder out of Documents fixed it. A reply in the same thread said ~/Downloads is affected too.

That is a single report about another product, so it is evidence, not proof, for Hermitbox. We have not tested this for Hermitbox. Hermitbox shares folders through a virtio-fs share, and nothing in our documentation says whether ~/Documents or ~/Downloads fail the same way. Possible causes, most likely first:

CauseSymptomFix
Folder is inside ~/Documents or ~/Downloads (ACL suspected)Listing fails, even as root; new files readableShare a folder elsewhere
Share not mounted, or VM started with no shared foldersEmpty /mnt/mac or a mount errorRestart the VM, run the mount command
Shared folder was moved or deleted on the MacFolder flagged as missing in HermitboxAdd the folder again
Something elseError on a fresh folder outside DocumentsContact support (below)

Fix 1: Share a folder outside Documents and Downloads

Before you start, you need a Linux VM and a folder in your home folder that is not inside Documents or Downloads. macOS guests mount shares differently; see Share folders and the clipboard.

  1. In Finder, create a new folder in your home folder, for example Shared.
  2. Copy the files you need into it.
  3. In Hermitbox, select the VM and show the inspector with View ▸ Show/Hide Inspector (⌃⌘I), or the toolbar button.
  4. Under Shared Folders, choose Add Folder… and pick the new folder. Dropping the folder from Finder onto the list also works.
  5. Find the old ~/Documents folder in the list and choose Stop Sharing.
  6. In the guest, mount the share (Fix 2), then run ls /mnt/mac.

Each folder you add appears under /mnt/mac in Linux. If the VM started with at least one shared folder, adding or removing folders applies live. If it started with none, the change applies the next time it starts.

Fix 2: Mount the share in Linux

Quick Linux VMs ("Ready in a Minute") already have the mount line in /etc/fstab. For other Linux VMs, open Mount in Linux under Shared Folders for copyable commands. To mount now:

bash
sudo mkdir -p /mnt/mac && sudo mount -t virtiofs hermitbox /mnt/mac

This creates the mount point and mounts the share. To undo it for this session:

bash
sudo umount /mnt/mac

To mount at every start, use the "Mount at every start" command in the same disclosure. It appends this line to /etc/fstab and mounts:

text
hermitbox /mnt/mac virtiofs rw,nofail 0 0

To confirm the share is mounted, run this in the guest:

bash
mount | grep virtiofs

It only lists matching mounts. No output means the share is not mounted, so go back to the mount command and read any error it prints.

Fix 3: Check whether the folder has an ACL

To see whether a folder carries an ACL, run this in Terminal on the Mac:

bash
ls -led ~/Documents

It only reads and prints the folder's permissions. An ACL appears as numbered lines under the folder entry. Compare with your new folder:

bash
ls -led ~/Shared

If the old folder shows ACL lines and the new one does not, that fits the report. It still does not prove the ACL is the cause in Hermitbox.

Fix 4: Check the share's settings and state

  • Folder flagged as missing. Hermitbox marks shared folders that no longer exist. Add the folder again.
  • Writes fail but reads work. Check whether Read only is ticked on the folder. Use Allow Writing to switch it off, or Make Read Only to switch it on.
  • Share empty after adding it. If the VM had no shared folders when it started, restart it and mount again.
  • Several folders. Each appears as its own subfolder under /mnt/mac, so look one level down.

Checklist before you try again

  • The shared folder is not inside ~/Documents or ~/Downloads.
  • The folder appears under Shared Folders and is not flagged as missing.
  • The VM was restarted if it had no shared folders when it started.
  • The mount command ran without errors and /mnt/mac exists.
  • mount | grep virtiofs shows the share in the guest.
  • Read only is set the way you want.

If nothing works

If a new folder outside Documents and Downloads still fails, this is not the case from the report, and we have no documented cause. Contact support and include the Linux distribution and version, the path of the folder you shared, the output of mount | grep virtiofs in the guest, the output of ls -led for the folder on the Mac, and the exact error. A message you can copy:

text
Hermitbox shared folder: "ls: reading directory '.': Permission denied" in the Linux guest.
Distribution and version: (fill in)
Folder shared (path on the Mac): (fill in)
Mounted with: sudo mount -t virtiofs hermitbox /mnt/mac
Output of mount | grep virtiofs: (fill in)
Already tried: sharing a folder outside Documents/Downloads, restarting the VM.

Common questions

Does this affect Hermitbox the same way as Multipass?

Unknown. The report was about Multipass, and we haven't confirmed it for Hermitbox's virtio-fs shares. Moving the folder is cheap, so try it first.

Can I make the share read only?

Yes. Tick Read only on the folder, or use Make Read Only and Allow Writing to switch modes.

The share is empty after I add a folder. Why?

If the VM had no shared folders when it started, the change applies at the next start. Restart it, then run the mount command again.

Do macOS guests have this problem?

We have no report of it. macOS guests see shared folders in My Shared Files rather than /mnt/mac; see Share folders and the clipboard.

Related: Permissions Hermitbox asks for and Troubleshooting Hermitbox.

Every app.
One purchase.