blablabla5
Contributor
Contributor

vmplayer wont compile on 2.6.38-2-amd64

vmnet.ko wont compile with the following error:

make[1]: Entering directory `/usr/src/linux-headers-2.6.38-2-amd64'
  CC [M]  /tmp/vmware-root/modules/vmnet-only/driver.o
/tmp/vmware-root/modules/vmnet-only/driver.c: In function ‘VNetFileOpUnlockedIoctl’:
/tmp/vmware-root/modules/vmnet-only/driver.c:1137: error: implicit declaration of function ‘lock_kernel’
/tmp/vmware-root/modules/vmnet-only/driver.c:1139: error: implicit declaration of function ‘unlock_kernel’
make[4]: *** [/tmp/vmware-root/modules/vmnet-only/driver.o] Error 1
make[3]: *** [_module_/tmp/vmware-root/modules/vmnet-only] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.38-2-amd64'
make: *** [vmnet.ko] Error 2

running Debian 64 (linux mint)

0 Kudos
8 Replies
a_p_
Leadership
Leadership

I'm no dedicated Linux guy, however this is the way I installed VMware Tools on Debian 6 (Squeeze) a few days ago. Maybe that's not exactly what you need, but maybe it helps you solve your issue.

- select "Install VMware Tools"
- mount /media/cdrom0 (see: cat /etc/fstab)
- cd /media/cdrom0
- tar -C /tmp/ -xvzf VMware-Tools…tar.gz
- cd /tmp/vmware-tools-distrib

Unless already installed/done:
- apt-get install gcc-4.3 linux-headers-2.6-amd64 make

- export CC=/usr/bin/gcc-4.3
- run ./vmware-install.pl (or vmware-config-tools.pl if the installation previously failed due to missing modules)
- umount /media/cdrom0

André

0 Kudos
blablabla5
Contributor
Contributor

No go 😕

0 Kudos
jensjensen
Contributor
Contributor

If you are comfortable, you could dive into the code and try to "fix" some of the issues that are throwing compile warnings (which I think are getting treated as errors due to makefile settings).

I have had a similar issue. I suspect that newer compilers may be getting more "strict" on warnings/errors. Not really a C build guru, so I dont know if the solution for vmware is to loosen up their makefile build options or go through and fix the code.

Sorry that's not really an answer, but I think it's worth saying - judging from all the variations of compile issues out there...

0 Kudos
leetgeezer
Contributor
Contributor

Linux kernel 2.6.38 removed the Big Kernel Lock (see http://blog.internetnews.com/skerner/2011/01/linux-2638-eliminates-last-mai.html)

Therefore those functions are not available any more. Guess Vmware will have to patch the drivers.

0 Kudos
Czarnoff
Contributor
Contributor

The BLK (big kernel lock) was removed with 2.6.38.  NFS used the same lock_kernel command.  It replaced the command with lock_flocks.  I did the same change to my vmnet-only/driver.c file.  Everything seems to be working fine.  Here's a diff.

diff -u vmnet-only//driver.c /usr/lib/vmware/modules/source/vmnet-only//driver.c
--- vmnet-only//driver.c        2011-03-26 01:37:29.000000000 -0400
+++ /usr/lib/vmware/modules/source/vmnet-only//driver.c 2011-05-05 10:36:11.918545812 -0400
@@ -264,11 +264,11 @@
                            struct file * filp)  // IN:
{
    int ret = -ENOTTY;
-   lock_kernel();
+   lock_flocks();
    if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) {
       ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg);
    }
-   unlock_kernel();
+   unlock_flocks();
    return ret;
}

@@ -1134,9 +1134,9 @@
    if (filp && filp->f_dentry) {
       inode = filp->f_dentry->d_inode;
    }
-   lock_kernel();
+   lock_flocks();
    err = VNetFileOpIoctl(inode, filp, iocmd, ioarg);
-   unlock_kernel();
+   unlock_flocks();
    return err;
}
#endif

0 Kudos
motri
Contributor
Contributor

works! thanks! (had to apply manually)

0 Kudos
kmoffat
Contributor
Contributor

I manually changed lock_kernel to lock_flock in four places (as in the patch) but still no go on the vmnet module. Should that manual change have worked? or is there something else in the patch that I need to change. (never used a patch before)

Thanks

Ken

0 Kudos
kornerr
Contributor
Contributor

thanks for the patch! works fine on Debian testing as of 2011-06-19 with 2.6.38.

0 Kudos