How benevo/esxi-unlocker works
1. Repository purpose
This repo is a small ESXi-side patching package, not an application server. Its job is to modify VMware ESXi host binaries so macOS guests can boot and be managed correctly.
2. Main architectural boundary
There are two distinct environments: the build/distribution side and the ESXi host side. esxi-build.py appears to produce the release artifact, while the install/uninstall/test scripts and etc/rc.local.d/unlocker.py run on the ESXi host itself.
3. Host patching core
The central behavior is in the unlocker logic, which targets two VMware components: vmware-vmx for macOS boot support and libvmkctl for vSphere guest control. The architecture is therefore a binary patcher layered on top of VMware’s own ESXi runtime.
4. Startup integration
etc/rc.local.d/unlocker.py indicates the patcher is wired into ESXi boot-time initialization. That means the patch is applied automatically during host startup unless explicitly disabled, rather than being a one-time manual edit.
5. Operational lifecycle
The repo is organized around three host operations: install, validate, and uninstall. esxi-install.sh applies the unlocker, esxi-smctest.sh checks whether the patch is active, and esxi-uninstall.sh reverses the changes.
6. Persistent activation and rollback
The README’s warning about uninstalling the previous version first suggests the patch changes persistent system files on the ESXi host. The uninstaller is therefore an important safety boundary, because the repo is designed to both apply and cleanly remove low-level binary modifications.
7. Boot-time control surface
A notable runtime control is the nounlocker boot option, which disables the unlocker temporarily during startup. This gives the architecture a built-in bypass path for recovery and troubleshooting without removing the package.
8. Packaging and distribution flow
The intended delivery format is a tarball copied onto the datastore, extracted on the host, and then executed from the ESXi shell or SSH. So the repo is distributed as a host-local filesystem package rather than through a centralized service or package manager.
9. Validation path
esxi-smctest.sh is the verification entry point. Its expected output mentions /bin/vmx, smcPresent = true, and custom.vgz, showing that validation is focused on confirming the modified ESXi binaries and the SMC-related macOS support state.
10. Technology constraints
The implementation is Python-centric for ESXi compatibility, with shell scripts used for orchestration. The repository is specifically aimed at ESXi 6.5 and 6.7, so the architecture is tightly coupled to VMware’s host binaries and boot layout for those versions.
11. Overall system view
At a high level, the flow is: package the unlocker, deploy it to an ESXi host, patch VMware host binaries at install or boot time, optionally verify the patch, and provide a rollback path via uninstall or boot-time disablement. There are no external networked services in the architecture beyond transferring the distribution to the host.
Main entry points: unlocker.py Boot hook · esxi-smctest.sh SMC test · esxi-uninstall.sh Uninstall · esxi-install.sh Install
Components 14
Build & package
Creates the distributable unlocker archive from the repository sources.
- Build script · Assembles the release artifact for deployment to an ESXi host.
esxi-build.py - Release tarball · The tarball copied to the ESXi datastore and extracted on-host.
ESXi host runtime
Components that execute on the ESXi host to patch, verify, or roll back VMware binaries.
- Host bundle · Extracted files and scripts that are run from the ESXi shell or SSH.
- Install · Applies the unlocker package onto the ESXi host.
esxi-install.sh - Boot hook · Launch point wired into ESXi startup for automatic activation.
etc/rc.local.d/unlocker.py - Unlocker core · Coordinates the host-side patching logic and runtime control.
- vmware-vmx patch · Modifies VMware's VM process to support macOS guest boot behavior.
- libvmkctl patch · Modifies VMware's guest control library to enable vSphere-side support.
- nounlocker · Startup flag that temporarily disables unlocker execution for recovery.
- SMC test · Checks whether the ESXi patches are active and macOS support is present.
esxi-smctest.sh - Uninstall · Reverses the host-side changes made by the unlocker.
esxi-uninstall.sh - /bin/vmx · Target runtime whose patched state is validated by the test script.
- SMC state · Indicates macOS guest support status such as smcPresent being true.
- custom.vgz · Expected artifact or marker used to confirm the unlocker is active.
Connections 14
- Build script → Release tarball: packages · Build script creates the deployable archive.
- Release tarball → Host bundle: extracts · The archive is copied to datastore and unpacked on the ESXi host.
- Host bundle → Install: invokes · Installer runs from the extracted host-side bundle.
- Install → Boot hook: installs · Installer wires the unlocker into ESXi startup.
- Boot hook → Unlocker core: launches · Boot-time hook executes the Python unlocker.
- nounlocker → Boot hook: disables · Boot option bypasses unlocker execution during startup.
- Unlocker core → vmware-vmx patch: patches · Core logic modifies vmware-vmx for macOS boot support.
- Unlocker core → libvmkctl patch: patches · Core logic modifies libvmkctl for guest control support.
- vmware-vmx patch → /bin/vmx: affects · Patched binary is validated through the VM runtime path.
- SMC test → /bin/vmx: checks · Test script inspects the modified VM runtime.
- SMC test → SMC state: expects · Verification confirms SMC-related state is enabled.
- SMC test → custom.vgz: expects · Verification looks for the unlocker-specific marker.
- Uninstall → Unlocker core: reverts · Uninstaller removes or undoes unlocker changes.
- Uninstall → Boot hook: removes · Rollback clears boot-time integration.