VMWare 6 and Ubuntu Hardy: vmmon compile error

Just a quick post to documentate how I got my VMWare config to work:

Problem: include/asm/bitops_32.h:9:2: error: #error only <linux/bitops.h> can be included directly, and vmmon-only compile failes

Solution: change line 74 in vmmon-only source file to read: #include “linux/bitops.h”

Steps:

  1. cd /usr/lib/vmware/modules/source
  2. cp vmmon.tar vmmon.tar.orig
  3. sudo tar xvf vmmon.tar
  4. cd vmmon-only/include/
  5. sudo vi vcpuset.h
  6. change line 74 from: #include “asm/bitops.h” to: #include “linux/bitops.h”
  7. rm vmmon.tar
  8. sudo tar cvf vmmon.tar vmmon-only/
  9. sudo rm -rf vmmon-only/
  10. sudo vmware-config.pl

That’s it, the compile will work now and vmware should be usable as normal
eitch

84 Comments

  1. a few glitches with my fresh install of ubuntu 8.04 and VMware workstation 6.0.3, (like Oliver’s post) so here’s the blow-by-blow of what I did to get it to work (not entirely sure I needed all those extra packages — don’t have time to find out as this is to get a production machine working for a client.

    These are my notes to myself, but I thought other users might find it useful:
    ——————————————————————————-
    Steps To Getting VMware workstation 6.0.3 installed on Ubuntu Hardy
    (cf http://eitchpress.eitchnet.ch/?p=13)
    (cf Ubuntu Hacks, O’Reilly, c2006)

    Using Workstation for linux 6.0.3, assume we’re working on privileged user’s Desktop.

    First, we need to install some dependencies:
    sudo apt-get install build-essential
    These 4 may be optional I installed them the first time — next time try without:
    sudo apt-get install libgtk2.0-dev libproc-dev libdumbnet-dev xorg-dev

    next download vware-workstation 32 bit tarball from vmware.com
    http://www.vmware.com/download/ws/
    answer yes to the question about having a license
    you can log on as vmware@mailinator.com, password is [easy to find out]

    next, untar the workstation tarball to the desktop.

    next, run the workstation install
    sudo vmware-distrib/vmware-install.pl
    but don’t do the vmware-config script (answer “no” to the following prompt)
    Before running VMware Workstation for the first time, you need to configure it
    by invoking the following command: “/usr/bin/vmware-config.pl”. Do you want
    this program to invoke the command for you now? [yes] no

    The problem is that the vmmon kernel module won’t compile. The following is the fix.
    Solution: change line 74 in vmmon-only source file to read: #include “linux/bitops.h”
    Steps:
    1. cd /usr/lib/vmware/modules/source
    2. sudo cp vmmon.tar vmmon.tar.orig
    3. sudo tar xvf vmmon.tar
    4. cd vmmon-only/include/
    5. sudo vi vcpuset.h
    6. once in vi, go into command mode (:) and issue “set number” (no quotes)
    7. change line 74 from: #include “asm/bitops.h” to: #include “linux/bitops.h”
    8. cd /usr/lib/vmware/modules/source
    9. sudo rm vmmon.tar
    10. sudo tar cvf vmmon.tar vmmon-only/
    11. sudo rm -rf vmmon-only/
    12. sudo vmware-config.pl

  2. I followed the instructions, but i still cant install.. Heres the output of the last command 🙁

    What is the location of the directory of C header files that match your running
    kernel? [/lib/modules/2.6.24-16-generic/build/include]

    Extracting the sources of the vmmon module.

    Building the vmmon module.

    Using 2.6.x kernel build system.
    make: Går til katalog ‘/tmp/vmware-config11/vmmon-only’
    make -C /lib/modules/2.6.24-16-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
    make[1]: Går til katalog ‘/usr/src/linux-headers-2.6.24-16-generic’
    CC [M] /tmp/vmware-config11/vmmon-only/linux/driver.o
    I filen inkluderet af /tmp/vmware-config11/vmmon-only/./include/modulecall.h:23,
    af /tmp/vmware-config11/vmmon-only/./common/vmx86.h:18,
    af /tmp/vmware-config11/vmmon-only/linux/driver.h:16,
    af /tmp/vmware-config11/vmmon-only/linux/driver.c:84:
    /tmp/vmware-config11/vmmon-only/./include/vcpuset.h:74:13: error: #include forventer “FILNAVN” eller
    make[2]: *** [/tmp/vmware-config11/vmmon-only/linux/driver.o] Fejl 1
    make[1]: *** [_module_/tmp/vmware-config11/vmmon-only] Fejl 2
    make[1]: Forlader katalog ‘/usr/src/linux-headers-2.6.24-16-generic’
    make: *** [vmmon.ko] Fejl 2
    make: Forlader katalog ‘/tmp/vmware-config11/vmmon-only’
    Unable to build the vmmon module.

    For more information on how to troubleshoot module-related problems, please
    visit our Web site at “http://www.vmware.com/download/modules/modules.html” and
    “http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html”.

  3. hmm… well the way I see it, you didn’t type it in correctly, the error there is:

    /tmp/vmware-config11/vmmon-only/./include/vcpuset.h:74:13: error: #include forventer “FILNAVN” eller

    so it is saying that there is an error on line 74. If you look at my post, you will see it should look like so:

    #include “linux/bitops.h”

    I don’t know what happened, but you might just want to delete what you created and unpack the original .tar file again to start from the beginning

    greetz
    eitch

  4. I could not build the vmmon, could help me please, thx

    Building the vmmon module.

    Using 2.6.x kernel build system.
    make: Entering directory `/tmp/vmware-config1/vmmon-only’
    make -C /lib/modules/2.6.24-16-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-generic’
    CC [M] /tmp/vmware-config1/vmmon-only/linux/driver.o
    In file included from /tmp/vmware-config1/vmmon-only/./include/vmware.h:25,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:83:
    /tmp/vmware-config1/vmmon-only/./include/vm_basic_types.h:170: error: conflicting types for ‘uintptr_t’
    include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here
    In file included from /tmp/vmware-config1/vmmon-only/./include/x86.h:23,
    from /tmp/vmware-config1/vmmon-only/linux/driver.h:15,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:84:
    /tmp/vmware-config1/vmmon-only/./include/x86cpuid.h:383:1: warning: “BIT_MASK” redefined
    In file included from include/linux/kernel.h:15,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:11:
    include/linux/bitops.h:7:1: warning: this is the location of the previous definition
    In file included from /tmp/vmware-config1/vmmon-only/./include/vmci_kernel_defs.h:26,
    from /tmp/vmware-config1/vmmon-only/./common/vmciContext.h:19,
    from /tmp/vmware-config1/vmmon-only/linux/driver.h:21,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:84:
    /tmp/vmware-config1/vmmon-only/./include/compat_wait.h:37:5: warning: “VMW_HAVE_EPOLL” is not defined
    /tmp/vmware-config1/vmmon-only/./include/compat_wait.h:43:5: warning: “VMW_HAVE_EPOLL” is not defined
    In file included from /tmp/vmware-config1/vmmon-only/./include/vmci_kernel_defs.h:26,
    from /tmp/vmware-config1/vmmon-only/./common/vmciContext.h:19,
    from /tmp/vmware-config1/vmmon-only/linux/driver.h:21,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:84:
    /tmp/vmware-config1/vmmon-only/./include/compat_wait.h:60: error: conflicting types for ‘poll_initwait’
    include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
    /tmp/vmware-config1/vmmon-only/linux/driver.c:198: warning: initialization from incompatible pointer type
    make[2]: *** [/tmp/vmware-config1/vmmon-only/linux/driver.o] Error 1
    make[1]: *** [_module_/tmp/vmware-config1/vmmon-only] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic’
    make: *** [vmmon.ko] Error 2
    make: Leaving directory `/tmp/vmware-config1/vmmon-only’
    Unable to build the vmmon module.

  5. Brilliant, thanks for the saving the rest of my forehead (from the desk slamming 😉

  6. just great, but as stated on the coments by Lee
    try to change the inicial info as he mentions.

    6.b. cd /usr/lib/vmware/modules/source
    9.b. change to vmware-player-distrib directory

    Other than that alot of seach time saved, alot of learning avoided 😀

    cheers

  7. hi

    I followed the steps, and I get the following error message?
    I checked the vcpuset.h file, and it was as eitch has mentioned.

    What should I do?

    Making sure services for VMware Workstation are stopped.

    Stopping VMware services:
    Virtual machine monitor done
    Blocking file system: done
    Bridged networking on /dev/vmnet0 done
    Host network detection done
    Virtual ethernet done

    Configuring fallback GTK+ 2.4 libraries.

    In which directory do you want to install the theme icons?
    [/usr/share/icons]

    What directory contains your desktop menu entry files? These files have a
    .desktop file extension. [/usr/share/applications]

    In which directory do you want to install the application’s icon?
    [/usr/share/pixmaps]

    Trying to find a suitable vmmon module for your running kernel.

    None of the pre-built vmmon modules for VMware Workstation is suitable for your
    running kernel. Do you want this program to try to build the vmmon module for
    your system (you need to have a C compiler installed on your system)? [yes]

    Using compiler “/usr/bin/gcc”. Use environment variable CC to override.

    What is the location of the directory of C header files that match your running
    kernel? [/lib/modules/2.6.24-16-generic/build/include]

    Extracting the sources of the vmmon module.

    Building the vmmon module.

    Using 2.6.x kernel build system.
    make: Entering directory `/tmp/vmware-config1/vmmon-only’
    make -C /lib/modules/2.6.24-16-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.24-16-generic’
    CC [M] /tmp/vmware-config1/vmmon-only/linux/driver.o
    In file included from /tmp/vmware-config1/vmmon-only/./include/vmware.h:25,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:83:
    /tmp/vmware-config1/vmmon-only/./include/vm_basic_types.h:170: error: conflicting types for ‘uintptr_t’
    include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here
    In file included from /tmp/vmware-config1/vmmon-only/./include/x86.h:23,
    from /tmp/vmware-config1/vmmon-only/linux/driver.h:15,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:84:
    /tmp/vmware-config1/vmmon-only/./include/x86cpuid.h:383:1: warning: “BIT_MASK” redefined
    In file included from include/linux/kernel.h:15,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:11:
    include/linux/bitops.h:7:1: warning: this is the location of the previous definition
    In file included from /tmp/vmware-config1/vmmon-only/./include/vmci_kernel_defs.h:26,
    from /tmp/vmware-config1/vmmon-only/./common/vmciContext.h:19,
    from /tmp/vmware-config1/vmmon-only/linux/driver.h:21,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:84:
    /tmp/vmware-config1/vmmon-only/./include/compat_wait.h:37:5: warning: “VMW_HAVE_EPOLL” is not defined
    /tmp/vmware-config1/vmmon-only/./include/compat_wait.h:43:5: warning: “VMW_HAVE_EPOLL” is not defined
    In file included from /tmp/vmware-config1/vmmon-only/./include/vmci_kernel_defs.h:26,
    from /tmp/vmware-config1/vmmon-only/./common/vmciContext.h:19,
    from /tmp/vmware-config1/vmmon-only/linux/driver.h:21,
    from /tmp/vmware-config1/vmmon-only/linux/driver.c:84:
    /tmp/vmware-config1/vmmon-only/./include/compat_wait.h:60: error: conflicting types for ‘poll_initwait’
    include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
    /tmp/vmware-config1/vmmon-only/linux/driver.c:198: warning: initialization from incompatible pointer type
    make[2]: *** [/tmp/vmware-config1/vmmon-only/linux/driver.o] Error 1
    make[1]: *** [_module_/tmp/vmware-config1/vmmon-only] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic’
    make: *** [vmmon.ko] Error 2
    make: Leaving directory `/tmp/vmware-config1/vmmon-only’
    Unable to build the vmmon module.

    For more information on how to troubleshoot module-related problems, please
    visit our Web site at “http://www.vmware.com/download/modules/modules.html” and
    “http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html”.

    Execution aborted.

  8. Having the same problem as Calis and wahin.

    running hardy on x86_64, upgrading from gutsy.

    If I find the cure, I’ll be back.

  9. First, big thanks for this. And some help for others:

    ## Save this as a script and run it. I uses the steps at the top plus
    ## the other refinements suggested by some others above.

    ## Extract files
    cd /usr/lib/vmware/modules/source
    sudo cp vmmon.tar vmmon.tar.orig
    sudo tar xvf vmmon.tar
    cd vmmon-only/include/

    ## Fix the bug (should be two lines, but might get wrapped here)
    sudo sed -e ‘s|asm/bitops.h|linux/bitops.h|’ vcpuset.h > /tmp/vcpuset.h.new
    sudo mv /tmp/vcpuset.h.new vcpuset.h

    ## Pack things up again
    cd /usr/lib/vmware/modules/source
    sudo rm -f vmmon.tar
    sudo tar cvf vmmon.tar vmmon-only/
    sudo rm -rf vmmon-only/
    sudo vmware-config.pl

  10. @wahin

    You need to download a new copy of VMware workstation.

    6.0.4-93057 is working fine after the above patch procedure. I had 6.0.2-59824 and got the same error you saw.

  11. Same prob as others having issues.

    Could it be the hardware/OS we are using?

    I’m trying tio install VMWare Server 1.0.5 Build 80187 on:
    CPU: Intel 64bit E8200
    Mobo: Asus P5K Pro
    Ubuntu Server 8.04.1 – and I’ve added kubuntu desktop as well.

    I’ve added all the extra packages mentioned by Derek Shaw:
    sudo apt-get install build-essential
    sudo apt-get install libgtk2.0-dev libproc-dev libdumbnet-dev xorg-dev

    And I have edited the vcpuset.h file exactly the way stated in the original post. (including step 6.5)

    Error message:

    Building the vmmon module.

    Using 2.6.x kernel build system.
    make: Entering directory `/tmp/vmware-config3/vmmon-only’
    make -C /lib/modules/2.6.24-19-server/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.24-19-server’
    CC [M] /tmp/vmware-config3/vmmon-only/linux/driver.o
    In file included from /tmp/vmware-config3/vmmon-only/./include/vmware.h:25,
    from /tmp/vmware-config3/vmmon-only/linux/driver.c:48:
    /tmp/vmware-config3/vmmon-only/./include/vm_basic_types.h:159: error: redefinition of typedef
    include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here
    In file included from /tmp/vmware-config3/vmmon-only/linux/driver.h:20,
    from /tmp/vmware-config3/vmmon-only/linux/driver.c:49:
    /tmp/vmware-config3/vmmon-only/./include/compat_wait.h:37:5: warning: “VMW_HAVE_EPOLL” is not
    /tmp/vmware-config3/vmmon-only/./include/compat_wait.h:43:5: warning: “VMW_HAVE_EPOLL” is not
    In file included from /tmp/vmware-config3/vmmon-only/linux/driver.h:20,
    from /tmp/vmware-config3/vmmon-only/linux/driver.c:49:
    /tmp/vmware-config3/vmmon-only/./include/compat_wait.h:60: error: conflicting types for ‘poll_
    include/linux/poll.h:65: error: previous declaration of ‘poll_initwait’ was here
    /tmp/vmware-config3/vmmon-only/linux/driver.c:147: warning: initialization from incompatible p
    /tmp/vmware-config3/vmmon-only/linux/driver.c:151: warning: initialization from incompatible p
    /tmp/vmware-config3/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
    /tmp/vmware-config3/vmmon-only/linux/driver.c:1659: error: ‘struct mm_struct’ has no member na
    make[2]: *** [/tmp/vmware-config3/vmmon-only/linux/driver.o] Error 1
    make[1]: *** [_module_/tmp/vmware-config3/vmmon-only] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-server’
    make: *** [vmmon.ko] Error 2
    make: Leaving directory `/tmp/vmware-config3/vmmon-only’
    Unable to build the vmmon module.

  12. PS – if all else fails I’m going to try an earlier version of 64bit Ubuntu server.

    Thanks for your efforts eitch.

  13. No… the problem was I didnl;t have my eyes open when I got the server installer from the VMWare site. I missed the fact that v1.06 was available. Installed using 1.06 without any problems.

  14. thank you! eitch. It worked for me. how did you get to the solution?

  15. Thnx!

    Same problem as Scootr and Wahin. Installing the new VMWare Server VMware-server-1.0.6-91891 did the trick.
    Compile was succesfull.

  16. Fantastic! I badly needed vmware for dragon naturally speaking as I am disabled and writing a book. The two conditions aren’t the best of chums as typing leaves me in a fair bit of pain after a while. As I really do not have a technical mind at all I thought I was shafted until I came across your kindness and associated fix. I didn’t understand a blessed thing I was typing in – well not much, anyways – but lo and behold. No more dual booting!

    Thank you so much. Have some froot.

  17. Hi all,
    I was persistent with the errors, tried to install on Ubuntu 9.04 64bit and got a few errors, just look at error, which file and line number and type of error and fix the code. If it says to many arguments in function call just go to the line number and delete the last argument in the function call. If you are persistent to change several source files finally it will work. Just follow the steps below. Change step six depending on the error. BTW to save some time you can skip step 8. You need to have some basic C programming skills but it’s not too hard to do.

    1. cd /usr/lib/vmware/modules/source
    2. cp vmmon.tar vmmon.tar.orig
    3. sudo tar xvf vmmon.tar
    4. cd vmmon-only/include/
    5. sudo vi vcpuset.h
    6. change line 74 from: #include “asm/bitops.h” to: #include “linux/bitops.h”
    7. rm vmmon.tar
    8. sudo tar cvf vmmon.tar vmmon-only/
    9. sudo rm -rf vmmon-only/
    10. sudo vmware-config.pl

Comments are closed.