VMWare Server 2: Unable to build the vsock module

If you encounter the following error after installing VMWare Server 2.0 RCx to Ubuntu:

Using 2.6.x kernel build system.
make: Entering directory `/root/tmp/vmware-config0/vsock-only'
make -C /lib/modules/2.6.24.4-desktop-1mnb/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-2.6.24.4-desktop-1mnb'
CC [M] /root/tmp/vmware-config0/vsock-only/linux/af_vsock.o
In file included from /root/tmp/vmware-config0/vsock-only/linux/af_vsock.c:92:
/root/tmp/vmware-config0/vsock-only/./include/compat_wait.h:64: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
/root/tmp/vmware-config0/vsock-only/linux/af_vsock.c:260: warning: initialization from incompatible pointer type
/root/tmp/vmware-config0/vsock-only/linux/af_vsock.c: In function ‘__VSockVmciCreate’:
/root/tmp/vmware-config0/vsock-only/linux/af_vsock.c:1789: warning: passing argument 1 of ‘sk_alloc’ makes pointer from integer without a cast
/root/tmp/vmware-config0/vsock-only/linux/af_vsock.c:1789: warning: passing argument 3 of ‘sk_alloc’ makes integer from pointer without a cast
/root/tmp/vmware-config0/vsock-only/linux/af_vsock.c:1789: warning: passing argument 4 of ‘sk_alloc’ makes pointer from integer without a cast
make[2]: *** [/root/tmp/vmware-config0/vsock-only/linux/af_vsock.o] Error 1
make[1]: *** --_module_/root/tmp/vmware-config0/vsock-only-- Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.24.4-desktop-1mnb'
make: *** http://vsock.ko Error 2
make: Leaving directory `/root/tmp/vmware-config0/vsock-only'
Unable to build the vsock module.

fret not since there is a workaround to this. Although this is just a minor inconvenience and your VM will still run fine, you’ll better off fixing it. Read on

The problem is that the 2.6.24 kernel as packaged by Ubuntu 8.04 “hardy” changed how its source code provides certain information. This can be fixed by modifying the vsock module’s source code.

vsock = VM communication interface socket

  1. The first thing to do is to unpack the vsock source:
    $ tar xvf /usr/lib/vmware/modules/source/vsock.tar
  2. Change some of its auto-configuration.
    $ cd vsock-only
    $ sed -i 's/^\#include <linux\/autoconf\.h>//' autoconf/*.c
  3. The command above will traverse the autoconf folder and go through all the files that matches *.c and remove all lines that looks like:
    #include <linux/autoconf.h>
    these are part of the test file that the build system uses to figure out what features are available:
  4. Build the code:
    $ make
  5. Copy the driver over where VMware’s startup scripts can find it:
    $ sudo cp vsock.o /lib/modules/$(uname -r)/misc
    $ sudo ln -s vsock.o /lib/modules/$(uname -r)/misc/vsock.ko
  6. Create the dependency module so that the correct module dependencies will be available after booting the system
    $ sudo depmod -a
  7. Now shut down all your running VMs and restart VMware’s services:
    For Ubuntu/Debian
    $ sudo invoke-rc.d vmware restart
    or
    For Fedora/RedHat (or derivatives)
    $ sudo /sbin/service vmware restart
  8. Now the vsock driver should load up properly. Try entering http://localhost/ui/ in your favorite browser (I supposed it’s Firefox). Tested on Ubuntu 8.04 (Hardy Heron). Now get that virtual server running……

1,083 Comments

  1. gary t.

    thank you for the fix, works flawless on my ubuntu hardy install….

    note: make sure you install the ubuntu dev tools to compile… i guess everybody knows this already

    Reply
  2. gary t.

    thank you for the fix, works flawless on my ubuntu hardy install….

    note: make sure you install the ubuntu dev tools to compile… i guess everybody knows this already

    Reply
  3. Sendhil

    Hi,
    Can you mention the actual build version of vmware on which this command worked? Mine isnt working still..I had vmware 2 build 84186. I’m downloading the latest version to see if that fixes the problem.
    Thanks
    Sendhil

    Reply
  4. Sendhil

    Hi,
    Can you mention the actual build version of vmware on which this command worked? Mine isnt working still..I had vmware 2 build 84186. I’m downloading the latest version to see if that fixes the problem.
    Thanks
    Sendhil

    Reply
  5. the editor

    Hi Sendhil,

    I just upgraded to the latest version and this workaround fixed it.

    Try the latest version and let me know if you still have issues….

    Reply
  6. the editor

    Hi Sendhil,

    I just upgraded to the latest version and this workaround fixed it.

    Try the latest version and let me know if you still have issues….

    Reply
  7. Pingback: Bookmarks about Ubuntu

  8. Gord J.

    Hallelujah!

    Thank you, sir. This got me up and running after a combined Ubuntu Desktop 8.10 / VMware Server 2.0 upgrade.

    Cheers!

    –Gord

    Reply
  9. Gord J.

    Hallelujah!

    Thank you, sir. This got me up and running after a combined Ubuntu Desktop 8.10 / VMware Server 2.0 upgrade.

    Cheers!

    –Gord

    Reply
  10. TomB

    I’m using the newly-released Ubuntu 8.10, along with build 122956 of Vmware Server2, and these instructions worked. Eventually. I probably did something wrong, but I had to reboot the computer to get it to work (Windows habits die hard). Restarting the Vmware services didn’t do it for me.

    Others in the same situation might try that, too, and see if it works.

    For those who don’t already know, the vsock module is what allows your browser to access the vmware console. Without it, you can still use a VM if you’ve made a shortcut to it (on your desktop or whatever), but you can’t change any of the settings exposed by the console.

    Reply
  11. TomB

    I’m using the newly-released Ubuntu 8.10, along with build 122956 of Vmware Server2, and these instructions worked. Eventually. I probably did something wrong, but I had to reboot the computer to get it to work (Windows habits die hard). Restarting the Vmware services didn’t do it for me.

    Others in the same situation might try that, too, and see if it works.

    For those who don’t already know, the vsock module is what allows your browser to access the vmware console. Without it, you can still use a VM if you’ve made a shortcut to it (on your desktop or whatever), but you can’t change any of the settings exposed by the console.

    Reply
  12. brendan

    YOU ROCK. Worked perfectly. I fat-fingered the “sed” command by hand and had issues compiling, but it worked fine when I started over and copy/pasted the sed command as you have it above.

    Thank you so much for posting this!

    -B

    Reply
  13. brendan

    YOU ROCK. Worked perfectly. I fat-fingered the “sed” command by hand and had issues compiling, but it worked fine when I started over and copy/pasted the sed command as you have it above.

    Thank you so much for posting this!

    -B

    Reply
  14. thierrybo

    Did not work for me (2.26.27-7 and 2.0.0-116503). As before trying this workaround, I can open http://localhost:8222/ui/ display the web interface but no content. The message bar display “loading” a long time, then all panes are empty.

    http://img373.imageshack.us/my.php?image=vmwareyl5.png

    Reply
  15. thierrybo

    Did not work for me (2.26.27-7 and 2.0.0-116503). As before trying this workaround, I can open http://localhost:8222/ui/ display the web interface but no content. The message bar display “loading” a long time, then all panes are empty.

    http://img373.imageshack.us/my.php?image=vmwareyl5.png

    Reply
  16. thierrybo

    Well, I just see the errors on vsock ware not the same as yours. It should explain whay it does not work :

    Using 2.6.x kernel build system.
    make: entrant dans le répertoire « /tmp/vmware-config0/vsock-only »
    make -C /lib/modules/2.6.27-7-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
    make[1]: entrant dans le répertoire « /usr/src/linux-headers-2.6.27-7-generic »
    CC [M] /tmp/vmware-config0/vsock-only/linux/af_vsock.o
    CC [M] /tmp/vmware-config0/vsock-only/linux/driverLog.o
    CC [M] /tmp/vmware-config0/vsock-only/linux/util.o
    /tmp/vmware-config0/vsock-only/linux/util.c: In function ‘VSockVmciLogPkt’:
    /tmp/vmware-config0/vsock-only/linux/util.c:157: attention : le format n’est pas une chaîne littérale et pas d’argument de format
    CC [M] /tmp/vmware-config0/vsock-only/linux/vsockAddr.o
    LD [M] /tmp/vmware-config0/vsock-only/vsock.o
    Building modules, stage 2.
    MODPOST 1 modules
    WARNING: “VMCIDatagram_CreateHnd” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
    WARNING: “VMCIDatagram_DestroyHnd” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
    WARNING: “VMCI_GetContextID” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
    WARNING: “VMCIDatagram_Send” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
    CC /tmp/vmware-config0/vsock-only/vsock.mod.o
    LD [M] /tmp/vmware-config0/vsock-only/vsock.ko
    make[1]: quittant le répertoire « /usr/src/linux-headers-2.6.27-7-generic »
    cp -f vsock.ko ./../vsock.o
    make: quittant le répertoire « /tmp/vmware-config0/vsock-only »
    Unable to make a vsock module that can be loaded in the running kernel:
    insmod: error inserting ‘/tmp/vmware-config0/vsock.o’: -1 Unknown symbol in module
    There is probably a slight difference in the kernel configuration between the
    set of C header files you specified and your running kernel. You may want to
    rebuild a kernel based on that directory, or specify another directory.

    Reply
  17. thierrybo

    Well, I just see the errors on vsock ware not the same as yours. It should explain whay it does not work :

    Using 2.6.x kernel build system.
    make: entrant dans le répertoire « /tmp/vmware-config0/vsock-only »
    make -C /lib/modules/2.6.27-7-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
    make[1]: entrant dans le répertoire « /usr/src/linux-headers-2.6.27-7-generic »
    CC [M] /tmp/vmware-config0/vsock-only/linux/af_vsock.o
    CC [M] /tmp/vmware-config0/vsock-only/linux/driverLog.o
    CC [M] /tmp/vmware-config0/vsock-only/linux/util.o
    /tmp/vmware-config0/vsock-only/linux/util.c: In function ‘VSockVmciLogPkt’:
    /tmp/vmware-config0/vsock-only/linux/util.c:157: attention : le format n’est pas une chaîne littérale et pas d’argument de format
    CC [M] /tmp/vmware-config0/vsock-only/linux/vsockAddr.o
    LD [M] /tmp/vmware-config0/vsock-only/vsock.o
    Building modules, stage 2.
    MODPOST 1 modules
    WARNING: “VMCIDatagram_CreateHnd” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
    WARNING: “VMCIDatagram_DestroyHnd” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
    WARNING: “VMCI_GetContextID” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
    WARNING: “VMCIDatagram_Send” [/tmp/vmware-config0/vsock-only/vsock.ko] undefined!
    CC /tmp/vmware-config0/vsock-only/vsock.mod.o
    LD [M] /tmp/vmware-config0/vsock-only/vsock.ko
    make[1]: quittant le répertoire « /usr/src/linux-headers-2.6.27-7-generic »
    cp -f vsock.ko ./../vsock.o
    make: quittant le répertoire « /tmp/vmware-config0/vsock-only »
    Unable to make a vsock module that can be loaded in the running kernel:
    insmod: error inserting ‘/tmp/vmware-config0/vsock.o’: -1 Unknown symbol in module
    There is probably a slight difference in the kernel configuration between the
    set of C header files you specified and your running kernel. You may want to
    rebuild a kernel based on that directory, or specify another directory.

    Reply
  18. Pingback: Server mit VMware | USmith Blog

  19. Toshiro

    Thanks a lot.
    I have changed:
    $ sudo ln -s vsock.o /lib/modules/$(uname -r)/misc/vsock.ko
    with:
    $ sudo ln -s /lib/modules/$(uname -r)/misc/vsock.o /lib/modules/$(uname -r)/misc/vsock.ko
    It’s a link and you may whant to remove the hold vsock-only directory.
    Bye

    Reply
  20. Toshiro

    Thanks a lot.
    I have changed:
    $ sudo ln -s vsock.o /lib/modules/$(uname -r)/misc/vsock.ko
    with:
    $ sudo ln -s /lib/modules/$(uname -r)/misc/vsock.o /lib/modules/$(uname -r)/misc/vsock.ko
    It’s a link and you may whant to remove the hold vsock-only directory.
    Bye

    Reply
  21. Brian

    Thanks, that fixed the problem on my Ubuntu Intrepid Ibex system.

    Reply
  22. Brian

    Thanks, that fixed the problem on my Ubuntu Intrepid Ibex system.

    Reply
  23. pdwalker

    That fixed it for me.

    Thanks!

    If you update the vsock.tar file with your fixes, you can place the vsock.tar in /usr/lib/vmware-tools/modules/source so the vmware-config-tools.pl script can find it.

    Reply
  24. pdwalker

    That fixed it for me.

    Thanks!

    If you update the vsock.tar file with your fixes, you can place the vsock.tar in /usr/lib/vmware-tools/modules/source so the vmware-config-tools.pl script can find it.

    Reply
  25. Marcus Berglof

    /*
    INSTALL:

    Put the patch named vsock-debian.patch in the directory where
    the VMWare file is and you can just paste this straight in a
    bash shell or into a file.

    #!/bin/bash
    tar -xzf VMware-server-2.0.1-156745.x86_64.tar.gz &&
    cd vmware-server-distrib/lib/modules/source &&
    tar -xf vsock.tar && patch -p1 < $OLDPWD/vsock-debian.patch &&
    tar -cf vsock.tar vsock-only && rm -rf vsock-only &&
    cd ../../ && sudo ./vmware-install.pl

    # End of script

    Have fun!

    Marcus Berglof <marcus ulug.org)

    */

    — ./vsock-only.orig/autoconf/cachecreate.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/cachecreate.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +
    #include

    /*
    — ./vsock-only.orig/autoconf/epoll.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/epoll.c 2009-05-17 19:20:55.000000000 +0200
    @@ -22,7 +22,7 @@
    * never had it, but some distros backported epoll patch.
    */

    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
    — ./vsock-only.orig/autoconf/filldir1.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/filldir1.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
    — ./vsock-only.orig/autoconf/geninclude.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/geninclude.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +

    #ifdef CONFIG_X86_VOYAGER
    APATH/mach-voyager
    — ./vsock-only.orig/autoconf/getsb1.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/getsb1.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
    — ./vsock-only.orig/autoconf/setnice.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/setnice.c 2009-05-17 19:20:55.000000000 +0200
    @@ -20,7 +20,7 @@
    * set_user_nice appeared in 2.4.21. But some distros
    * backported it to older kernels.
    */
    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 21)
    — ./vsock-only.orig/autoconf/sk_filter.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/sk_filter.c 2009-05-17 19:20:55.000000000 +0200
    @@ -23,7 +23,7 @@
    * This test will fail to build on kernels with the new interface.
    */

    -#include
    +
    #include

    /*
    — ./vsock-only.orig/autoconf/statfs1.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/statfs1.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)

    Reply
  26. Marcus Berglof

    /*
    INSTALL:

    Put the patch named vsock-debian.patch in the directory where
    the VMWare file is and you can just paste this straight in a
    bash shell or into a file.

    #!/bin/bash
    tar -xzf VMware-server-2.0.1-156745.x86_64.tar.gz && \
    cd vmware-server-distrib/lib/modules/source && \
    tar -xf vsock.tar && patch -p1 < $OLDPWD/vsock-debian.patch && \
    tar -cf vsock.tar vsock-only && rm -rf vsock-only && \
    cd ../../ && sudo ./vmware-install.pl

    # End of script

    Have fun!

    Marcus Berglof <marcus ulug.org)

    */

    — ./vsock-only.orig/autoconf/cachecreate.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/cachecreate.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +
    #include

    /*
    — ./vsock-only.orig/autoconf/epoll.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/epoll.c 2009-05-17 19:20:55.000000000 +0200
    @@ -22,7 +22,7 @@
    * never had it, but some distros backported epoll patch.
    */

    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
    — ./vsock-only.orig/autoconf/filldir1.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/filldir1.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
    — ./vsock-only.orig/autoconf/geninclude.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/geninclude.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +

    #ifdef CONFIG_X86_VOYAGER
    APATH/mach-voyager
    — ./vsock-only.orig/autoconf/getsb1.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/getsb1.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
    — ./vsock-only.orig/autoconf/setnice.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/setnice.c 2009-05-17 19:20:55.000000000 +0200
    @@ -20,7 +20,7 @@
    * set_user_nice appeared in 2.4.21. But some distros
    * backported it to older kernels.
    */
    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 21)
    — ./vsock-only.orig/autoconf/sk_filter.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/sk_filter.c 2009-05-17 19:20:55.000000000 +0200
    @@ -23,7 +23,7 @@
    * This test will fail to build on kernels with the new interface.
    */

    -#include
    +
    #include

    /*
    — ./vsock-only.orig/autoconf/statfs1.c 2009-03-27 08:17:12.000000000 +0100
    +++ ./vsock-only/autoconf/statfs1.c 2009-05-17 19:20:55.000000000 +0200
    @@ -16,7 +16,7 @@
    *
    *********************************************************/

    -#include
    +
    #include

    #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)

    Reply
  27. Marcus Berglof

    Argh.. copy-n-paste from the web never works as intended.
    The patch is available at http://mina.fulhack.se/vsock-debian.patch

    /Marcus

    Reply
  28. Marcus Berglof

    Argh.. copy-n-paste from the web never works as intended.
    The patch is available at http://mina.fulhack.se/vsock-debian.patch

    /Marcus

    Reply
  29. Pingback: Local SEO in Minneapolis

  30. Pingback: Cyberian.net

  31. Pingback: Minneapolis Local SEO Consultant

  32. Pingback: SEO Expert Austin TX

  33. Pingback: LED outdoor Lighting

  34. Pingback: firma spedycyjna

  35. Pingback: Healthy recipes for dinner

  36. Pingback: What do you know about Vodka?

  37. Pingback: GTA

  38. Pingback: TYPO3 - przełom na wśród systemów cms.

  39. Pingback: Studia na politechnice

  40. Pingback: cmtanc.info

  41. Pingback: rozrywka na czasie

  42. Pingback: masaze-nohou.info

  43. Pingback: myshoulderhurts.info

  44. Pingback: tcpa2.biz

  45. Pingback: investir-au-maroc.info

  46. Pingback: thenyac.us

  47. Pingback: naturalsurgeryrecovery.info

  48. Pingback: pswisconsin.info

  49. Pingback: raiders tattoos

  50. Pingback: jatimprov.info

Leave a Comment

Your email address will not be published. Required fields are marked *