How to install vmware tools in FreeBSD 9

To install vmware tools in FreeBSD 9, follow these instructions…

First, ensure that you have perl and compat6x ports/packages installed.

You can use pkg_add -r perl5 compat6x (or pkg_add -r perl compat6x-amd64 if the previous command does not work – substitute amd64 for i386 if installing i386 edition!) for pre-compiled, or use the ports tree.

Next, in vSphere client go to guest -> install vmware tools.  This will mount the tools CDROM in the virtual machine.

Next, we need to mount the cd drive, extract the data, unmount the cd drive and install the tools – do the following as root:

mkdir -p /cdrom
mount -t cd9660 /dev/cd0 /cdrom
cd /tmp
gunzip -c /cdrom/vmware-freebsd-tools.tar.gz | tar xf –
umount /cdrom
cd vmware-tools-distrib/

At this point, accept all the defaults (press enter to all questions) until you are returned to a shell prompt.  Ignore the ‘failed’ service start, and the fact that it says the process has been aborted.

Next, you need to use your favourite editor to edit the file /usr/local/etc/rc.d/ and locate the following 3 lines of code (they are separated by a few lines of code but are all in the same general area):

if [ “$vmdb_answer_VMHGFS_CONFED” = ‘yes’ ]; then
if [ “$vmdb_answer_VMMEMCTL_CONFED” = ‘yes’ ]; then
if [ “$?” -eq 0 -a “$vmdb_answer_VMXNET_CONFED” = ‘yes’ ]; then

There will also be (not grouped together like the above line) the following line in the file:

if [ “$vmdb_answer_VMBLOCK_CONFED” = ‘yes’ ]; then

Change each of the above lines where it says yes to be xyes (add the letter X before the word yes) – then save&exit the file.

Now we need to tell vmtools that it is configured by typing the following:

rm /etc/vmware-tools/not_configured

Now you can restart vmtools without rebooting like so:

/usr/local/etc/rc.d/ restart

Now, you will need to Edit Settings in vSphere client and set your cdrom drive back to the client device.

Each time your virtual machine boots up, it will boot the vmtools and work as expected.

33 thoughts on “How to install vmware tools in FreeBSD 9

  1. Frido Gaastra

    Hi Dan,

    You’re just disabling some VMware Tools components that are not (yet) functioning on FreeBSD 9.
    What is the function of these components and are they not important?

    1. dan Post author

      They provide accellerated networking (not needed when using the intel driver that it defaults to), and some block drivers.
      The main purpose for getting the tools installed is so that you can monitor the virtual machine state, and use the guest OS shutdown/restart features.
      The drivers included in the tools do not work in FreeBSD 8 or 9 – although vmtools does install under FreeBSD 8 without having to change anything.

    1. dan Post author

      open-vm-tools has massive dependency requirements. The binary vm-tools from vmware has just two (of which one is almost certainly going to be used on your machine anyway)

  2. Sean

    ended up being a xorg.conf problem!

    just uncommented all the Options under InputDevice for my keyboard. More details in the thread that I linked to above. Thanks

  3. fernando

    Hey Dan, that instruction helped me a lot too. To backup the FreeBSD server VMware client the backup tool Tivoli VCB needed the vmware tools installed. But the service failed to start with message “No X install found”. So with your settings I got the vmware tools installed and now we can run the Tivoli VCB backup. Thanks

  4. IT_Architect

    I think there has been a change somewhere. Following these instructions doesn’t not allow the tools to start.

    It errors out with:
    “Blocking file system:KLB vmblock.ko: depends on kernel – not available or version mismatch
    linker_loadfile: Unsupported file type”

    I think there needs to a plan b that includes recompiling these.

    VMWorkstation 8 updated to latest yesterday
    FreeBSD 9 64 downloaded and installed today

    1. dan Post author

      If you’re getting that message then you might not have made all the changes in the article (they are designed to prevent those things from attempting to load)
      My instructions just stops the tools from loading any drivers into the kernel – it purely loads the vmtools daemon which allows communication between the host and guest.

  5. IT_Architect

    This is what worked for me.
    – If it’s a server, edit /etc/make.conf and add: WITHOUT_X11=yes
    – Install latest Perl
    – Install tools (Takes forever and pulls python and ruby. Doesn’t do any good to pre-install them because it uses the version it wants to use even if they are there. Pulls loads of stuff, but when it’s finished, everything works perfectly.
    # make install clean -C /usr/ports/emulators/open-vm-tools

  6. IT_Architect

    >If you’re getting that message then you might not have made all the changes in the article (they are designed to prevent those things from attempting to load)<

    I followed the article to a T. It didn't work. It got rid of the errors that the article shows to block out, that part worked good. I didn't get any of those errors anymore, but I was still left with the "Blocking file system:KLB vmblock.ko" error. Either something changed, or for a normal server install, what is needed is not installed. This method also does not rely on compat6x.

    1. dan Post author

      It seems vmware workstation 8 does things a little different to vSphere… i’ve updated the post to include instructions to stop it loading the vmblock.ko file also.

  7. IT_Architect

    >It seems vmware workstation 8 does things a little differenti’ve updated the post to include instructions to stop it loading the vmblock.ko file also.<

    I just rolled back to a previous snapshot and tried your modified instructions. They resulted in a perfect install.

    I've tried both of these methods, and they both work:
    1. The method outlined here. It requires a little editing and comapt6, but it is far and away the fastest way to add them, makes the fewest system changes, and allows you to use the tools from VMware.
    2. From FreeBSD packages or ports, open-vm-tools or open-vm-tools-nox11 just install and work. They don't require compat6, but uses open source VM tools.

    Thanks for taking the tine to publish this. This is a solution for a problem that has frustrated many.

  8. Qasim

    Thanks Jared …. Error “Blocking file system:KLB vmblock.ko: depends on kernel –” is FIXED …..

  9. Chris

    Thanks for this! Had no idea what to do when the script simply said “aborted”, and not much info forthcoming from VMware website.

  10. allen

    A few months later, but just FYI, the vmware tools included with ESX 5.1 now ‘officially’ support FreeBSD 9. No need to hack startup scripts or anything else. Just do the normal install by un-tarballing the package on the (virtual) CD and running the installer. That’s it.

    If you’re using open-vmware-tools, make sure you uninstall it first — uninstalling it after will result in it deleting files installed by the ‘real’ installer.

    Once it’s up and running you can switch over to the vmxnet3 network driver which does have some big performance and feature gains over the intel driver.

  11. anonymous

    This method don´t work with pfsense 2.1 final and esxi 5.1, you get:

    “Can’t locate in @INC (@INC contains: /usr/local/lib/perl5/5.12.4/BSDPAN /usr/local/lib/perl5/site_perl/5.12.4/mach /usr/local/lib/perl5/site_perl/5.12.4 /usr/local/lib/perl5/5.12.4/mach /usr/local/lib/perl5/5.12.4 .) at ./ line 18.”

    I think it is because the perl package you inject with “pkg_add -rv compat6x-amd64” itself is broken,
    I got 1000+ line like “lib/perl5/5.12.4/unicore/lib/OMath/ Write to restore size failed”

    OpenVM-Tools package 8.8.1 from pfsense is broken too. This is totally embarrassing.

    1. dan Post author

      It’s possible that pfsense and similar modified versions of FreeBSD lack the required space to install the pre-requisites.
      I’ve never really played with pfsense/freenas/etc myself, so can’t give a definitive answer 🙁
      Please remember that, although pfsense is based on FreeBSD it is not FreeBSD – they do modify it.

  12. Peter

    Unfortunately you can not install VMware Tools with Xorg and gnome graphical desktop 2 in a virtual machine with VMware 9.2 running FreeBSD 9.2 system.

    The (perl) which will be installed automatically with the graph of Xorg and gnome, some solucions?.


Leave a Reply

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