NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.58k stars 13.73k forks source link

Issues mounting `fuse.vmhgfs-fuse` fileSystem #217853

Open rhoriguchi opened 1 year ago

rhoriguchi commented 1 year ago

Describe the bug

Can't mount fuse.vmhgfs-fuse filesystem.

What's also problematic is that you need to set virtualisation.vmware.guest.enable = true or add open-vm-tools-headless to the system packages to have vmhgfs-fuse.

Steps To Reproduce

This only works in a VMware vm.

  1. Add config:
virtualisation.vmware.guest.enable = true;

fileSystems."/mnt/host" = {
  fsType = "fuse.vmhgfs-fuse";
  device = ".host:/";
  options = [
    "allow_other"
    "auto_unmount"
    "uid=1000"
    "gid=100"
    "defaults"
  ];
};
  1. Rebuild system

Expected behavior

It should mount with no issues and open-vm-tools-headless should be added to path if open-vm-tools is not available.

Additional context

Error:

Feb 23 15:05:43 nixos systemd[1]: Mounting /mnt/host...
Feb 23 15:05:43 nixos mount[9556]: /bin/sh: line 1: vmhgfs-fuse: command not found
Feb 23 15:05:43 nixos systemd[1]: mnt-host.mount: Mount process exited, code=exited, status=127/n/a
Feb 23 15:05:43 nixos systemd[1]: mnt-host.mount: Failed with result 'exit-code'.
Feb 23 15:05:43 nixos systemd[1]: Failed to mount /mnt/host.

As seen here, open-vm-tools is on the path.

> which vmhgfs-fuse | xargs realpath 
/nix/store/5i0vkz00q47wdf5hr360d9pbmwj3wy19-open-vm-tools-12.1.5/bin/vmhgfs-fuse

> vmhgfs-fuse --version
vmhgfs-fuse: version 1.6.12.0

FUSE library version 3.11.0
using FUSE kernel interface version 7.31
fusermount3 version: 3.11.0

Notify maintainers

If someone knows who to add, feel free to add them.

@pennae @figsoda @deinferno

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.94, NixOS, 23.05 (Stoat), 23.05.20230220.b69883f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.2`
 - nixpkgs: `/nix/store/4bdz2j6lry2vl44bcdaaarcap1p7qfpb-source`
deinferno commented 1 year ago

It's probably related to https://github.com/NixOS/nixpkgs/issues/46529 and earlier bug https://github.com/NixOS/nixpkgs/issues/14624