Build the latest open-vm-tools from source and deploy it across your entire VMware infrastructure with a single Ansible role — no manual compiling, no distro-specific headaches.
The open-vm-tools packages bundled with most Linux distros are months or years behind the upstream release. This matters when you need:
- Fixes for guest OS compatibility with newer ESXi/vCenter versions
- VMCI socket support and improved balloon memory driver
- CVE patches not yet backported by your distro
This role compiles the latest release inside isolated Docker containers (no build deps polluting your controller), produces clean .deb/.rpm packages, and deploys them via Ansible — all in one go.
- Builds from the latest upstream open-vm-tools release
- Fully containerized build (Docker) — clean, reproducible, no host pollution
- Multi-distro support: Ubuntu, Debian, RHEL/Rocky/Alma 8+9, Fedora
- Handles all three deployment scenarios automatically:
- Fresh install
- Upgrade from existing custom build
- Replace distro-packaged
open-vm-tools
- Auto-diagnose & recovery if
vmtoolsdfails to start - Available on Ansible Galaxy
git clone https://github.com/GiulioSavini/vmware-tools-builder.git
cd vmware-tools-builder/containers
# Build for all supported distros (latest version)
./build-all.sh
# Single distro
./build-all.sh --target rocky9
# Pin a specific version
./build-all.sh --version 12.5.0Packages are generated in output/ and copied to files/ automatically.
ansible-galaxy install giuliosavini.vmware_tools_builder[debian]
srv-web01 ansible_host=10.0.0.1
[rhel]
srv-app01 ansible_host=10.0.0.10
[all:vars]
ansible_user=rootansible-playbook -i inventory.ini playbook.yml| Distro | Build container | Deploy | Package |
|---|---|---|---|
| Ubuntu 22.04+ | ✅ | ✅ | .deb |
| Debian 12+ | ✅ | ✅ | .deb |
| RHEL / Rocky / Alma 9 | ✅ | ✅ | .rpm |
| RHEL / Rocky / Alma 8 | ✅ | ✅ | .rpm |
| Fedora | ✅ | ✅ | .rpm |
| SUSE / openSUSE | — | ✅ | .rpm |
| Tool | Minimum version |
|---|---|
| Docker | 20.10+ (build host) |
| Ansible | 2.12+ |
| Python | 3.8+ |
| Variable | Default | Description |
|---|---|---|
vmtools_pkg_name |
open-vm-tools-custom |
Package name |
vmtools_prefix |
/usr/local |
Install prefix |
vmtools_service |
vmtoolsd |
Systemd service name |
vmtools_packages_dir |
{{ role_path }}/files |
Pre-built packages directory |
vmtools_remove_standard |
true |
Remove distro open-vm-tools before install |
vmtools_diagnose_on_failure |
true |
Run diagnostics if service fails |
vmtools_auto_recover |
true |
Attempt automatic recovery |
vmtools_cleanup_temp |
true |
Remove temp files from target hosts |
For each host the role:
- Preflight — detects OS, installed packages, selects the right
.deb/.rpm - Deploy — copies and installs the package (
apt/yum/zypper) - Post-install — configures
ldconfig, systemd unit, masks the old service - Diagnose — if
vmtoolsdfails to start, collects logs and attempts recovery - Verify — confirms the service is running and prints the installed version
- name: Deploy custom open-vm-tools
hosts: all
become: true
gather_facts: true
roles:
- role: giuliosavini.vmware_tools_builder
vmtools_remove_standard: true
vmtools_diagnose_on_failure: truevmware-tools-builder/
├── containers/
│ ├── build-all.sh # Multi-distro build orchestrator
│ ├── build-inside-container.sh # Runs inside the container
│ ├── Dockerfile.ubuntu2204
│ ├── Dockerfile.debian12
│ ├── Dockerfile.rocky9
│ ├── Dockerfile.rocky8
│ └── Dockerfile.fedora
├── tasks/
│ ├── main.yml
│ ├── preflight.yml
│ ├── deploy_debian.yml
│ ├── deploy_rhel.yml
│ ├── deploy_suse.yml
│ ├── post_install.yml
│ ├── diagnose.yml
│ └── verify.yml
├── templates/
│ ├── vmtoolsd.service.j2
│ └── vmware-tools.conf.j2
├── defaults/main.yml
├── handlers/main.yml
├── playbook.yml
└── inventory.ini
MIT — see LICENSE