Ubuntu Server 9.04 Jaunty: open-vm modules fail to build

I have decided to start upgrading from Ubuntu Server 8.10 Intrepid to Ubuntu Server 9.04 on all of my server machines. In 8.10, I was able to get the open-vm-tools to build and install, but they suffered from a bug which caused the vmware-guestd service to crash soon after starting. This was mildly acceptable and my servers have been running that way for a while, because I wanted the fix to be easily installed from the ubuntu repositories.

Well after waiting 6 months, with no fix in the repo’s, Canonical released Ubuntu Server 9.04. I upgraded a test server “sudo do-release-upgrade” and rebooted, only to find that the new vmware-guestd installs and runs, but the new open-vm modules fail to build properly with module-assistant (sigh). So I decided that I don’t want my VM’s to run without modules, because they are very important for the way ESXi handles memory allocation and management, but I still want to upgrade my 8.10 servers because having vmware-guestd not crash is a huge plus. vmware-guestd handles tasks like allowing the ESXi host to shutdown the linux guest safely, and synchronizing the VM clock with the host clock.

So after some searching, I came across this open-vm patch which allows the modules to build successfully. If you are not comfortable with patching it yourself, read on, and I’ll explain how I did it, and provide a pre-patched source archive for you to replace on your machine, in order to allow module-assistant to build the modules successfully.

Many people (myself included) are a bit weary when it comes to compiling and installing linux modules. Probably mostly due to lack of research, because if it’s like anything else in linux, it is very straght-forward and easy to understand. ModuleAssistant is an awsome tool for debian (and inherently debian-based) linux distros which nearly automates the process of compiling and installing modules. Assuming the code is correct and m-a is installed, we could build and install the open-vm modules and tools in one fell swoop by typing:


sudo m-a a-i open-vm

But since we don’t get that lucky, we have to do a little work to get the modules installed and compiled properly. First, take all the necessary precautions and backup your data, or take a snapshot. Then, run the command from above to prepare the machine for the new modules. Go through the prompts accepting the changes, and eventually you will get an error stating that the build has failed. At this point, choose “stop” and you should be back at the command prompt. Navigate to ‘/usr/src’ and list the contents.


cd /usr/src && ls

You should see a source archive titled ‘open-vm.tar.bz2′, rename this archive to something else, and replace it with my pre-patched open-vm.tar.bz2. Also rename the ‘modules’ directory.


sudo mv open-vm.tar.bz2 open-vm.tar.bz2.orig
sudo mv modules modules.orig
sudo wget http://www.travishegner.com/stuff/open-vm.tar.bz2

Once the file has been replaced, re-run the auto-install command from above and the build should complete successfully. The modules and tools should also install. Reboot for good measure to make sure everything comes up like it’s supposed to.

You should now be running both the open-vm modules, and vmware-guestd without any issues. AWSOME! No more errant clocks, and even the “Shutdown Guest” and “Restart Guest” scripts work like they are supposed to.

8 comments to Ubuntu Server 9.04 Jaunty: open-vm modules fail to build

  • Gonzalo

    Thank you.
    Afer downloading http://www.travishegner.com/stuff/open-vm.tar.bz2 it compiled ok with m-a
    I dont know why Ubuntu have build open-vm-source package with this tar.bz2 if it does not install.
    And i don’t see any bug open about it in Launchpad…

  • My pleasure Gonzalo, I’m glad I could help.

  • Gonzalo

    And it happens again in karmic koala with kernel 2.6.31. Travis, now your package (http://www.travishegner.com/stuff/open-vm.tar.bz2) seems not to work with karmic. Do you know what can be happening?. For now I have reopened a bug in launchpad:
    https://bugs.launchpad.net/ubuntu/+source/open-vm-tools/+bug/278711
    Regards.

  • Hello Again Gonzalo,
    I have not experimented at all with the open-vm tools on 9.10. Honestly, I have moved to vmware workstation 7, and most of my esxi work has been with version 4 so I haven’t had a need. The new vmware tools for linux that comes packaged with those versions now compiles fine, and they have it install through a similar perl script as the workstation for linux install. I’m not sure if the new tools are available anywhere for download, or if there even compatible with older vmware versions, but it may be worth an investigation.
    If I can ever find the time, I’ll see if I can get a new patched package that compiles on 9.10.
    Travis

  • Gonzalo

    > If I can ever find the time, I’ll see if I can get a new patched package that compiles on 9.10.
    Thank you Travis. I will check your Blog if there is anything new.

  • Hey Gonzalo,
    I’m not sure what your having trouble with, as the built in tools compile OK for me on 9.10.
    From a fresh install:
    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo reboot
    sudo apt-get install build-essential
    sudo apt-get install module-assistant
    sudo m-a a-i open-vm
    sudo reboot
    Those steps compile the modules and tools (with a handful of warnings), but they seem to start OK. The vmxnet or vmxnet3 modules don’t appear to load after a reboot, but networking is not broken, so I don’t concern myself with that. For me, the most important module is the vmmemctl module, which (I assume) helps the host, better manage the guests memory, and sharing it with other guests or host processes. My host reports that the tools are running, are you having a different problem that I am missing? What version of vmware are you running your virtual boxes on?

  • Matt

    I get the following error with your pre-patched archive in 9.10:
    │ In file included from
    │ /usr/src/modules/open-vm/modules/linux/vmblock/linux/os.h:35,
    │ from
    │ /usr/src/modules/open-vm/modules/linux/vmblock/linux/block.c:26:
    │ /usr/src/modules/open-vm/modules/linux/vmblock/./include/compat_wait.h:78
    │ : error: conflicting types for ‘poll_initwait’
    │ include/linux/poll.h:70: note: previous declaration of ‘poll_initwait’
    │ was here
    I’m not sure why we’d get different results. Looking at the source code, all I can figure is that VMW_HAVE_EPOLL isn’t defined when it should be on my system, but I’m not sure how that gets set:
    In /usr/src/modules/open-vm/modules/linux/vmblock/include/compat_wait.h:
    #ifdef VMW_HAVE_EPOLL // {
    #define compat_poll_wqueues struct poll_wqueues
    #ifdef VMW_HAVE_EPOLL // {
    /* If prototype does not match, build will abort here */
    extern void poll_initwait(compat_poll_wqueues *);
    In /usr/src/linux-headers-2.6.31-16/include/linux/poll.h:
    extern void poll_initwait(struct poll_wqueues *pwq);
    Any ideas?
    Thanks!

  • Hey Matt,
    For 9.10, I typically don’t use the patched archive that’s here, I just compile the one in the repositories. The patched archive that I provide was intended for 9.04 only. There are still some warnings with the 9.10 tools, but it at least builds the most important modules.
    Thanks for reading!
    Travis

Leave a Reply

  

  

  

* Copy this password:

* Type or paste password here:

1,705 Spam Comments Blocked so far by Spam Free Wordpress

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>