Monday, March 3, 2014

vmtoolsd on Fedora 20

You just loaded up a new VM with Fedora 20 in Fusion, and you're getting ready to load up VMTools as part of your build process. So you head over to the Virtual Machine menu, but you don't see an option to install VMTools. Just an option to re-install. How can this be?

Last spring, a bug was filed to start vmtoolsd automatically if the OS detects that it's running on a VMware infrastructure. Pretty slick. open-vm-tools has been included with Fedora since 17, but it wouldn't start automatically. That led to many admins loading up VMware's VMTools when they didn't need to. Not a big deal, really. But it's time that could be spent on other tasks (and sometimes, installing VMware's VMTools can be messy).

So how does vmtoolsd know when to start? It's surprisingly simple and elegant, as far as Linux config files goes. Fire up your Terminal and let's see what's going on here.

The vmtoolsd.service file

The vmtoolsd.service file located at /etc/systemd/system/multi-user.target.wants contains a statement that makes this auto-start on VMware products possible. It's the ConditionVirtualization=vmware statement on line 4.

This statement will make vmtoolsd start automatically when the OS detects that it's running on a VMware product. vmtoolsd will start automatically when the VM is running on any VMware hypervisor, and will NOT start if it's hosted on any other hypervisor.

So quit worrying about loading up VMTools on your Fedora VMs. open-vm-tools is on the job.