Mounting host file system in VMWare guest on boot

I am running NixOS as VMWare guest on Windows host. I can mount shared directory using vmhgfs-fuse on command line but when I tried to add it to configuration.nix like so

system.fsPackages = [ pkgs.open-vm-tools ];

fileSystems."/mount/here" = {
    fsType = "fuse.vmhgfs-fuse";
    device = ".host:/windows_share";
    options = [
      "allow_other"
      "auto_unmount"
      "uid=1000"
      "gid=100"
      "defaults"
    ];
  };

it failed with vmhgfs-fuse: command not found error in the log.

Sorry to necro this thread, but this is what come up in a Google search of how to mount a host windows file system in an VMWare guest, so I figure it’s best to reask here as this is where search engines are directing people to.

Is there any documentation on this anywhere?

So this works for me…

put the following in the /etc/nixos/hardware-configuration.nix

system.fsPackages = [ pkgs.open-vm-tools ];

  fileSystems."/mount/here" = {
    device = ".host:/SHARENAME";
    fsType = "fuse./run/current-system/sw/bin/vmhgfs-fuse";
    options = ["umask=22" "uid=1000" "gid=100" "allow_other" "defaults" "auto_unmount"];
  };
1 Like