Jump to content

VirtioFS: Difference between revisions

From Official NixOS Wiki
Klinger (talk | contribs)
Redirect to remove duplication of file sharing sections on the main Libvirt page
 
Line 1: Line 1:
[https://virtio-fs.gitlab.io/ VirtioFS] is a filesystem that allows mounting host path inside a VM with minimal performance overhead.
#REDIRECT [[Libvirt#File_sharing_via_virtiofs_mount]]
 
== 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"
      ];
    };
 
 
[[Category:Filesystem]]

Latest revision as of 18:01, 4 May 2026