Sharing a folder between an Ubuntu 24.04 host and guest in virt-manager is best achieved using Virtio-FS. It is significantly faster and more reliable than the older 9p protocol. Since you are on Ubuntu 24.04 (Noble Numbat), the process is streamlined, but requires a specific standalone daemon.
Requirement: You must ensure the virtiofsd package is installed on the host and "Shared Memory" is enabled in the VM settings, or the guest will fail to boot.
Phase 1: Host Preparation
On your host machine, install the virtiofs daemon. Ubuntu 24.04 separates this into its own package unlike previous LTS releases.
# 1. Install necessary tools on the Host
sudo apt update
sudo apt install virtiofsd virt-manager libvirt-daemon-system
Open Virtual Machine Manager, shut down your guest VM, and configure the hardware:
| Setting | Action / Value |
|---|---|
| Memory | Check the box: Enable shared memory |
| Filesystem Driver | virtiofs |
| Source Path | The folder on your host (e.g., /home/user/shared) |
| Target Path | A mount tag / nickname (e.g., my_share_tag) |
Phase 2: Guest Configuration
Boot your Ubuntu 24.04 Guest and perform the following steps to mount the shared directory.
# 1. Create a Mount Point in the guest
sudo mkdir -p /mnt/host_share
# 2. Manual Mount (Testing)
# Replace 'my_share_tag' with the tag created in host settings
sudo mount -t virtiofs my_share_tag /mnt/host_share
To ensure the folder mounts automatically every time you start the VM, add an entry to /etc/fstab:
my_share_tag /mnt/host_share virtiofs defaults 0 0
Troubleshooting & Permissions
Permission Denied?
If you can see files but cannot write to them, it is usually a UID mismatch between guest and host.
Quick Fix:
chmod -R 777 /path/to/shared/folder on the host (less secure).
Better Fix: Ensure the user inside the guest has the same UID (usually 1000) as the host user.
Common Error Logs:
# libvirt Error Log
error: Failed to start domain 'ubuntu24.04'
error: internal error: cannot find virtiofsd binary
# Solution: sudo apt install virtiofsd
error: qemu exited with code 1
# Reason: Shared Memory not enabled in VM 'Memory' settings.