VirtioFS: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 6: | Line 6: | ||
== VM Setup == | == VM Setup == | ||
VirtioFS directories can be mounted directly in NixOS | VirtioFS directories can be mounted directly in NixOS via the standard fileSystems option. | ||
Assuming you setup a VirtioFS called VMShare in your VM manager, like [[libvirt]], you can mount it by adding the following inside your VM. | Assuming you setup a VirtioFS called VMShare in your VM manager, like [[libvirt]], you can mount it by adding the following inside your VM. | ||
Revision as of 01:01, 15 November 2025
VirtioFS is a filesystem that allows mounting host path inside a VM with minimal performance overhead.
Host Setup
In order to use VirtioFS NixOS needs virtiofsd package:
virtualisation.libvirtd.qemu.vhostUserPackages = [ pkgs.virtiofsd ];
VM Setup
VirtioFS directories can be mounted directly in NixOS via the standard fileSystems option.
Assuming you setup a VirtioFS called VMShare in your VM manager, like libvirt, you can mount it by adding the following inside your VM.
fileSystems."/mnt/VMShare" = {
device = "VMShare";
fsType = "virtiofs";
options = [
"nofail"
"x-systemd.automount"
];
};