Bug 1278896

Summary: VMware Workstation 12 not starting On Fedora 23
Product: [Fedora] Fedora Reporter: Yann Golanski <yann>
Component: 0adAssignee: Paulo Andrade <paulo.cesar.pereira.de.andrade>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 23CC: bioinfornatics, bugzilla-redhat, cheese, felix.almeida, franck.lartigue, ignatenko, mihamina-rakotomandimby, mpredosin, paulo.cesar.pereira.de.andrade, prochakovsky, redhat-bugs, vcojot
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
URL: http://forums.fedoraforum.org/showthread.php?p=1746930&posted=1#post1746930
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-08 10:13:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Yann Golanski 2015-11-06 16:55:32 UTC
Description of problem:

VMware Workstation 12 not starts On Fedora 23

Version-Release number of selected component (if applicable):

Lastest install of F23 as of today, VMware Workstation 12 installed today from VMware-Player-12.0.0-2985596.x86_64.bundle

How reproducible:


Steps to Reproduce:
1. Install the bundle.
2. Start vmplayer.
3. Nothing happens, no errors, no nuffing.

Actual results:

Nothing gets started, no errors.


Expected results:

VMPlayer starts.

Additional info:

Comment 1 Yann Golanski 2015-11-06 16:57:36 UTC
Forgot to add this link to the forums:

http://forums.fedoraforum.org/showthread.php?p=1746930&posted=1#post1746930

It's not just me.

Comment 2 Franck 2015-11-07 09:13:27 UTC
A thread exist on VMWARE forum:
https://communities.vmware.com/thread/523835

Comment 3 Vincent S. Cojot 2015-11-07 16:03:25 UTC
Hi,
After VM 12 stopped working, I almost reverted back to FC22.

This is a chicken and egg issue with the bundled VMWare libs missing some symbols that used to be present in FC22 and the bundled libs (from VMWare) are missing some symbols as well.

I got it working by doing this:


Become root:

$ sudo su -


Force rebuild of VMWare modules:

# vmware-modconfig --console --install-all  


Replace the vmware glib version with the fedora version:

# cd /usr/lib/vmware/lib
# for mylib in $(ls /usr/lib64/*4600*); do /bin/cp -afv $mylib $(basename $mylib .4600.1 )/$(basename $mylib .4600.1 ); done

This basically does the following:
# pwd
/usr/lib/vmware/lib
# /bin/cp -afv /usr/lib64/libgio-2.0.so.0.4600.1 libgio-2.0.so.0/libgio-2.0.so.0
# /bin/cp -afv /usr/lib64/libglib-2.0.so.0.4600.1 libglib-2.0.so.0/libglib-2.0.so.0
# /bin/cp -afv /usr/lib64/libgmodule-2.0.so.0.4600.1 libgmodule-2.0.so.0/libgmodule-2.0.so.0
# /bin/cp -afv /usr/lib64/libgobject-2.0.so.0.4600.1 libgobject-2.0.so.0/libgobject-2.0.so.0
# /bin/cp -afv /usr/lib64/libgthread-2.0.so.0.4600.1 libgthread-2.0.so.0/libgthread-2.0.so.0


Start VMware or VMplayer:

$ VMWARE_USE_SHIPPED_LIBS=force vmware
or:
$ VMWARE_USE_SHIPPED_LIBS=force vmplayer



For ease of use/convenience, you might also want to do this:

# cd /usr/bin/
# mv -iv vmplayer vmplayer.bin
# mv -iv vmware vmware.bin

Then create two scripts replacing the previous scripts/tools:
$ cat /usr/bin/vmplayer
#!/bin/bash
export VMWARE_USE_SHIPPED_LIBS=force
/usr/bin/vmplayer.bin $*

$ cat /usr/bin/vmware
#!/bin/bash
export VMWARE_USE_SHIPPED_LIBS=force
/usr/bin/vmware.bin $*

Comment 4 Igor Gnatenko 2015-11-08 10:13:11 UTC
Please stop flooding for PROPRIETARY in OPEN-SOURCE component in bugzilla.

Comment 5 Vincent S. Cojot 2015-11-09 14:56:33 UTC
As much as I understand your concern here, I still feel this is something that could/should be addressed by Fedora to make the transition easier.

VM12 fails on FC23 due to missing symbols. Those symbols were present on FC22 and below.

This makes (as noted on the multiple reports out there) many users unhappy and Fedora gets the blame. That's why I documented a workaround: to help the Fedora users out.

Comment 6 Yann Golanski 2015-11-09 15:12:03 UTC
(In reply to Vincent S. Cojot from comment #5)
> As much as I understand your concern here, I still feel this is something
> that could/should be addressed by Fedora to make the transition easier.
> 
> VM12 fails on FC23 due to missing symbols. Those symbols were present on
> FC22 and below.
> 
> This makes (as noted on the multiple reports out there) many users unhappy
> and Fedora gets the blame. That's why I documented a workaround: to help the
> Fedora users out.

This is indeed my take on the matter.  Clearly, there is something that was changed between F22 and F23 that stopped VMWare working.  Of course, the right fix is for VMWare to get it right and send a patch.

However, if there is a work around this allows people to actually do work.  Further more, the fedora forum suggested (rightly or wrongly) opening a bug here.

Comment 7 Jens Kuehnel 2015-12-19 21:04:08 UTC
If someone finds this and is looking for a fix, see for a simple fix:
http://vcojot.blogspot.ca/2015/11/vmware-worksation-12-on-fedora-core-23.html

Comment 8 Alexsandr Prochakovsky 2016-05-25 08:49:49 UTC
after kernel 4.4 (VMWare Workstation 12) need some changes in c code:
/usr/lib/vmware/modules/source

1) vmmon.tar
   - untar
   - change ./vmmon-only/linux/hostif.c
   - replace  all:
     "get_user_pages"   to   "get_user_pages_remote" 
   - tar and replace original
2) vmnet.tar
   - untar
   - change ./vmnet-only/userif.c
   - replace  all:
     "get_user_pages"   to   "get_user_pages_remote" 
   - tar and replace original

Successful compiled on FC23 FC24, FC25 (kernel 4.7)

Comment 9 Vincent S. Cojot 2016-05-25 14:06:58 UTC
Hi Alexsandr,
Is this enough?
I just tried it on Workstation 12.1.1 on F23 (Kernel 4.4.9) and I get this after applying your patch:

tmp/modconfig-WjqQAa/vmnet-only/userif.c: In function ‘UserifLockPage’:
/tmp/modconfig-WjqQAa/vmnet-only/userif.c:116:13: error: implicit declaration of function ‘get_user_pages_remote’ [-Werror=implicit-function-declaration]
    retval = get_user_pages_remote(current, current->mm, addr,
             ^

Comment 10 Mihamina Rakotomandimby 2016-06-09 06:24:12 UTC
Editing "vmmon-only/linux/hostif.c" and "vmnet-only/userif.c" made it for me. Thank you.

Comment 11 felix.almeida 2016-09-11 01:40:41 UTC
With newer kernels (e.g. 4.7.2) it might fail with the following error inside VNetNetifStartXmit() in netif.c:

  ‘struct net_device’ has no member named ‘trans_start’.

Simply replace the line:

  dev->trans_start = jiffies;

By:

  netif_trans_update(dev);

Comment 12 Vincent S. Cojot 2016-09-11 17:23:05 UTC
Yes that's true.
For future reference (for people who stumble onto that bug), please see the tooling provided on this page:
http://vcojot.blogspot.ca/2015/11/vmware-worksation-12-on-fedora-core-23.html
The user-friendly patch provided on that page will do everything for the end user.
Regards,
Vincent
The complete patch I'm using is:
cat <<'EOF1' > modules.patch
diff -ur vmw_mods.orig/vmblock-only/linux/control.c vmw_mods/vmblock-only/linux/control.c
--- vmw_mods.orig/vmblock-only/linux/control.c	2016-04-14 19:31:30.000000000 -0400
+++ vmw_mods/vmblock-only/linux/control.c	2016-09-05 15:13:34.526217167 -0400
@@ -208,9 +208,11 @@
    VMBlockSetProcEntryOwner(controlProcMountpoint);
 
    /* Create /proc/fs/vmblock/dev */
-   controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
-                                        VMBLOCK_CONTROL_MODE,
-                                        controlProcDirEntry);
+   controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME, 
+				  VMBLOCK_CONTROL_MODE,
+                                  controlProcDirEntry, 
+				  &ControlFileOps);
+
    if (!controlProcEntry) {
       Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
       remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
@@ -218,7 +220,10 @@
       return -EINVAL;
    }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
    controlProcEntry->proc_fops = &ControlFileOps;
+#endif
+
    return 0;
 }
 
@@ -282,18 +287,24 @@
    int i;
    int retval;
 
-   name = getname(buf);
+   name = __getname();
    if (IS_ERR(name)) {
       return PTR_ERR(name);
    }
 
+   i = strncpy_from_user(name, buf, PATH_MAX);
+   if (i < 0 || i == PATH_MAX) {
+      __putname(name);
+      return -EINVAL;
+   }
+
    for (i = strlen(name) - 1; i >= 0 && name[i] == '/'; i--) {
       name[i] = '\0';
    }
 
    retval = i < 0 ? -EINVAL : blockOp(name, blocker);
 
-   putname(name);
+   __putname(name);
 
    return retval;
 }
diff -ur vmw_mods.orig/vmblock-only/linux/dentry.c vmw_mods/vmblock-only/linux/dentry.c
--- vmw_mods.orig/vmblock-only/linux/dentry.c	2016-04-14 19:31:30.000000000 -0400
+++ vmw_mods/vmblock-only/linux/dentry.c	2016-09-05 15:13:34.528217197 -0400
@@ -63,7 +63,7 @@
                    struct nameidata *nd)   // IN: lookup flags & intent
 {
    VMBlockInodeInfo *iinfo;
-   struct nameidata actualNd;
+   struct path actualNd;
    struct dentry *actualDentry;
    int ret;
 
diff -ur vmw_mods.orig/vmblock-only/linux/file.c vmw_mods/vmblock-only/linux/file.c
--- vmw_mods.orig/vmblock-only/linux/file.c	2016-04-14 19:31:30.000000000 -0400
+++ vmw_mods/vmblock-only/linux/file.c	2016-09-05 15:13:34.528217197 -0400
@@ -132,7 +132,7 @@
     * and that would try to acquire the inode's semaphore; if the two inodes
     * are the same we'll deadlock.
     */
-   if (actualFile->f_dentry && inode == actualFile->f_dentry->d_inode) {
+   if (actualFile->f_path.dentry && inode == actualFile->f_path.dentry->d_inode) {
       Warning("FileOpOpen: identical inode encountered, open cannot succeed.\n");
       if (filp_close(actualFile, current->files) < 0) {
          Warning("FileOpOpen: unable to close opened file.\n");
@@ -166,11 +166,9 @@
 
 static int
 FileOpReaddir(struct file *file,  // IN
-              void *dirent,       // IN
-              filldir_t filldir)  // IN
+		struct dir_context *ctx)
 {
    int ret;
-   FilldirInfo info;
    struct file *actualFile;
 
    if (!file) {
@@ -184,11 +182,8 @@
       return -EINVAL;
    }
 
-   info.filldir = filldir;
-   info.dirent = dirent;
-
    actualFile->f_pos = file->f_pos;
-   ret = vfs_readdir(actualFile, Filldir, &info);
+   ret = iterate_dir(actualFile, ctx);
    file->f_pos = actualFile->f_pos;
 
    return ret;
@@ -237,7 +232,7 @@
 
 
 struct file_operations RootFileOps = {
-   .readdir = FileOpReaddir,
+   .iterate = FileOpReaddir,
    .open    = FileOpOpen,
    .release = FileOpRelease,
 };
diff -ur vmw_mods.orig/vmblock-only/linux/filesystem.c vmw_mods/vmblock-only/linux/filesystem.c
--- vmw_mods.orig/vmblock-only/linux/filesystem.c	2016-04-14 19:31:30.000000000 -0400
+++ vmw_mods/vmblock-only/linux/filesystem.c	2016-09-05 15:13:34.529217212 -0400
@@ -322,7 +322,7 @@
 {
    VMBlockInodeInfo *iinfo;
    struct inode *inode;
-   struct nameidata actualNd;
+   struct path actualNd;
 
    ASSERT(sb);
 
diff -ur vmw_mods.orig/vmblock-only/linux/inode.c vmw_mods/vmblock-only/linux/inode.c
--- vmw_mods.orig/vmblock-only/linux/inode.c	2016-04-14 19:31:30.000000000 -0400
+++ vmw_mods/vmblock-only/linux/inode.c	2016-09-05 15:13:34.530217227 -0400
@@ -35,10 +35,18 @@
 
 
 /* Inode operations */
-static struct dentry *InodeOpLookup(struct inode *dir,
-                                    struct dentry *dentry, struct nameidata *nd);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
+static struct dentry *InodeOpLookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd);
 static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+#else
+static struct dentry *InodeOpLookup(struct inode *, struct dentry *, unsigned int);
+static int InodeOpReadlink(struct dentry *, char __user *, int);
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
 static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
 #else
 static int InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
@@ -49,12 +57,15 @@
    .lookup = InodeOpLookup,
 };
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
 static struct inode_operations LinkInodeOps = {
+#else
+struct inode_operations LinkInodeOps = {
+#endif
    .readlink    = InodeOpReadlink,
    .follow_link = InodeOpFollowlink,
 };
 
-
 /*
  *----------------------------------------------------------------------------
  *
@@ -75,7 +86,11 @@
 static struct dentry *
 InodeOpLookup(struct inode *dir,      // IN: parent directory's inode
               struct dentry *dentry,  // IN: dentry to lookup
-              struct nameidata *nd)   // IN: lookup intent and information
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
+	      struct nameidata *nd)   // IN: lookup intent and information
+#else
+              unsigned int flags)
+#endif
 {
    char *filename;
    struct inode *inode;
@@ -135,7 +150,12 @@
    inode->i_size = INODE_TO_IINFO(inode)->nameLen;
    inode->i_version = 1;
    inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
    inode->i_uid = inode->i_gid = 0;
+#else
+   inode->i_gid = make_kgid(current_user_ns(), 0);
+   inode->i_uid = make_kuid(current_user_ns(), 0);
+#endif
    inode->i_op = &LinkInodeOps;
 
    d_add(dentry, inode);
@@ -177,7 +197,12 @@
       return -EINVAL;
    }
 
-   return vfs_readlink(dentry, buffer, buflen, iinfo->name);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 99)
+	return vfs_readlink(dentry, buffer, buflen, iinfo->name);
+#else
+       return readlink_copy(buffer, buflen, iinfo->name);
+#endif
+
 }
 
 
@@ -198,13 +223,20 @@
  *----------------------------------------------------------------------------
  */
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+static const char *
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
 static void *
 #else
 static int
 #endif
 InodeOpFollowlink(struct dentry *dentry,  // IN : dentry of symlink
-                  struct nameidata *nd)   // OUT: stores result
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+		  void **cookie
+#else
+		  struct nameidata *nd
+#endif
+		  )   // OUT: stores result
 {
    int ret;
    VMBlockInodeInfo *iinfo;
@@ -221,7 +253,11 @@
       goto out;
    }
 
-   ret = vfs_follow_link(nd, iinfo->name);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+   return *cookie = (char *)(iinfo->name);
+#else
+   nd_set_link(nd, iinfo->name);
+#endif
 
 out:
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
@@ -230,3 +266,4 @@
    return ret;
 #endif
 }
+
diff -ur vmw_mods.orig/vmblock-only/shared/compat_namei.h vmw_mods/vmblock-only/shared/compat_namei.h
--- vmw_mods.orig/vmblock-only/shared/compat_namei.h	2016-04-14 19:31:30.000000000 -0400
+++ vmw_mods/vmblock-only/shared/compat_namei.h	2016-09-05 15:13:34.530217227 -0400
@@ -26,21 +26,21 @@
  * struct. They were both replaced with a struct path.
  */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
-#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry
+#define compat_vmw_nd_to_dentry(nd) (nd).dentry
 #else
 #define compat_vmw_nd_to_dentry(nd) (nd).dentry
 #endif
 
 /* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
-#define compat_path_release(nd) path_put(&(nd)->path)
+#define compat_path_release(nd) path_put(nd)
 #else
 #define compat_path_release(nd) path_release(nd)
 #endif
 
 /* path_lookup was removed in 2.6.39 merge window VFS merge */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
-#define compat_path_lookup(name, flags, nd)     kern_path(name, flags, &((nd)->path))
+#define compat_path_lookup(name, flags, nd)     kern_path(name, flags, nd)
 #else
 #define compat_path_lookup(name, flags, nd)     path_lookup(name, flags, nd)
 #endif
diff -ur vmw_mods.orig/vmmon-only/linux/hostif.c vmw_mods/vmmon-only/linux/hostif.c
--- vmw_mods.orig/vmmon-only/linux/hostif.c	2016-04-14 19:48:44.000000000 -0400
+++ vmw_mods/vmmon-only/linux/hostif.c	2016-09-05 15:33:03.514131550 -0400
@@ -1162,8 +1162,13 @@
    int retval;
 
    down_read(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+   retval = get_user_pages_remote(current, current->mm, (unsigned long)uvAddr,
+   numPages, 0, 0, ppages, NULL);
+#else
    retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
-                           numPages, 0, 0, ppages, NULL);
+   numPages, 0, 0, ppages, NULL);
+#endif
    up_read(&current->mm->mmap_sem);
 
    return retval != numPages;
diff -ur vmw_mods.orig/vmnet-only/netif.c vmw_mods/vmnet-only/netif.c
--- vmw_mods.orig/vmnet-only/netif.c	2016-04-14 19:48:47.000000000 -0400
+++ vmw_mods/vmnet-only/netif.c	2016-09-05 15:25:32.794994960 -0400
@@ -39,8 +39,8 @@
 #include <linux/proc_fs.h>
 #include <linux/file.h>
 
-#include "vnetInt.h"
 #include "compat_netdevice.h"
+#include "vnetInt.h"
 #include "vmnetInt.h"
 
 
@@ -465,7 +465,11 @@
    VNetSend(&netIf->port.jack, skb);
 
    netIf->stats.tx_packets++;
+   #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+   netif_trans_update(dev);
+   #else
    dev->trans_start = jiffies;
+   #endif
 
    return 0;
 }
diff -ur vmw_mods.orig/vmnet-only/userif.c vmw_mods/vmnet-only/userif.c
--- vmw_mods.orig/vmnet-only/userif.c	2016-04-14 19:48:47.000000000 -0400
+++ vmw_mods/vmnet-only/userif.c	2016-09-05 15:33:55.618911804 -0400
@@ -113,8 +113,12 @@
    int retval;
 
    down_read(&current->mm->mmap_sem);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
+   retval = get_user_pages_remote(current, current->mm, addr, 1, 1, 0, &page, NULL);
+#else
    retval = get_user_pages(current, current->mm, addr,
-			   1, 1, 0, &page, NULL);
+   1, 1, 0, &page, NULL);
+#endif
    up_read(&current->mm->mmap_sem);
 
    if (retval != 1) {
diff -ur vmw_mods.orig/vmnet-only/vm_device_version.h vmw_mods/vmnet-only/vm_device_version.h
--- vmw_mods.orig/vmnet-only/vm_device_version.h	2016-04-14 19:48:47.000000000 -0400
+++ vmw_mods/vmnet-only/vm_device_version.h	2016-09-05 15:13:34.532217257 -0400
@@ -53,7 +53,9 @@
  *    VMware HD Audio codec
  *    VMware HD Audio controller
  */
+#ifndef PCI_VENDOR_ID_VMWARE
 #define PCI_VENDOR_ID_VMWARE                    0x15AD
+#endif
 #define PCI_DEVICE_ID_VMWARE_SVGA2              0x0405
 #define PCI_DEVICE_ID_VMWARE_SVGA               0x0710
 #define PCI_DEVICE_ID_VMWARE_VGA                0x0711
EOF1

cat <<'EOF2' > util.patch
--- scripts/util.sh.orig	2015-12-09 16:07:06.000000000 -0500
+++ scripts/util.sh	2016-03-02 14:35:04.000000000 -0500
@@ -362,7 +362,7 @@
     echo no
   else
     if [ "$vmdb_VMBLOCK_CONFED" = 'yes' ]; then
-      echo yes
+      echo no
     else
       echo no
     fi
EOF2

Comment 13 Mirko Predosin 2016-10-11 20:09:38 UTC
I realize that the bug has been closed.  But, I wanted to provide a simple fix in case anyone stumbles here while searching for a solution for this issue.

I just upgraded to FC23 (from FC22) and had the same issue.   The simplest fix is to uninstall vmware and install the latest version from VMWare.

Uninstall vmware:
https://pubs.vmware.com/workstation-9/topic/com.vmware.ws.get_started.doc/GUID-05E4C876-F32C-49D2-82B4-8C759691E7F5.html

Get latest version (Workstation Player 12.5):
https://www.vmware.com/products/player/playerpro-evaluation.html