With the launch of Proxmox VE 8.4, users can now create host-level shared directories, giving virtual machines (VMs) access to files from the Proxmox host without utilizing network protocols like SMB or NFS. This feature utilizes the VirtIOFS file system, which facilitates direct connections to shared directories, similar to shared folders in VMware Workstation.
Setting Up a Shared Directory
To enable shared folders, first, check that your Proxmox version is 8.4 or higher:
# pveversion -v
If your version is older, you will need to update Proxmox. Next, verify if virtiofsd is installed:
# dpkg -l | grep virtiofsd
Now you can create a shared directory on your Proxmox host:
# mkdir /mnt/VMShare
Navigate to the Proxmox web UI, go to Datacenter → Directory Mappings, and create a new directory mapping using the local directory /mnt/VMShare
.
Configuring the Virtual Machine
Next, you’ll need to add a shared VirtioFS directory to the VM settings. Open the VM’s settings → Hardware → Virtiofs and choose the local directory to pass through to the VM.
For Linux VMs, ensure the kernel version is 5.4 or higher, and verify that the VirtIOFS driver is loaded:
# lsmod | grep virtiofs
To mount the shared directory temporarily within a Linux guest VM, run:
# mount -t virtiofs VMShare /mnt/hostshare
For a permanent mount, add an entry to /etc/fstab
:
VMShare /mnt/hostshare virtiofs rw,relatime 0 0
Troubleshooting Mount Issues
If you encounter an error when mounting, such as:
mount: /mnt/hostshare: wrong fs type, bad option, bad superblock on vmshare, missing codepage or helper program, or other error.
ensure that the VM has been powered off at least once. Simply rebooting the VM is insufficient; powering it off allows the VirtioFS device to show in the hardware configuration.
Setting Up Windows Guests
For Windows VMs, install the VirtioFS Guest Tools to enable access to the shared directory. Mount the latest version of the Virtio ISO (virtio-win-0.1.271.iso or later), run the installer, and ensure the viofs drivers are installed. After installation, check that the Virtio FS service is running with these commands:
Get-Service VirtioFsDrvGet-PnpDevice | Where { $_.FriendlyName -like "*VirtioFS*" -or $_.FriendlyName -like "*Virtio FS*" }
To mount the VirtioFS directory in Windows, install the WinFSP tool, which allows user-mode file system mounting akin to FUSE on Linux. Download it from WinFSP Releases.
Restart the VirtIO-FS Service (VirtioFsSvc
) to mount the shared folder via WinFSP. The shared directory will appear as a separate network drive in the Windows guest VM.
Important Note
Keep in mind that live migration between hosts is not supported for virtual machines with a mounted Virtio shared folder. For more detailed instructions on deploying Windows guest virtual machines on Proxmox, refer to this article.