How to Share a Directory on Mac with QEMU/UTM Virtual Machine?

Abstract: Resolve file sharing between macOS and QEMU/UTM Linux guests by configuring a 9p filesystem for seamless directory access.

Created: 2026-09-24 by

Sharing a directory between macOS and a QEMU or UTM virtual machine is achieved by configuring a 9p filesystem. This method allows the host Mac to expose specific folders directly to the guest operating system, enabling seamless file transfer without network dependencies. The process involves modifying the VM configuration in UTM to attach the 9p share and then mounting it within the guest OS.

Understanding the 9p Filesystem Approach

The most reliable way to share files between a macOS host and a QEMU-based virtual machine (used by UTM) is via the 9p protocol. Unlike network shares that require IP configuration and firewall adjustments, the 9p filesystem operates over the virtualization layer itself. This results in lower latency and simpler setup, as it does not rely on the guest’s network stack for basic file access.

UTM provides a graphical interface to configure these settings, but understanding the underlying mechanism helps in troubleshooting. When you define a shared folder in UTM, it essentially creates a virtual device that maps a host path to a mount point inside the guest. For Linux guests, this is typically mounted using the mount -t 9p command. For Windows guests, the process is different and often requires additional drivers or SMB shares, but the 9p method is primarily designed for Unix-like systems.

Configuring the Shared Directory in UTM

To begin sharing a directory, you must first ensure your virtual machine is powered off. Changes to hardware configurations cannot be made while the VM is running. Open the UTM application on your Mac and locate the virtual machine you wish to configure. Right-click on the VM and select Edit from the context menu to open the configuration window.

Navigate to the Hardware tab in the left sidebar. Here, you will see various components like CPU, Memory, and Storage. Look for an option labeled Shared Folder or 9p Share. If this option is not immediately visible, you may need to scroll down or check if your version of UTM supports this feature natively in the UI. In many cases, you might need to manually edit the QEMU arguments if the GUI lacks direct support for 9p mounts.

  1. Select the Host Path: Click the browse button next to the shared folder field and navigate to the directory on your Mac that you want to share. Ensure this directory exists and has appropriate read/write permissions for your user account.
  2. Set the Tag: Assign a unique tag name to this share. This tag will be used later when mounting the filesystem inside the guest OS. A common convention is to use a simple name like share.
  3. Configure Access Mode: Choose whether the share should be read-only or read-write. For most development workflows, read-write access is necessary to allow changes from both the host and the guest.

If the UTM GUI does not provide a direct "Shared Folder" toggle, you can achieve the same result by editing the QEMU command line. Go to the Options tab and look for QEMU Arguments. Add the following argument, replacing /path/to/mac/folder with your actual path and share with your desired tag:

-fsdev local,id=share,path=/path/to/mac/folder,security_model=mapped-xattr \
-device virtio-9p-pci,fsdev=share,mount_tag=share

This command defines a filesystem server (fsdev) and attaches it to the PCI bus as a virtio device. The security_model=mapped-xattr option is crucial for macOS hosts to handle permission mapping correctly between the host and guest users.

Mounting the Share in the Guest OS

Once the VM configuration is saved, power on the virtual machine. Inside the guest OS, you now need to mount the shared directory. The steps vary depending on the guest operating system.

For Linux Guests

Create a mount point directory in the guest. You can do this using the terminal:

sudo mkdir -p /mnt/share

Then, mount the 9p filesystem using the tag you defined earlier. The command syntax is:

sudo mount -t 9p -o trans=virtio,version=9p2000.L share /mnt/share

If the mount fails, ensure that the 9pnet_virtio kernel module is loaded. You can check this by running lsmod | grep 9pnet. If it is not present, load it with sudo modprobe 9pnet_virtio. After successful mounting, you should be able to see and modify files in /mnt/share from both the Mac and the Linux VM.

For Windows Guests

Windows does not natively support 9p mounts in the same way Linux does. While some modern versions of Windows 10/11 have experimental 9p support, it is often more practical to use a network share (SMB) for Windows guests. However, if you must use 9p, you may need third-party drivers or enable the experimental feature in Windows. Alternatively, consider using the article on Troubleshooting Sudden Network Connectivity Interruptions in macOS UTM Guest VM to set up a stable network connection and then configure an SMB share instead.

Troubleshooting Common Issues

If the shared directory appears empty or you receive permission errors, check the security model. On macOS, the mapped-xattr security model is usually the best choice because it maps file ownership and permissions using extended attributes. If you encounter issues with file locking or performance, try changing the transport type to local instead of virtio, although virtio is generally faster.

Another common issue is that the mount disappears after a reboot. To make the mount persistent in Linux, add an entry to your /etc/fstab file:

share /mnt/share 9p trans=virtio,version=9p2000.L,_netdev 0 0

This ensures that the system automatically attempts to mount the share during boot. Remember that the guest must have network or virtio capabilities enabled for this to work. If you are experiencing broader connectivity issues, refer to Troubleshooting Virtualized macOS Windows Host Connection Issue in Ventura for related networking diagnostics.

Frequently Asked Questions

Can I share directories between two different virtual machines?

No, the 9p filesystem connects the host Mac directly to a single guest VM. To share files between two VMs, you would need to set up a network bridge or use an external storage service accessible by both guests.

Why are my files showing as root-owned in the guest?

This happens if the security model is not set correctly. Using security_model=mapped-xattr in the QEMU arguments helps map the macOS user ID to the guest user ID, preserving ownership and permissions.

Is there a performance penalty for using 9p shares?

Compared to network shares, 9p has minimal overhead. However, small file operations may be slightly slower than native disk access due to the translation layer. It is suitable for source code and documents but not ideal for high-throughput database operations.

What if I am using Parallels or VMware instead of UTM?

These hypervisors have their own proprietary sharing mechanisms (like Drag-and-Drop or shared folders). The 9p method described here is specific to QEMU-based solutions like UTM and standard QEMU setups.

How do I unmount the shared directory safely?

In Linux, use the umount /mnt/share command before shutting down the VM. Failing to unmount can lead to data corruption or locked files, especially if writes were pending in the cache.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More