Nixpkgs: open-vm-tools: Shared folders not working

Created on 11 Sep 2018  Â·  6Comments  Â·  Source: NixOS/nixpkgs

Issue description

Trying to enable shared folders in a NixOS 18.03 VM running under VMware Fusion 10.1.3 on macOS 10.12.x yields the following in /var/log/vmware-vmsvc.log:
~
[Sep 11 15:22:27.541] [ warning] [vix] ToolsDaemonTcloMountHGFS: vmhgfs-fuse -> not available
[Sep 11 15:22:27.542] [ message] [vix] ToolsDaemonTcloMountHGFS: no mount point found, create /mnt/hgfs
[Sep 11 15:22:27.543] [ warning] [vix] ToolsDaemonTcloMountHGFS: failed to find mount -> 2
[Sep 11 15:22:27.543] [ message] [vix] ToolsDaemonTcloMountHGFS: returning 20050 2
~

After creating the directory /mnt/hgfs as requested in the error message above, the problem remains:
~
[Sep 11 15:27:43.081] [ warning] [vix] ToolsDaemonTcloMountHGFS: vmhgfs-fuse -> not available
[Sep 11 15:27:43.082] [ warning] [vix] ToolsDaemonTcloMountHGFS: failed to find mount -> 2
[Sep 11 15:27:43.082] [ message] [vix] ToolsDaemonTcloMountHGFS: returning 20050 2
~

Along with the error messages in the log file mentioned above, Fusion gives an error message dialog saying "Unable to update run-time folder sharing status: There was an error mounting the Shared Folders filesystem inside the guest operating system".

Manually mounting a shared folder works, see below.

Steps to reproduce

  • Install NixOS 18.03 in a VM running under VMware Fusion 10.1.3 on macOS 10.12.x.
  • Configure relevant parts in /etc/nixos/configuration.nix, e.g.:
    ~~~

    Edit this configuration file to define what should be installed on

your system. Help is available in the configuration.nix(5) man page

and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];

# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
# boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only

# networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

# Select internationalisation properties.
# i18n = {
# consoleFont = "Lat2-Terminus16";
# consoleKeyMap = "us";
# defaultLocale = "en_US.UTF-8";
# };

# Set your time zone.
# time.timeZone = "Europe/Amsterdam";

# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
mkpasswd
vim
rxvt_unicode
firefox
];

# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.bash.enableCompletion = true;
# programs.mtr.enable = true;
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };

# List services that you want to enable:

# Enable the OpenSSH daemon.
services.openssh.enable = true;

# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;

# Enable CUPS to print documents.
# services.printing.enable = true;

# Enable sound.
# sound.enable = true;
# hardware.pulseaudio.enable = true;

# Enable the X11 windowing system.
# services.xserver.enable = true;
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";

# Enable touchpad support.
# services.xserver.libinput.enable = true;

# Enable the KDE Desktop Environment.
# services.xserver.displayManager.sddm.enable = true;
# services.xserver.desktopManager.plasma5.enable = true;

# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.rawtaz = {
isNormalUser = true;
uid = 1000;
extraGroups = ["wheel"];
};

# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "18.03"; # Did you read the comment?

services.vmwareGuest.enable = true;
services.vmwareGuest.headless = true;
services.xserver.enable = true;
services.xserver.windowManager.i3.enable = true;
services.xserver.displayManager.lightdm.enable = true;
}
~~~

  • Apply the workaround in #46527 to make the vmwareGuest service start at all.
  • Try to enable the Shared Folders feature by enabling the checkbox for it in the VM's settings.
  • Notice the error messages mentioned above.

Technical details

~~~

  • system: "x86_64-linux"
  • host os: Linux 4.14.67, NixOS, 18.03.133192.45f52f765cd (Impala)
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.0.4
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
    ~~~

Further comments and workaround

The error messages in the log above says "vmhgfs-fuse -> not available". I'm not sure if that means it doesn't find the vmhgfs-fuse binary, or if that binary is reporting an error, but either way, that binary exists and works when one try to mount a shared folder manually:
~~~

which vmhgfs-fuse

/run/current-system/sw/bin/vmhgfs-fuse

vmhgfs-fuse .host:/dotfiles /mnt/hgfs

mount


vmhgfs-fuse on /mnt/hgfs type fuse.vmhgfs-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
~~~

The manually mounted folder works fine. It's just the automatic mounting that doesn't work.

documentation

Most helpful comment

Yes, works like this in the config:

"/mnt" = {
  device = ".host:/";
  fsType = "fuse./run/current-system/sw/bin/vmhgfs-fuse";
  options = ["umask=22" "uid=1000" "gid=1000" "allow_other" "defaults" "auto_unmount"];
};

Thanks!

All 6 comments

I have the same problem.
Mounting with vmhgfs-fuse command works:
vmhgfs-fuse .host:/ /mnt

But using the mount command doesn't work (see here)

$ mount -t vmhgfs-fuse .host:/ /mnt
/bin/sh: vmhgfs-fuse: command not found

and adding it to fstab doesn't work either

$ cat /etc/fstab
.host:/ /mnt fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0
$ mount /mnt
/bin/sh: vmhgfs-fuse: command not found

I spent quite a lot of time trying to understand and debug this problem. There's multiple factors involved and after touching base with some more skilled NixOS people, I've come to realize it's not straight forward to fix this :/

Unfortunately I ran out of time so for me it's currently on ice. Copy/paste works, shared folders work to mount manually, so it's not critical (for me at least). Not sure when I will revisit, but at least we got the latest open-vm-tools into NixOS 18.09.

I also never got a reply to https://github.com/vmware/open-vm-tools/issues/199#issuecomment-423489787 which is unfortunate.

I had this same original problem so I did som digging in the open-vm-tools code and it seems that to enable shared folders and not get the Unable to update run-time folder sharing status: There was an error mounting the Shared Folders filesystem inside the guest operating system error the executables vmhgfs-fuse and fusermount need to be available in /usr/bin. I just made them symbolic links pointing to the files in /run/current-system/sw/bin/ and then it worked.

@JohnAZoidberg To get around the /bin/sh: vmhgfs-fuse: command not found problem you can specify the full path to the vmhgfs-fuse binary. So instead of:

.host:/ /mnt fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0

It needs to be:
```
.host:/ /mnt fuse./run/current-system/sw/bin/vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0

Yes, works like this in the config:

"/mnt" = {
  device = ".host:/";
  fsType = "fuse./run/current-system/sw/bin/vmhgfs-fuse";
  options = ["umask=22" "uid=1000" "gid=1000" "allow_other" "defaults" "auto_unmount"];
};

Thanks!

I have had success with /run/current-system/sw/bin/vmhgfs-fuse, but not with ${pkgs.open-vm-tools}/bin/vmhgfs-fuse, which would be my instinct. Not sure if it's because the path is too long for fuse.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lverns picture lverns  Â·  3Comments

sid-kap picture sid-kap  Â·  3Comments

matthiasbeyer picture matthiasbeyer  Â·  3Comments

langston-barrett picture langston-barrett  Â·  3Comments

ayyess picture ayyess  Â·  3Comments