Shared Directory (VirtioFS/9p) not working in Ubuntu 24.04 LTS ARM64 VM on Apple Silicon (vportXp0 device missing/inaccessible)
Shared Directory (VirtioFS/9p) not working in Ubuntu 24.04 LTS ARM64 VM on Apple Silicon (vportXp0 device missing/inaccessible)
1. Environment:
-
Host OS: macOS Sonoma
[Your exact macOS version, e.g., 14.5] -
Mac Model: MacBook Pro/Air
[Your exact MacBook model and chip, e.g., M3 Pro] -
UTM Version:
[Your exact UTM version, e.g., 4.5.2](Please check this in UTM -> About UTM) - Guest OS: Ubuntu 24.04 LTS (Noble Numbat) Desktop ARM64
2. Description of the Issue:
I am unable to get shared directories working consistently in an Ubuntu 24.04 LTS ARM64 VM running on UTM on my Apple Silicon Mac. Despite configuring the shared directory in UTM settings (both via the wizard and manually), and verifying spice-vdagent is installed, the guest OS fails to recognize or mount the shared folder. The underlying virtual device (/dev/vportXp0) consistently reports as "No such file or directory" when attempting to mount.
3. Steps to Reproduce:
(This covers a fresh installation attempt)
- Download
ubuntu-24.04-desktop-arm664.iso. - In UTM, create a new virtual machine:
- Select "Virtualize" -> "Linux".
- Choose the downloaded
ubuntu-24.04-desktop-arm64.isoas the boot ISO. - Configure Hardware: Memory (e.g., 4096 MiB), CPU Cores (e.g., 4).
- Configure Storage: Size (e.g., 64 GiB).
-
Crucially, on the "Shared Directory" step, click "Browse..." and select a folder on the macOS host (e.g.,
~/Desktop/Ubuntu_Host_Share). - Save the VM configuration.
- Start the newly created Ubuntu VM.
- Proceed with the Ubuntu 24.04 LTS installation:
- Select "Install Ubuntu".
- Choose "Interactive installation".
- Select "Default selection" for applications.
- UNCHECK "Install third-party software for graphics and Wi-Fi hardware" (as per general UTM recommendations for VMs).
- CHECK "Download and install support for additional media formats".
- Select "Erase disk and install Ubuntu".
- Complete user setup (username
jay-rodriguezand password).
- After installation, click "Restart Now". Immediately eject the Ubuntu ISO from the virtual CD/DVD drive in UTM as the VM restarts.
- Allow the Ubuntu VM to boot fully into the installed desktop environment.
4. Expected Behavior:
- The shared directory (
Ubuntu_Host_Sharefrom macOS) should either:- Auto-mount within the Ubuntu VM, typically under
/media/or/mnt/. - Be discoverable via
ls -l /dev/virtio-ports/as a directvirtiofstag (e.g.,vm_shareorUbuntu_Host_Share). - Or, if using 9p,
ls -l /dev/virtio-ports/should showcom.redhat.spice.0 -> ../vportXp0andsudo mount -t 9p -o trans=virtio,version=9p2000.L /dev/vportXp0 /mnt/sharedshould successfully mount the shared folder.
- Auto-mount within the Ubuntu VM, typically under
5. Actual Behavior:
- The shared folder does not auto-mount.
- Running
ls -l /dev/virtio-ports/consistently shows:
(Wherelrwxrwxrwx 1 root root 11 Jul 25 HH:MM com.redhat.spice.0 -> ../vportXp0Xis a varying number like 0, 7, or 8, andHH:MMis the timestamp). This indicates UTM is attempting to use the SPICE/9p shared folder mechanism, not direct VirtioFS, despite the initial "Directory sharing" pop-up in UTM sometimes mentioning "Virtiofs drivers". - Attempting to manually mount the shared folder using the identified
9pdevice always fails:
The error received is:sudo mkdir -p /mnt/shared sudo mount -t 9p -o trans=virtio,version=9p2000.L /dev/vportXp0 /mnt/shared
This specific error is the root cause, indicating thatmount: /mnt/shared: mount(2) system call failed: No such file or directory./dev/vportXp0(the target of the symbolic link) is not being created or made accessible by the Ubuntu kernel, even though the symlink itself exists. - In the graphical file manager, attempting to navigate into
/mnt/shared(aftermkdir) resulted in an error like "Error when getting information for file: '/mnt/shared': Numerical result out of range" before the directory was cleaned and recreated. -
spice-vdagentwas confirmed to be installed and the newest version.qemu-guest-agentandvirtiofs-toolswere also attempted (thoughvirtiofs-toolswas "unable to locate").
6. Troubleshooting Attempted:
- Attempted
sudo mount -t virtiofs vm_share /mnt/shared(failed). - Attempted
sudo mount -t 9p -o trans=virtio com.redhat.spice.0 /mnt/shared(failed). - Installed
qemu-guest-agentandvirtiofs-tools(thoughvirtiofs-toolswas not found). - Confirmed
spice-vdagentwas already the newest version. - Rebooted VM multiple times after installing packages.
- Performed a complete deletion of the VM in UTM and a fresh re-installation of Ubuntu 24.04 LTS ARM64, ensuring shared directory was configured in the initial UTM wizard. The issue persisted exactly as before.
- Cleaned the
/mnt/sharedmount point (unmounted, removed, recreated) multiple times. - Confirmed
/dev/vportXp0existence usingls -l /dev/vportXp0immediately before mount attempts, which consistently resulted in "No such file or directory" despitels -l /dev/virtio-ports/showing the symlink.
7. Additional Notes:
- This issue makes the shared folder feature unusable for Ubuntu 24.04 LTS in UTM.
- I attempted to download Ubuntu 22.04 LTS ARM64 to try an older version, but the direct download links for
releases.ubuntu.comare consistently resulting in "Not Found" errors for me, preventing that test. - I am currently relying on SFTP for file transfer.
Remember to include any relevant screenshots you have (like the ones you shared with me: image_1b0a26.png, image_1b6008.jpg, and the ones showing the shared directory setup in UTM if you have them from the new install).
Same started to happen here when upgrading from Debian 12 to 13.
Failed to mount "vmshare". Error when getting information for file "/media/vmshare": Numerical result out of range.
I don't know why this is happening, but trying to access the host folder directly, either by terminal or Thunar, worked. Example: "ls /media/vmshare/SharedVM"; where vmshare is the mount point on the guest and SharedVM is the folder on the host. Previously, on Debian 12, accessing vmshare from Thunar would show the folder SharedVM and now on Debian 13 it gives the error "Failed to mount "vmshare". Error when getting information for file "/media/vmshare": Numerical result out of range."
I had this issue and was able to mount it by running:
sudo mount -t 9p -o trans=virtio,version=9p2000.L <TAG> <DIR>
in my case,
sudo mount -t 9p -o trans=virtio,version=9p2000.L share host/
A workaround for the "Numerical result out of range" error is to create and use symlinks to each shared folder:
ln -s /media/vmshare/SharedVM /media/SharedVM
This worked for me using virtiofs.
It appears that the tag in the UTM parameter is always set to „share,“ even though the actual directory in the UTM host is different.
mounting with share worked for me.