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
cd /tmp
tar xvzf /mnt/cdrom/vmware-freebsd-tools.tar.gz
cd vmware-tools-distrib
./vmware-install.pl -d --clobber-kernel-modules=vmxnet3,pvscsi,vmmemctl
All done!
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.
Thanks! All we need in one place.
ReplyDeleteLooks interesting, but I'm not sure about IPv6 support?
ReplyDeletePersonally I abandoned Endian
ReplyDeleteNot that much updates
Not support
Almost no community
Pfsense is the way especially for IPV6
I have one question
Why don't you use the vmtools package ????
The open-vm-tools package does no longer include the vmxnet3 driver, and I was advised that the vmxnet3 adapter offers better performance over the e1000 adapter.
Delete- Andreas
aah
ReplyDeletesustained
I'll try your way :)
I followed this method, but had to do it in console session via VMware vSphere Client as I found I didn't have the right permissions to perform step 3 from an SSH session.
ReplyDeleteAfter then performing your steps above, I then set both NIC's "Speed and duplex" to "10Gbase-T". Works GREAT with my 100mbps FTTP connection :D
Also, just a question, would this work better as a pfSense Package? I've noticed that if you do update pfSense via System -> Firmware, it automatically re-installs the previously installed packages after updating pfSense, so would fix the problem of having to manually repeat the steps required after updating. More info here on packages; http://doc.pfsense.org/index.php/Developing_Packages
I do not understand your permissions issue. Were you not able to log on via ssh as root? Or were you logged on as root, but could not run the commands? Any error messages?
DeleteRegarding the package: The Open Source variant of the VMware Tools (open-vmtools) is available as a package, but lacks the vmxnet3 driver (see comment above). I'm not sure if you can make the proprietary Tools available as a package, because they are closed source.
I'm running the recent 2.1rc snapshot and have install the vmtools as per your guide:
ReplyDeleteAfter every reboot, ESXi reports in the "Summary" section "Not running (Not installed)" and I have to repeat the process.
Thoughts?
Just one thought: Can you please check if a file named /etc/vmware-tools/not_configured exists on your system even after you have gone through all the steps?! If yes then delete it and try again.
Deletehad the same problem, deleting the file worked for me, thanks
DeleteSo some reason the /etc/vmware-tools/not_configured file always reappears after every reboot. Others experiencing the same? pfsense 2.1 and esxi 5.1
DeleteAnonymous, are you just deleting the file, or are you running
Delete/usr/local/bin/vmware-config-tools.pl -d --clobber-kernel-modules=vmxnet3,pvscsi,vmmemctl
before rebooting?
I'm just deleting the file with rm -f as per this guide: https://doc.pfsense.org/index.php/VMware_Tools
Deleteand I am not running the above before rebooting. The file seems to come back after every reboot.
Anonymous, instead of manually deleting the file please run the vmware-config-tools.pl script as indicated above. This will re-configure the tools and also delete the not_configured file. Then reboot and check if the file returns.
DeleteHey Guys, sorry for dragging this back up , but thought i'd try and explain what I have found on my installation..(PfSense 2.1 , ESXi 5.5)
Deletewhen i run
/usr/local/bin/vmware-config-tools.pl -d --clobber-kernel-modules=vmxnet3,pvscsi,vmmemctl
my vmtools then shows up running.. and there is no /etc/vmware-tools/not_configured file.
if i then reboot pfsense , it starts normally including vmtools, but a check shows /etc/vmware-tools/not_configured file now exists, meaning that after the NEXT reboot , I will not have a running vmtools any more. (unless i delete the /etc/vmware-tools/not_configured file beforehand.) I'll probably setup a crontab or similar to routinely look for and delete the file if it exists.
Hi GarFin,
DeleteI also looked into this issue and noticed that the not_configured file is created by the VMware Tools boot script /usr/local/etc/rc.d/vmware-tools.sh whenever it thinks that something went wrong.
You can just uncomment the code there, but this change will be reverted on the next update or re-installation of the Tools.
Andreas
I Andreas,
ReplyDeleteI am trying to install vmtools VMware Tools 8.6.10 build-913593 on pfsense 2.0.3-RELEASE
During install /vmware-install.pl an error appears "ELF binary type "0" not known" ... Execution aborted.
an idea
Thanks
Vincent
Hi Vincent,
Deletehave you installed the packages from step 3?
Andreas
Thanks ;)
ReplyDeleteI want to give you a bid ol', trans-internet, bear hug. This just worked beautifully.
ReplyDeleteInterestingly enough the NIC names are much longer on VMXNET3 (mine were vmx3f0 and vmx3f1) which caused the names to be flush with their MAC addresses. Took a moment to realize where the name ended and the MAC started.
While it seems you can get the tools to run, from looking on the vm showing them running - to the ability to restart/shutdwon the vm via command.
ReplyDeleteboth the esxi client or vcenter seem to have issue - where they say a tool is running. But show it not installed with red !
I also experienced this strange behavior after upgrading to ESXi 5.5.
DeleteI could fix it with the following steps:
1. Choose "Install VMware Tools" from the VM's console menu
2. Wait a few seconds, then choose "End VMware Tools install".
3. Wait a few seconds, refresh the VM view, and the status might eventuell change to "Installed".
Andreas, thanks for this workaround, worked very nice for me under 5.5 and freebsd 9.2.
DeleteAlso had status installed, with ip displayed in the summary view of the VM, but announced as not running.
Restart install vmware tools wait few second and stop solved the problem, now it's running and installed ;-)
Just wanted to drop a line to say thanks.
ReplyDeleteYou're welcome. I'm glad that you found my post useful.
DeleteGreat Post! On ESXi 5.5 with pfsense 2.1 this works perfectly for me. Thanks, Vincent
ReplyDeleteAndreas Peetz,
ReplyDeleteThanks for this great article. I was able to install 2 VMs using this method. However on my 3rd VM, following all same instructions, i run stubbornly to this error in the last command:
$ ./vmware-install.pl -d --clobber-kernel-modules=vmxnet3,pvscsi,vmmemctl
./vmware-install.pl: not found
what might be the problem? your advice and ideas will be of great help.
Hi Darkangel64,
Deletehave you followed all the steps before? Did the tools tgz file properly unpack? Is Perl installed? Is is the 32bit-version or the 64bit-version?
Andreas
Great post and thank you!
ReplyDeleteThanks for your article !
ReplyDeleteDavid.
Just a gotcha:
ReplyDeleteShould you get an error similar to the following when adding the packages:
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/Latest/perl.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.3-release/Latest/perl.tbz' by URL
pkg_add: 1 package addition(s) failed
This is due to the fact the release lcoation is coded to look for 8.3 release (which is no longer available)
I have successfully used the 8.4 versions following the above steps but you need to set the PACKAGESITE environment variable using the following command in order to point the pkg_add command at the correct location:
setenv PACKAGESITE ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/ports/amd64/packages-8.4-release/Latest/
Enjoy!
Great, thanks for sharing, James!
DeleteThanks for the post, something funny however. Tools install fine, restarting the VM all seems well. However when I power off and power it back on keeps saying "Not Running (Current)" Any ideas?
ReplyDeleteHi loneferret,
Deleteplease see the other comments above.
Andreas
What should I comment out of the /usr/local/etc/rc.d/vmware-tools.sh file so I don't lose vmtools on reboot?
ReplyDeleteThe section looks like this:
Deleteif [ "$exitcode" -gt 0 ]; then
# Set the 'not configured' flag
touch "$vmware_etc_dir"'/not_configured'
chmod 644 "$vmware_etc_dir"'/not_configured'
db_add_file "$vmware_db" "$vmware_etc_dir"'/not_configured' \
"$vmware_etc_dir"'/not_configured'
exit 1
fi
Comment out the whole section by putting a # in front of every line.
Andreas
Thanks that worked!
ReplyDeleteHi,
ReplyDeleteI could not find ldconfig
Try /sbin/ldconfig instead. Make sure that your are logged in as root.
DeleteThis article was a big help for me und er 2.1.5. It would be great if you could update it for 2.2.
ReplyDeleteI'm looking into this... Actually I got it already working, but ran into strange networking issues after that. I need to test different install and upgrade scenarios.
DeleteAnyway, pfSense 2.2 is based on FreeBSD 10.1, and that already includes a vmxnet3 driver, so maybe you do not really need the "official" VMware Tools.
I have a problem with VMware Tools, because the VMware supplied vmxnet3 adapter doesn't really work well, but the open-vm-tools package works ... sort of. You need to fix / work around two glitches - see this pfSense forums' post.
DeleteAndreas
In my case the vmxnet3 driver that comes with pfSense/FreeBSD doesn't work at all. I can assign interfaces and IP adresses, but I cannot ping the host or access the configurator. Pinging google from the pfSense shell works however. I tried 32 and 64 bit versions.
ReplyDeleteI assume the OS supplied vmxnet3 driver is working for you?
I assume you are referring to pfSense 2.2 (FreeBSD 10.1) now? You should have commented on the new post then ...
DeleteBut well that's funny. For me the builtin vmxnet3 driver works well.
sorry, yes I was referring to the previous post
DeleteI'll keep trying :)
It seems the Windows VM I used to access pfSense was broken. I got is working now and the included vmxnet3 driver is working nicely.
Delete