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:
<br /> sudo m-a a-i open-vm<br />
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.
<br /> cd /usr/src && ls<br />
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.
<br /> sudo mv open-vm.tar.bz2 open-vm.tar.bz2.orig<br /> sudo mv modules modules.orig<br /> sudo wget http://www.travishegner.com/stuff/open-vm.tar.bz2<br />
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.