Muffinresearch Labs by Stuart Colville

Ubuntu Hardy: Setting up VMWare-tools from the CLI | Comments (21)

Posted in Code, Linux/Unix on 13th July 2008, 5:41 pm by Stuart

First you need the vmware tools tar from the cd image. This is found at /media/cdrom once you’ve run “install vmware tools” from the server console. When I did this the CD didn’t seem to be available even though it looked like it had mounted correctly. To get past this I simply grabbed a copy of /usr/lib/vmware/isoimages/linux.iso and extracted the vmware-tools tar file from there.

Note it’s not totally necessary but I ran this after upgrading the system to the latest kernel – these optional steps are as follows:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade # if there’s a new kernel available
sudo shutdown -r now # if you’ve updated the kernel

After unpacking the VMware tools package when simply trying to install the vmware tools from the tar file I got the following error:

tar -xzf VMwareTools-1.0.5-80187.tar.gz
cd vmware-tools-distrib/
sudo ./vmware-install.pl

…Snip…

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmhgfs-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-config0/vmhgfs-only/cpName.o
In file included from include/linux/string.h:11,
                 from /tmp/vmware-config0/vmhgfs-only/cpName.h:18,
                 from /tmp/vmware-config0/vmhgfs-only/cpName.c:18:
include/linux/types.h:40: error: conflicting types for ‘uintptr_t’
/tmp/vmware-config0/vmhgfs-only/vm_basic_types.h:161: error: previous declaration of ‘uintptr_t’ was here
make[2]: *** [/tmp/vmware-config0/vmhgfs-only/cpName.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-server'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmhgfs-only'
Unable to build the vmhgfs module.

To fix this you need to use the open-vmware-tools to create the kernel modules and then install the vmware tools as normal. The problem was solved on the vmware forum: and this fix was then neatly wrapped up on the “Et Cetera” blog.

Installing VMWare-tools on Ubuntu Hardy Heron from the Command Line

Note: These instructions were carried out on kernel 2.6.24-19-server.

First install the headers for your kernel these are needed for compilation:

sudo apt-get install linux-headers-`uname -r`

Now install the following dependency requirements and install the open-vmware-tools:

sudo apt-get install libproc-dev libdumbnet-dev libicu-dev

wget http://mesh.dl.sourceforge.net/sourceforge/open-vm-tools/open-vm-tools-2008.07.01-102166.tar.gz
tar -xzf open-vm-tools-*.tar.gz
cd open-vm-tools-*

./configure --without-x
 make

cd modules/linux

for i in *; do mv ${i} ${i}-only; tar -cf ${i}.tar ${i}-only; done
cd ../../../
mv -f open-vm-tools-*/modules/linux/*.tar vmware-tools-distrib/lib/modules/source/

Finally install the vmware tools as required.

cd vmware-tools-distrib/
sudo ./vmware-install.pl

All being well this should look like this (it’s pretty much a case of saying yes to every default)

Creating a new installer database using the tar3 format.

Installing the content of the package.

In which directory do you want to install the binary files?
[/usr/bin] 	

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc] 

What is the directory that contains the init scripts?
[/etc/init.d] 

In which directory do you want to install the daemon files?
[/usr/sbin] 

In which directory do you want to install the library files?
[/usr/lib/vmware-tools] 

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes] 

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools] 

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes] 

The installation of VMware Tools 1.0.5 build-80187 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes] 

Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:-ne                                   done

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

None of the pre-built vmhgfs modules for VMware Tools is suitable for your
running kernel.  Do you want this program to try to build the vmhgfs 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-19-server/build/include] 

Extracting the sources of the vmhgfs module.

Building the vmhgfs module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmhgfs-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-config0/vmhgfs-only/backdoor.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/backdoorGcc32.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/bdhandler.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpName.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpNameLinux.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpNameLite.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/dentry.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/dir.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/file.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/filesystem.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/fsutil.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/hgfsBd.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/hgfsEscapeLinux.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/hgfsUtil.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/inode.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/kernelStubsLinux.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/link.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/messageBackdoor.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/message.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/module.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/page.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/request.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/rpcout.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/staticEscape.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/stubs.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/super.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/vmhgfs.mod.o
  LD [M]  /tmp/vmware-config0/vmhgfs-only/vmhgfs.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/vmware-config0/vmhgfs-only/vmhgfs.mod.o
  LD [M]  /tmp/vmware-config0/vmhgfs-only/vmhgfs.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-server'
cp -f vmhgfs.ko ./../vmhgfs.o
make: Leaving directory `/tmp/vmware-config0/vmhgfs-only'
The module loads perfectly in the running kernel.

pcnet32                35460  0
Unloading pcnet32 module

Extracting the sources of the vmxnet module.

Building the vmxnet module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmxnet-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-config0/vmxnet-only/vmxnet.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/vmware-config0/vmxnet-only/vmxnet.mod.o
  LD [M]  /tmp/vmware-config0/vmxnet-only/vmxnet.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-server'
cp -f vmxnet.ko ./../vmxnet.o
make: Leaving directory `/tmp/vmware-config0/vmxnet-only'
The module loads perfectly in the running kernel.

No X install found.

Starting VMware Tools services in the virtual machine:
   Switching to guest configuration:-ne                                done

   Guest filesystem driver:-ne                                         done

   Guest vmxnet fast network device:-ne                                done

   DMA setup:-ne                                                       done

   Guest operating system daemon:-ne                                   done

The configuration of VMware Tools 1.0.5 build-80187 for Linux for this running
kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

You can now run VMware Tools by invoking the following command:
"/usr/bin/vmware-toolbox" during an X session.

To make use of the vmxnet driver you will need to rebooot.
Enjoy,

--the VMware team

Post Tools

Comments: Add yours

1. On July 20th, 2008 at 12:35 am onecreativenerd said:

The open-vm-tools download link puts me into an infinite redirect loop. This one works better for me:

http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-2008.07.01-102166.tar.gz

2. On July 20th, 2008 at 12:56 am Alex said:

Thanks for the Hardy VMware Tools how to…works great! -Alex

3. On July 20th, 2008 at 1:04 am onecreativenerd said:

Also, I found that when compiling the open-vm-tools, I could not make in the project root as described. I had to cd to modules/linux and make each module directly before tarring them up and placing them in the vmware folder. Hope this helps!

4. On July 22nd, 2008 at 2:45 am John Adriaan said:

I followed these instructions on a newly-created Ubuntu 8.04 image, but I didn’t have all the packages I needed to recompile the Open VMware Tools, even after installing the list given. I referenced the Et Cetera blog, and found that a few more packages were suggested: libgtk2.0-dev, xorg-dev, libxinerama-dev, libxrandr-dev, and libxtst-dev. Also, there was no mention of the –without-x option in the ./configure line.
Anyway, I added all these packages (not caring which one would fix the problem), re-performed the ./configure –without-x line, and then the make worked.

5. On July 22nd, 2008 at 11:03 am Stuart Colville said:

@John: These instructions are very much geared towards building the vmware tools from the CLI without building it to work with X. This is because I’m running VMs that are headless servers so I don’t need the X dependencies. If you’re running this VM with a UI you’ll want to omit the “–without-x” flag.

6. On July 23rd, 2008 at 12:43 am Darrell said:

I tried to build the open-vm-tools with the option –without-x but the make would fail. I had to install libx11-dev. Then it would compile. I guess maybe a bug on the configure script.

7. On July 24th, 2008 at 11:49 pm dave said:

for Ubuntu Hardy – start to finish in one c&p for the lazy :)

#--vmware tools--
##-SELECT "VM-> install vmware-tools" from vmware server console-##
cd /root
mount /media/cdrom
cp /media/cdrom/VMwareTools-1.0.4-56528.tar.gz /root/
wget http://transact.dl.sourceforge.net/sourceforge/open-vm-tools/open-vm-tools-2008.07.01-102166.tar.gz
tar -xzvf open-vm-tools-2008.07.01-102166.tar.gz
tar -xzvf VMwareTools-1.0.4-56528.tar.gz
apt-get update
apt-get install linux-headers-`uname -r`
apt-get install libproc-dev libdumbnet-dev libicu-dev
apt-get install libx11-dev

cd /root/open-vm-tools-2008.07.01-102166
make
cd modules/linux
for i in *; do mv ${i} ${i}-only; tar -cf ${i}.tar ${i}-only; done
cd ../../../
mv -f open-vm-tools-*/modules/linux/*.tar vmware-tools-distrib/lib/modules/source/
cd vmware-tools-distrib/
./vmware-install.pl
#####--make sure you type "no" at "It looks like you are trying to run this program in a remote session." if you are sshing... it reconnects pretty quickly and you normally won't loose your ssh connection unless something goes horribly wrong.. so maybe this isn't a good idea. ah well works for me.

8. On July 28th, 2008 at 7:19 pm jibeddari said:

Please join forces with me and try to get a hardy backport of open-vm-tools :-)

This would solve having to maintain these tools manually, which is a pain .. when you have more than a few VMs on ESX.

https://bugs.launchpad.net/hardy-backports/+bug/252663

9. On August 4th, 2008 at 1:26 am ed said:

I have found 100’s of Google entries for “patching” VMTools to work with Hardy-Heron. This must represent 1,000s of hours of work documenting the fixes. (btw, each one is slightly different!)

This may be a silly noob question but would it not be easier if someone would just make an APT package out of fix?

10. On August 6th, 2008 at 11:01 pm SunnySeattle said:

This was incredibly helpful to me. Thanks for taking the time to document this.

11. On August 21st, 2008 at 8:16 am Fitz said:

Great work and article. Worked great and sorted out my compilation issues.

12. On September 3rd, 2008 at 8:13 am Aryo said:

Thanks, this document works great for me.
I’m using Ubuntu 7.10 – Gutsy Gibon.
And I’m using updated open-vm-tools-2008.08.08-109361 than this document does.

13. On September 24th, 2008 at 4:36 pm Russ said:

So… the instructions worked beautifully and all’s well… except, I just noticed that lsmod on my Guest OS shows:

:~$ sudo lsmod | grep net
vmxnet 19456 0
pcnet32 35460 0
mii 6400 1 pcnet32

so… I followed the rmmod/depmod routine to leave only vmxnet in place, but when I reboot pcnet32 comes right back up…

any suggestions on avoiding that?

14. On October 7th, 2008 at 11:21 am Ralf said:

Thank you very much!

This worked for me on Debian Etch with 2.6.26 kernel. I had to download the latest open-vm-tools though but it worked!!

15. On October 27th, 2008 at 11:19 am adumont said:

Thanks, it worked very well!

16. On November 13th, 2008 at 6:00 pm mcdermott said:

This didn’t fix my problems, looks similar but did work for me.

17. On November 15th, 2008 at 5:58 pm firestorm_v1 said:

Unfortunately, this did not work for me. make didn’t proceed as it was trying to compile guestAppPosixX11 despite having used the –without-x option.

18. On December 8th, 2008 at 8:16 pm VMWare on Ubuntu 8.10 (Intrepid) - New HowTo « In Search of Equilibrium said:

[...] Ubuntu Hardy – Setting up VMWare Tools from the CLI [...]

19. On March 25th, 2009 at 10:35 pm Pierow said:

You are a lifesaver. Worked like a champ!

20. On October 30th, 2009 at 3:09 am tom said:

only issue with this is you will have to do this each time a new kernel gets installed -> wonder why ubuntu does not come with a apt package like debian does (open-vm-tools, tools and components for VMware guest system)

21. On January 28th, 2010 at 9:54 pm Paul said:

I started this as root in /root and got to the step of:

mv -f open-vm-tools-*/modules/linux/*.tar vmware-tools-distrib/lib/modules/source/

My question is do I create this directory? vmware-tools-distrib/lib/modules/source/

If not where is it and where is the perl vmware-install.pl?







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>



Using Loggerhead with mod_wsgi|(0)

Here’s a post I wrote over on the Project Fondue Blog about our use of Loggerhead with mod_wsgi under Apache. Loggerhead is the rather nice branch viewer for bazaar branches as used on Launchpad.net.

If you’re not already subscribed to the Project Fondue blog feed then I can recommend it, as there should be some interesting posts coming out of there in the coming months (yes I’m unashamedly biased!).

Ubuntu: Turn off changing workspace with mouse wheel|(1)

I found the changing with the workspace with the mouse wheel really annoying. To disable it go to System => Preferences => CompizConfig (available if the compizconfig-settings-manager package is installed) and uncheck “Viewport Switcher” which is under the “Desktop” heading.

Photos on Flickr

© Copyright 2004-10 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.588s.