4

I use VMWare Player on Ubuntu and run a different number of virtual machines on it.

It worked fine until 14.10, when the kernel was upgraded I would be asked to recompile the modules etc; but it doesn't work with Ubuntu 15.04 anymore.

The problem is that it fails when trying to recompile the "virtual network adapter". How can I fix that?

fge
  • 251
  • 2
  • 3
  • 9
  • @EliahKagan that's not my use case at all; the use case is running VMWare player, and Ubuntu is the host, not the guest. – fge Apr 26 '15 at 05:17
  • Sorry. I've rolled back my edit. You may want to [edit] the question yourself. – Eliah Kagan Apr 26 '15 at 15:26

2 Answers2

15

Use this commands (need root access):

$ wget http://pastie.org/pastes/9934018/download -O /tmp/vmnet-3.19.patch
$ cd /usr/lib/vmware/modules/source
$ tar -xf vmnet.tar
$ patch -p0 -i /tmp/vmnet-3.19.patch
$ tar -cf vmnet.tar vmnet-only
$ rm -r *-only
$ vmware-modconfig --console --install-all

for vmware-player 9 you also need to change:

  • vmnet-only/netif.c line 152 from:

    dev = alloc_netdev(sizeof *netIf, deviceName, VNetNetIfSetup);
    

    to

    dev = alloc_netdev(sizeof *netIf, deviceName, NET_NAME_UNKNOWN, VNetNetIfSetup);
    
  • vmnet-only/filter.c line 207 from:

    VNetFilterHookFn(unsigned int hooknum, // IN:

    to:

    VNetFilterHookFn(const struct nf_hook_ops *ops, // IN:

  • vmnet-only/filter.c line 255 from:

    transmit = (hooknum == VMW_NF_INET_POST_ROUTING);

    to:

    transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING);

Thomas Ward
  • 74,764
0

This is because Ubuntu 15.04 uses Linux kernel 3.19, which brings changes to the networking API which VMWare player has not accounted for yet.

Note: version of VMWare Player used here is 7.1.x.

The solution is to apply the following patch to the vmnet driver:

diff --git a/driver.c b/driver.c
index 2e1e643..507a509 100644
--- a/driver.c
+++ b/driver.c
@@ -266,7 +266,7 @@ LinuxDriver_Ioctl32_Handler(unsigned int fd,     // IN: (unused)
    int ret = -ENOTTY;

    if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
-      ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
+      ret = VNetFileOpIoctl(filp->f_path.dentry->d_inode, filp, iocmd, ioarg);
    }
    return ret;
 }
@@ -1191,8 +1191,8 @@ VNetFileOpUnlockedIoctl(struct file    *filp,  // IN:
    struct inode *inode = NULL;
    long err;

-   if (filp && filp->f_dentry) {
-      inode = filp->f_dentry->d_inode;
+   if (filp && filp->f_path.dentry) {
+      inode = filp->f_path.dentry->d_inode;
    }
    err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
    return err;
diff --git a/userif.c b/userif.c
index e68d4ce..b311f48 100644
--- a/userif.c
+++ b/userif.c
@@ -523,7 +523,9 @@ VNetCopyDatagram(const struct sk_buff *skb, // IN: skb to copy
       .iov_base = buf,
       .iov_len  = len,
    };
-   return skb_copy_datagram_iovec(skb, 0, &iov, len);
+   struct iov_iter to;
+   iov_iter_init(&to, READ, &iov, 1, len);
+   return skb_copy_datagram_iter(skb, 0, &to, len);
 }

For this:

  • be root...
  • make a backup copy of /usr/lib/vmware/modules/source/vmnet.tar somewhere;
  • untar it in a temporary directory;
  • apply the patch above (cd vmnet-only && patch -p1 <path/to/the.patch && cd ..);
  • recreate the tar archive, overwriting the original (tar cf /usr/lib/vmware/modules/source/vmnet.tar vmnet-only).

You can then restart VMWare player; the driver will compile and install.

fge
  • 251
  • 2
  • 3
  • 9
  • Could you please add to your answer, of what version of the VMWare software this patch works with?

    I need a patch for workstation 9, you see, of which the patch for 11 didn't work.

    – andersoyvind May 13 '15 at 13:26
  • I tried the process above but got an error "Unable to install all modules. see log for details." below is my terminal screen after the process. – FirmTech Aug 20 '15 at 09:12