Skip to content

GiulioSavini/vmware-tools-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vmware-tools-builder

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.

Ansible Galaxy License: MIT open-vm-tools


Why this project?

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.


Features

  • 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 vmtoolsd fails to start
  • Available on Ansible Galaxy

Quick Start

1. Build packages

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.0

Packages are generated in output/ and copied to files/ automatically.

2. Install via Ansible Galaxy

ansible-galaxy install giuliosavini.vmware_tools_builder

3. Write your inventory

[debian]
srv-web01  ansible_host=10.0.0.1

[rhel]
srv-app01  ansible_host=10.0.0.10

[all:vars]
ansible_user=root

4. Run the playbook

ansible-playbook -i inventory.ini playbook.yml

Supported platforms

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

Requirements

Tool Minimum version
Docker 20.10+ (build host)
Ansible 2.12+
Python 3.8+

Role variables

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

How the deploy works

For each host the role:

  1. Preflight — detects OS, installed packages, selects the right .deb/.rpm
  2. Deploy — copies and installs the package (apt / yum / zypper)
  3. Post-install — configures ldconfig, systemd unit, masks the old service
  4. Diagnose — if vmtoolsd fails to start, collects logs and attempts recovery
  5. Verify — confirms the service is running and prints the installed version

Example playbook

- 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: true

Repository structure

vmware-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

License

MIT — see LICENSE

Author

GiulioSavini

About

Build latest open-vm-tools from source (.deb/.rpm) and distribute via Ansible

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors