12 Replies Latest reply: Nov 5, 2014 10:56 AM by plumeria RSS

    Problem compiling vmhgfs module

    windows7vmwareplayer Novice
      I have installed Debiat Testing in VMware Player on 64 bit Win 7 Laptop.
      All went well until I ran vmware-install.pl. Unfortunately I got an 
      All went well until I ran vmware-install.pl. Unfortunately I got an 
      error message during the execution of the installer:
      Script started on Mon 27 Jan 2014 07:32:55 AM EST
      ]0;computation@inga: ~/Downloads/vmware-tools-distrib computation@inga:~/Downloads/vmware-tools-distrib$ sudo ./vmware-install.pl
      [sudo] password for computation:
      Sorry, try again.
      [sudo] password for computation:
      A previous installation of VMware Tools has been detected.

      The previous installation was made by the tar installer (version 4).

      Keeping the tar4 installer database format.

      You have a version of VMware Tools installed.  Continuing this install will
      first uninstall the currently installed version.  Do you wish to continue?
      (yes/no) [yes]

      Uninstalling the tar installation of VMware Tools.

      Stopping services for VMware Tools

      Stopping VMware Tools services in the virtual machine:
         Guest operating system daemon:
      [71G done
         VMware User Agent (vmware-user): [71G done
         Blocking file system: [71G done
         Unmounting HGFS shares: [71G done
         Guest filesystem driver: [71G done

      Stopping Thinprint services in the virtual machine:
         Stopping Virtual Printing daemon: [71G done

      This program previously created the file /etc/rc0.d/K43vmware-tools-thinprint,
      and was about to remove it.  Somebody else apparently did it already.

      This program previously created the file /etc/rc5.d/K43vmware-tools-thinprint,
      and was about to remove it.  Somebody else apparently did it already.

      This program previously created the file /etc/rc3.d/K43vmware-tools-thinprint,
      and was about to remove it.  Somebody else apparently did it already.

      This program previously created the file /etc/rc6.d/K43vmware-tools-thinprint,
      and was about to remove it.  Somebody else apparently did it already.

      This program previously created the file /etc/rc2.d/K43vmware-tools-thinprint,
      and was about to remove it.  Somebody else apparently did it already.

      File /etc/pulse/default.pa is backed up to /etc/pulse/default.pa.old.2.

      update-initramfs: Generating /boot/initrd.img-3.12-1-amd64
      Warning: LBA32 addressing assumed
      Added Linux  *
      Added LinuxOLD
      One warning was issued.
      update-initramfs: Generating /boot/initrd.img-3.11-2-amd64
      Warning: LBA32 addressing assumed
      Added Linux  *
      Added LinuxOLD
      One warning was issued.
      The removal of VMware Tools 9.6.0 build-1294478 for Linux completed
      successfully.

      Installing VMware Tools.

      In which directory do you want to install the binary files?
      [/usr/bin]
      What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
      [/etc]

      What is the directory that contains the init scripts?
      [/etc/init.d]

      In which directory do you want to install the daemon files?
      [/usr/sbin]
      In which directory do you want to install the library files?
      [/usr/lib/vmware-tools]

      The path "/usr/lib/vmware-tools" does not exist currently. This program is
      going to create it, including needed parent directories. Is this what you want?
      [yes]


      In which directory do you want to install the documentation files?
      [/usr/share/doc/vmware-tools]

      The path "/usr/share/doc/vmware-tools" does not exist currently. This program
      is going to create it, including needed parent directories. Is this what you
      want? [yes]

      The installation of VMware Tools 9.6.0 build-1294478 for Linux completed
      successfully. You can decide to remove this software from your system at any
      time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

      Before running VMware Tools for the first time, you need to configure it by
      invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
      this program to invoke the command for you now? [yes]

      Initializing...

      Use of uninitialized value $subLevel in split at /usr/bin/vmware-config-tools.pl line 4299.
      Use of uninitialized value $subLevel in concatenation (.) or string at /usr/bin/vmware-config-tools.pl line 4300.
      Argument "12-1-amd64" isn't numeric in multiplication (*) at /usr/bin/vmware-config-tools.pl line 3892.
      Use of uninitialized value $subLevel in addition

       

       at /usr/bin/vmware-config-tools.pl line 3892.

      Making sure services for VMware Tools are stopped.

      Stopping Thinprint services in the virtual machine:
         Stopping Virtual Printing daemon: [71G done
      Stopping VMware Tools services in the virtual machine:
         Guest operating system daemon: [71G done
         VMware User Agent (vmware-user): [71G done
         Blocking file system: [71G done
         Unmounting HGFS shares: [71G done
         Guest filesystem driver: [71G done


      update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
      insserv: Service cups has to be enabled to start service vmware-tools-thinprint
      insserv: exiting now!
      update-rc.d: error: insserv rejected the script header
      WARNING: The installer initially used the 'udpate-rc.d' to setup the
      vmware-tools service.  That command cannot be found.  Please re-install the
      'sysv-rc' package.  This script will now attempt to manually setup the
      vmware-tools service.The module vmci has already been installed on this system by another installer
      or package and will not be modified by this installer.

      The module vsock has already been installed on this system by another installer
      or package and will not be modified by this installer.

      The module vmxnet3 has already been installed on this system by another
      installer or package and will not be modified by this installer.

      The module pvscsi has already been installed on this system by another
      installer or package and will not be modified by this installer.

      The module vmmemctl has already been installed on this system by another
      installer or package and will not be modified by this installer.

      The VMware Host-Guest Filesystem allows for shared folders between the host OS
      and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
      to enable this feature? [yes]


      Before you can compile modules, you need to have the following installed...

      make
      gcc
      kernel headers of the running kernel


      Searching for GCC...
      Detected GCC binary at "/usr/bin/gcc".
      The path "/usr/bin/gcc" appears to be a valid path to the gcc binary.
      Would you like to change it? [no]

      Searching for a valid kernel header path...
      Detected the kernel headers at "/lib/modules/3.12-1-amd64/build/include".
      The path "/lib/modules/3.12-1-amd64/build/include" appears to be a valid path
      to the 3.12-1-amd64 kernel headers.
      Would you like to change it? [no]

      Using 2.6.x kernel build system.
      make: Entering directory `/tmp/modconfig-4Zp2gh/vmhgfs-only'
      /usr/bin/make -C /lib/modules/3.12-1-amd64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
             MODULEBUILDDIR= modules
      make[1]: Entering directory `/usr/src/linux-headers-3.12-1-amd64'
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/backdoor.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/backdoorGcc64.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/bdhandler.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/cpName.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/cpNameLinux.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/cpNameLite.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/dentry.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/dir.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/file.o
        CC [M]  /tmp/modconfig-4Zp2gh/vmhgfs-only/filesystem.o
      /tmp/modconfig-4Zp2gh/vmhgfs-only/file.c: In function ‘HgfsOpen’:
      /tmp/modconfig-4Zp2gh/vmhgfs-only/file.c:659:27: error: incompatible type for argument 3 of ‘HgfsSetUidGid’
                                 current_fsuid(), current_fsgid());
                                 ^
      In file included from /tmp/modconfig-4Zp2gh/vmhgfs-only/file.c:46:0:
      /tmp/modconfig-4Zp2gh/vmhgfs-only/fsutil.h:92:6: note: expected ‘uid_t’ but argument is of type ‘kuid_t’
      void HgfsSetUidGid(struct inode *parent,
            ^
      /tmp/modconfig-4Zp2gh/vmhgfs-only/file.c:659:27: error: incompatible type for argument 4 of ‘HgfsSetUidGid’
                                 current_fsuid(), current_fsgid());
                                 ^
      In file included from /tmp/modconfig-4Zp2gh/vmhgfs-only/file.c:46:0:
      /tmp/modconfig-4Zp2gh/vmhgfs-only/fsutil.h:92:6: note: expected ‘gid_t’ but argument is of type ‘kgid_t’
      void HgfsSetUidGid(struct inode *parent,
            ^
      make[4]: *** [/tmp/modconfig-4Zp2gh/vmhgfs-only/file.o] Error 1
      make[4]: *** Waiting for unfinished jobs....
      /tmp/modconfig-4Zp2gh/vmhgfs-only/filesystem.c: In function ‘HgfsInitSuperInfo’:
      /tmp/modconfig-4Zp2gh/vmhgfs-only/filesystem.c:234:15: error: incompatible types when assigning to type ‘uid_t’ from type ‘kuid_t’
             si->uid = current_uid();
                     ^
      /tmp/modconfig-4Zp2gh/vmhgfs-only/filesystem.c:240:15: error: incompatible types when assigning to type ‘gid_t’ from type ‘kgid_t’
             si->gid = current_gid();
                     ^
      make[4]: *** [/tmp/modconfig-4Zp2gh/vmhgfs-only/filesystem.o] Error 1
      make[3]: *** [_module_/tmp/modconfig-4Zp2gh/vmhgfs-only] Error 2
      make[2]: *** [sub-make] Error 2
      make[1]: *** [all] Error 2
      make[1]: Leaving directory `/usr/src/linux-headers-3.12-1-amd64'
      make: *** [vmhgfs.ko] Error 2
      make: Leaving directory `/tmp/modconfig-4Zp2gh/vmhgfs-only'

      The filesystem driver (vmhgfs module) is used only for the shared folder
      feature. The rest of the software provided by VMware Tools is designed to work
      independently of this feature.

      If you wish to have the shared folders feature, you can install the driver by
      running vmware-config-tools.pl again after making sure that gcc, binutils, make
      and the kernel sources for your running kernel are installed on your machine.
      These packages are available on your distribution's installation CD.
      [ Press Enter key to continue ]

      The vmxnet driver is no longer supported on kernels 3.3 and greater. Please
      upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)

      The vmblock enables dragging or copying files between host and guest in a
      Fusion or Workstation virtual environment.  Do you wish to enable this feature?
      [yes]

      VMware automatic kernel modules enables automatic building and installation of
      VMware kernel modules at boot that are not already present. This feature can be

      enabled/disabled by re-running vmware-config-tools.pl.

      Would you like to enable VMware automatic kernel modules?
      [no]


      Disabling timer-based audio scheduling in pulseaudio.



      Detected X server version 1.14.5



      Distribution provided drivers for Xorg X server are used.

      Skipping X configuration because X drivers are not included.

      Creating a new initrd boot image for the kernel.
      update-initramfs: Generating /boot/initrd.img-3.12-1-amd64
      Warning: LBA32 addressing assumed
      Added Linux  *
      Added LinuxOLD
      One warning was issued.
         Starting Virtual Printing daemon: [71G done
         Checking acpi hot plug [71G done
      Starting VMware Tools services in the virtual machine:
         Switching to guest configuration: [71G done
         Blocking file system: [71G done
         VMware User Agent: [71G done
         Guest operating system daemon: [71G done
      The configuration of VMware Tools 9.6.0 build-1294478 for Linux for this
      running kernel completed successfully.

      You must restart your X session before any mouse or graphics changes take
      effect.

      You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
      command line.

      To enable advanced X features (e.g., guest resolution fit, drag and drop, and
      file and text copy/paste), you will need to do one (or more) of the following:
      1. Manually start /usr/bin/vmware-user
      2. Log out and log back into your desktop session; and,
      3. Restart your X session.

      Enjoy,

      --the VMware team

      ]0;computation@inga: ~/Downloads/vmware-tools-distrib computation@inga:~/Downloads/vmware-tools-distrib$ exit

      Script done on Mon 27 Jan 2014 07:36:01 AM EST
      I didn't have this problem when I installed Debian v-7.3.0 on the same Laptop.
        • 1. Re: Problem compiling vmhgfs module
          BlackTibo Novice

          I already found the bug behind the error messages:

           

          Use of uninitialized value $subLevel in split at /usr/bin/vmware-config-tools.pl line 4299.

          Use of uninitialized value $subLevel in concatenation (.) or string at /usr/bin/vmware-config-tools.pl line 4300.

          Argument "12-1-amd64" isn't numeric in multiplication (*) at /usr/bin/vmware-config-tools.pl line 3892.

          Use of uninitialized value $subLevel in addition

           

          This is because the perl script (vmware-config-tools.pl) assumes that kernel version string is always built like this: Version.Patch.SubVersion.

          This was true but kernel 3.12 doen't have this version string format. This is Version.Patch-Subversion

          $subLevel variable cannot be built on provided split command because dot sign ('.') is not the only separator.

           

          To fix this, I changed the line 4297 from

           

          ($version, $patchLevel, $subLevel) = split(/\./, $gSystem{'uts_release'});

           

          to

          ($version, $patchLevel, $subLevel) = split(/\.|-/, $gSystem{'uts_release'});

           

          This does not change the final result (vmhgfs does not compile) but it's a little bit better

          I continue on the compilation problem

          • 2. Re: Problem compiling vmhgfs module
            BlackTibo Novice

            Ok! Found it!!!

             

            The vmhgfs module does not compile because of kernel modification.

            Since kernel 3.5, UID & GID have a different type

            • uid_t => kuid_t
            • gid_t => kgid_t

             

            All these types and new functions/macros to handle them are defined in include/linux/uidgid.h (URL link)

             

            vmhgfs sources are not compliant with that. They use old types but kernel handles new ones.

            Sources have to be patched with correct functions/macros. I have done this patch (attached to this post)

             

            Actions to patch vmware tools:

            • cd /tmp
            • tar -xv /usr/lib/vmware-tools/modules/sources/vmhgfs.tar
            • cd vmhgfs-only
            • patch < patchfile
            • cd ..
            • tar -cvf vmhgfs.tar vmhgfs-only
            • cp vmhgfs.tar /usr/lib/vmware-tools/modules/sources/vmhgfs.tar

             

            Note: In order to have vmhgfs sources into the correct directory, you have to do "vmware-install.pl" (first step of vmware tools installation procedure). Since the compilation will fail on the first attempt, just answer no when the script asks to invoke vmware-config-tools.pl. Once on prompt, my procedure should work.

            Note 2 : the last command (cp) overwrite the original vmhgfs.tar. If you want to revert back later, feel free to save the original tar file.

             

            Once this done, you can invoke vmware-config-tools.pl and vmhgfs will compile correctly. Proof is the patch attached has been retrieved through hgfs shared folder between my virtual machine and my host.

            • 3. Re: Problem compiling vmhgfs module
              rosh9 Lurker

              I am using 3.13.6 kernel and vmware tools 9.6.1. I also had compilation errors as above following the vmware-config-tools execution.

              I have applied your patch and now the compile works fine with no error. However, I still can not access /mnt/hgfs. The directory is mounted and the associated entry is properly created in /etc/fstab:

               

              $ ls -l
              total 9
              dr-xr-xr-x. 1 root root 4192 Mar 14  2014 hgfs

              $ cd /mnt/hgfs/

              bash: cd: /mnt/hgfs/: Not a directory

              $ df

              .host:/                   312466428 130588908 181877520  42% /mnt/hgfs

               

              Any hints where the problem can be?

               

              Best regards,

              • 4. Re: Problem compiling vmhgfs module
                BlackTibo Novice

                Can you provide your /etc/fstab file and tell me how you configure shared folders in VMware player HMI?

                • 5. Re: Problem compiling vmhgfs module
                  rosh9 Lurker

                  I am using the vmwareplayer version 6.0.1 build-1379776.

                  In order to configure the "shared folders" functionality:

                  In Player/manage/Virtual Machine Settings: I set "Shared folders" to "enabled". Folder Sharing: "always enabled". Then under "folders" I specify an existing folder in the host (Win7), giving it a local name G-Cisco.

                   

                  The "df" command shows that .host is mounted on /mnt/hgfs as you can see above.

                   

                  The content of /etc/fstab stays the default one, as I did not touch it. In fact, I first wanted to test it at its default mount point /mnt/hgfs.

                   

                  [rtg@localhost ~]$ more /etc/fstab

                  #
                  # /etc/fstab
                  # Created by anaconda on Thu Mar 13 05:30:41 2014
                  #
                  # Accessible filesystems, by reference, are maintained under '/dev/disk'
                  # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
                  #
                  /dev/mapper/fedora01-root /                       ext4    defaults        1 1
                  UUID=f06c019f-fe44-4e01-8fe6-0bd9c8ce2e7f /boot                   ext4    defaults        1 2
                  /dev/mapper/fedora01-home /home                   ext4    defaults        1 2
                  /dev/mapper/fedora01-swap swap                    swap    defaults        0 0

                  • 6. Re: Problem compiling vmhgfs module
                    BlackTibo Novice

                    Ok, I watched on my system, it's consistent.

                    Is the vmhgfs kernel module up & running ? (lsmod | grep vm)?

                    Do you see a ".host" entry in /etc/mtab?

                    • 7. Re: Problem compiling vmhgfs module
                      rosh9 Lurker

                      Yes to both Q's. BTW Do you have the same entry as mine for .host in the /etc/mtab?

                       

                      [root@localhost disk]# lsmod | grep vm
                      vmhgfs                 54103  2
                      vmw_balloon            13415  0
                      vmw_vmci               61286  1 vmhgfs
                      vmwgfx                136972  4
                      ttm                    80479  1 vmwgfx
                      drm                   283937  5 ttm,vmwgfx

                       

                      [root@localhost disk]#more /etc/mtab

                      .....

                      .host:/ /mnt/hgfs vmhgfs rw,relatime 0 0

                       

                      ......

                      • 8. Re: Problem compiling vmhgfs module
                        rico.chet Novice

                        FYI: the issue is fixed in VMware Workstation v10.0.2 (Tools version 9.6.2)

                        • 9. Re: Problem compiling vmhgfs module
                          steve13565 Lurker

                          Should be:

                           

                          tar -xvf /usr/lib/vmware-tools/modules/source/vmhgfs.tar

                           

                          -xvf not -xv and "source" not "sources"

                           

                          Should be:

                           

                          cp vmhgfs.tar /usr/lib/vmware-tools/modules/source/vmhgfs.tar

                           

                          "source" not "sources"

                           

                          This solves the compilation problems with vmhgfs, however I am left with the same problems as rosh9.  The mounted directories look like directories to lots of the linux tools, but I cannot see the contents of the director with the "ls" command.  That one says it's not a directory.  Although if I do an "ls -ld /mnt/hgfs /mnt/Z"  they both look like directories.  I also cannot "cd" to the directories.

                           

                          The "/mnt/Z" is where I have mounted my NAS.

                           

                          I have not upgraded to VMware Workstation 10 yet.  After I pay to upgrade, I sure hope it works.

                          • 10. Re: Problem compiling vmhgfs module
                            BlackTibo Novice

                            I didn't continue further investigations since it's fixed in the last VMware tools package (9.6.2). This package can be found in Workstation 10.0.2 as rico.chet said.

                             

                            But you also have this package in Player 6.0.2

                            I have the build 1744117 and the problem is fixed

                            • 11. Re: Problem compiling vmhgfs module
                              steve13565 Lurker

                              I upgraded to workstation 10.0.3, but that wasn't enough to completely solve my problem.

                               

                              Response 11 to Unable to start services for VMware Tools, was the final step that got it all working.  I needed to clear out some of the remnant VMware Tools files from all my previous attempts to fix the problem.

                               

                              Also needed

                               

                              sudo apt-get remove open-vm-tools

                              sudo apt-get purge open-vm-tools

                              sudo apt-get autoremove

                              • 12. Re: Problem compiling vmhgfs module
                                plumeria Novice

                                Unfortunately, the same problem with vmhgfs occurs in VmWare 10.0.4 with kernel 3.16.6.x (SuSE 13.2 x64), the compilation of vmhgfs module fails with

                                 

                                  /tmp/modconfig-auSlFy/vmhgfs-only/file.c:863:4: error: implicit declaration of function ‘generic_file_aio_write’ [-Werror=implicit-function-declaration]

                                    result = generic_file_aio_write(iocb, iov, numSegs, offset);

                                 

                                Other modules compiles fine, but the access to shared folders doesn't work.