UTM icon indicating copy to clipboard operation
UTM copied to clipboard

Shared Directory (VirtioFS/9p) not working in Ubuntu 24.04 LTS ARM64 VM on Apple Silicon (vportXp0 device missing/inaccessible)

Open JayR1031 opened this issue 5 months ago • 4 comments

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)

  1. Download ubuntu-24.04-desktop-arm664.iso.
  2. In UTM, create a new virtual machine:
    • Select "Virtualize" -> "Linux".
    • Choose the downloaded ubuntu-24.04-desktop-arm64.iso as 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.
  3. Start the newly created Ubuntu VM.
  4. 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-rodriguez and password).
  5. After installation, click "Restart Now". Immediately eject the Ubuntu ISO from the virtual CD/DVD drive in UTM as the VM restarts.
  6. Allow the Ubuntu VM to boot fully into the installed desktop environment.

4. Expected Behavior:

  • The shared directory (Ubuntu_Host_Share from macOS) should either:
    • Auto-mount within the Ubuntu VM, typically under /media/ or /mnt/.
    • Be discoverable via ls -l /dev/virtio-ports/ as a direct virtiofs tag (e.g., vm_share or Ubuntu_Host_Share).
    • Or, if using 9p, ls -l /dev/virtio-ports/ should show com.redhat.spice.0 -> ../vportXp0 and sudo mount -t 9p -o trans=virtio,version=9p2000.L /dev/vportXp0 /mnt/shared should successfully mount the shared folder.

5. Actual Behavior:

  • The shared folder does not auto-mount.
  • Running ls -l /dev/virtio-ports/ consistently shows:
    lrwxrwxrwx 1 root root 11 Jul 25 HH:MM com.redhat.spice.0 -> ../vportXp0
    
    (Where X is a varying number like 0, 7, or 8, and HH:MM is 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 9p device always fails:
    sudo mkdir -p /mnt/shared
    sudo mount -t 9p -o trans=virtio,version=9p2000.L /dev/vportXp0 /mnt/shared
    
    The error received is:
    mount: /mnt/shared: mount(2) system call failed: No such file or directory.
    
    This specific error is the root cause, indicating that /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 (after mkdir) 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-vdagent was confirmed to be installed and the newest version. qemu-guest-agent and virtiofs-tools were also attempted (though virtiofs-tools was "unable to locate").

6. Troubleshooting Attempted:

  1. Attempted sudo mount -t virtiofs vm_share /mnt/shared (failed).
  2. Attempted sudo mount -t 9p -o trans=virtio com.redhat.spice.0 /mnt/shared (failed).
  3. Installed qemu-guest-agent and virtiofs-tools (though virtiofs-tools was not found).
  4. Confirmed spice-vdagent was already the newest version.
  5. Rebooted VM multiple times after installing packages.
  6. 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.
  7. Cleaned the /mnt/shared mount point (unmounted, removed, recreated) multiple times.
  8. Confirmed /dev/vportXp0 existence using ls -l /dev/vportXp0 immediately before mount attempts, which consistently resulted in "No such file or directory" despite ls -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.com are 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).

JayR1031 avatar Jul 26 '25 03:07 JayR1031

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.

kafran avatar Oct 02 '25 16:10 kafran

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."

kafran avatar Oct 02 '25 17:10 kafran

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/

John-K avatar Nov 06 '25 00:11 John-K

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.

chsturm avatar Nov 23 '25 18:11 chsturm

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.

Horst-666 avatar Dec 16 '25 16:12 Horst-666