Update 2015-01-26: If you are using pfSense 2.2 then please refer to this newer post: pfSense 2.2 was released - How to install VMware Tools (sort of). The following instructions are still valid for pfSense 2.0 and 2.1.
Update 2016-05-04: If you are using pfSense 2.3 (or newer) then please do not follow this guide, or it will break your system! Use the pfSense Package Manager to install the open-vm-tools package instead!
I blogged before about pfSense, the Open Source FreeBSD-based router and firewall appliance that I use in my hosted virtual lab (SBHVL) to implement IPv6-capable routing and firewalling and connecting two hosts through an OpenVPN tunnel.
I use the current development branch pfSense 2.1, because it supports IPv6. After a long beta phase it has recently reached Release Candidate (RC) status, and this inspired me to update my appliances, although I didn't have any problems with the beta build that I was using before.
After updating I had the challenge to get the VMware Tools up and running again.
There are already several blog posts available on how to do this, but I found each of them to be either incomplete, missing important caveats or hard to follow. So I decided to write my own quick check list for this task and to share it of course. Here are the necessary steps to install VMware Tools for the first time on a newly installed pfSense box (They require that pfSense itself is already configured at least to such an extent that it can access the Internet):
1. Check if the pfSense VM has a CD-ROM drive configured in its virtual hardware. If not add one of type IDE.
2. Enable ssh in pfSense by following the instructions from the pfSense docs. This is not really necessary for VMware Tools, but will let you easily use cut-and-paste into a putty terminal window for the following shell commands. This will also avoid keyboard-mapping problems that you might have at the console (Note: By default ssh will only be enabled on the internal LAN interface, so it's not a big security risk).
3. Install additional packages needed by VMware Tools by running the following commands in a shell:
pkg_add -rv perl
pkg_add -rv compat6x-i386
(OR: pkg_add -rv compat6x-amd64, if you have deployed the 64bit version of pfSense)
These commands will download the packages from the FreeBSD repositories, so you need to have a working Internet access at this time!
4. Fix the Shared Libraries Configuration by editing the file /etc/rc (with vi /etc/rc): Find the line starting with ldconfig and add the directory /usr/local/lib/compat at its end so that it look like this:
/sbin/ldconfig -elf /usr/lib /usr/local/lib /lib /usr/local/lib/compat
Also run this command interactively now to make the change effective!
5. Start the VMware Tools install at the pfSense VM's console by choosing "Install/Upgrade VMware Tools" from the VM/Guest menu. This will attach the Tools ISO to the VM's CD drive.
Then run the following commands in a shell:
mkdir -p /mnt/cdrom
mount_cd9660 /dev/acd0 /mnt/cdrom
tar xvzf /mnt/cdrom/vmware-freebsd-tools.tar.gz
./vmware-install.pl -d --clobber-kernel-modules=vmxnet3,pvscsi,vmmemctl
If you want to update VMware Tools at a later time then you just need to repeat step 5.
If you have updated the pfSense firmware (through the System/Firmware WebConfigurator menu) then you need to repeat step 4. Then re-configure VMware Tools in order to make them automatically start at boot time again by running the following command:
/usr/local/bin/vmware-config-tools.pl -d --clobber-kernel-modules=vmxnet3,pvscsi,vmmemctl
These instructions apply to both pfSense 2.1 and 2.0. I hope that someone will find them useful.