vmctl is a Windows command-line interface for controlling VMware Workstation virtual machines. It reads VMware's registered VM inventory and uses vmrun.exe to list, start, stop, wait for, and delete VMs.
Run it without arguments for an interactive menu, or use subcommands in scripts and terminal workflows.
- Lists every registered VM and its current power state
- Starts VMs headlessly by default, with an optional GUI
- Stops VMs gracefully by default, with an optional hard power-off
- Waits until a guest has an IP address and responds to ping
- Produces JSON inventory output for scripts
- Confirms destructive deletes and reports snapshots that will also be removed
- Treats repeated start and stop operations as successful no-ops
- Windows x64
- VMware Workstation with at least one registered VM
- .NET 10 SDK when building from source
- VMware Tools installed and running in guests when using automatic IP detection with
wait
vmctl locates vmrun.exe in the standard VMware Workstation installation directory, on PATH, or through VMware's Windows registry entry.
Build and run the interactive menu:
dotnet run --project .\src\VmCtlRun a subcommand by placing its arguments after --:
dotnet run --project .\src\VmCtl -- list
dotnet run --project .\src\VmCtl -- start "Ubuntu Dev" --waitIf you have a published executable, add its directory to PATH and invoke it directly:
vmctl list
vmctl start "Ubuntu Dev" --waitvmctlThe interactive menu supports listing, starting, stopping, waiting for, and deleting registered VMs.
vmctl list
vmctl list --json--json returns a sorted array with each VM's name, status, and .vmx path.
vmctl start <name-or-path> [--gui] [--wait] [--timeout <seconds>] [--ip <address>]- VMs start headlessly unless
--guiis supplied. --waitwaits for the guest to become reachable.--timeoutcontrols the wait timeout and defaults to 120 seconds.--ipskips VMware Tools IP detection and pings a known guest address directly. It is only used with--wait.
Examples:
vmctl start "Ubuntu Dev"
vmctl start "Windows Lab" --gui
vmctl start "Ubuntu Dev" --wait --timeout 300
vmctl start "Minimal Linux" --wait --ip 192.168.1.50Starting an already-running VM succeeds without starting it again.
vmctl wait <name-or-path> [--timeout <seconds>] [--ip <address>]By default, vmctl waits for VMware Tools to report the guest IP, then polls that address with ICMP ping. Supply --ip when the guest is reachable but VMware Tools is unavailable. The VM must already be running.
vmctl stop <name-or-path> [--hard]The default is a graceful guest shutdown. --hard powers the VM off immediately. Stopping an already-stopped VM succeeds without invoking another stop.
vmctl delete <name-or-path>
vmctl delete <name-or-path> --yesDeletion permanently removes the VM and its files. vmctl refuses to delete a running VM, displays any snapshots that will also be deleted, and asks for confirmation by default. Use --yes or -y to skip the prompt in automation.
Commands accept either:
- An exact, case-insensitive VMware inventory display name
- A direct path to a
.vmxfile
Names containing spaces must be quoted. Partial names are not executed automatically; when possible, vmctl reports matching names as suggestions. If duplicate display names exist, use the full .vmx path to disambiguate them.
vmctl start "Ubuntu Dev"
vmctl start "C:\Virtual Machines\Ubuntu Dev\Ubuntu Dev.vmx"VM inventory is read from the current Windows user's VMware inventory file:
%APPDATA%\VMware\inventory.vmls
From the repository root:
dotnet restore .\VmCtl.slnx
dotnet build .\VmCtl.slnx
dotnet test .\VmCtl.slnxPublish a Windows x64 executable:
dotnet publish .\src\VmCtl\VmCtl.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o .\publish\win-x64The published executable is written to publish\win-x64\vmctl.exe.
vmctltargets VMware Workstation (vmrun -T ws); it does not target VMware Fusion or Player.- Readiness checks require ICMP ping to be allowed by the guest and network unless another known reachable IP is supplied.
- Commands return a non-zero exit code when resolution, VMware, inventory, or readiness operations fail.