utmapp / utmapp/UTM

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

Open
#7,310 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
35.5k
Forks
1.8k
Avg merge
5d 5h
Merged PRs (30d)
7

Description

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:
```bash
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).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.