31 May 2020

VMWare Workstation Automation (on Windows)

First up, enable the GUI so that you can get familiar with the (REST) API.

PS C:\Program Files (x86)\VMware\VMware Workstation> .\vmrest.exe -C

VMware Workstation REST API
Copyright (C) 2018-2019 VMware Inc.
All Rights Reserved

vmrest 1.2.0 build-14665864


New password:
Retype new password:

Credential updated successfully

Then, don’t forget to start the service: .\vmrest.exe

It’ll let you know where to connect:

Serving HTTP on

You can open the web page being served by vmrest to view the REST API documentation and to execute requests in the UI. You can also authorize the requests by clicking “authorize” in the top right corner and supplying the password you configured when you used the -c parameter.

The sample requests will include the authorization information if you do that. The password will be base64 encoded.

That means, to use powershell you’d do something like:

$headers = @{
    "Authorization"="Basic abcBlahBlahYaddaYa=="


Invoke-RestMethod -Uri -Headers $headers

Example Output:

PS C:\Users\ChadDuffey> Invoke-RestMethod -Uri -Headers $headers

id                               path
--                               ----
F7G7IGFGK9KDT7UD72J24EL9AN9NPPPF D:\Ubuntu-Dev\Ubuntu Dev.vmx
KR5VJF8603O2NP18J8TNIGN0V8TKNOH9 D:\Win2k3-2\Win2k3-2.vmx
T5E8QNC0QPF842N8CAH8IPMF78VCNMDJ D:\client1\Client1.vmx
1SO7UAOVNQLT9OHVOH559JOJQP0K76HL D:\commando\Commando.vmx
GKGHD4J36FAQ5MGT2QGQIO6U7GV014A0 D:\dc2\Windows 10 x64.vmx
1M84I2B5SU5B2LVMQ06740NGKJF1CCM8 D:\dev\Dev.vmx
O1R2D7EAC1RN4HBH62MRM7KJ66HOVP6L D:\hpb\router\router.vmx
SANL2H67KEGL6SD8RR7J2QK92KOUQL84 F:\AWAE\Kali-Linux-2020.1-vmware-amd64.vmx
0IV4CJRJNSQCPMVFV6K88IP67EMQ66CF F:\DC1\Windows Server 2019.vmx
MT9P5LH7QVFNMBG7UDC03037PGJ2KO6A F:\SANS-660\SEC-660 Kubuntu Edgy\Kubuntu Edgy 2.6.x kernel.vmx
1AGD7U7JCP6RJQ7FKUNO22DE9VRTQ4EI F:\SANS-660\SEC-660 Kubuntu Gutsy 7.10\SEC-660 Kubuntu Gutsy 7.10.vmx
54RRUEML7J5RIBM0CG3QA6TFJDM5MDM2 F:\SANS-660\SEC660-Kubuntu-Precise-12.04\SEC660-Kubuntu-Precise-12.04.vmx
SHMNUKK8GRG6K580C2DAOJMSURUTN4JR F:\SANS-660\Sec660-Kali\Sec660-Kalii.vmx
V3K8BRC919R80DT9MPADQ447047KQ3DG F:\SANS-660\Sec660-Win10\Sec660-Win10.vmx
GPLV7D18EFKHJHPR843IB8106MTPOQO6 F:\Win10NoINternet\Win10-NoInternet.vmx
7F193GIQC0D7POH3C1AQ8EC08GB94LEJ F:\client2\client2.vmx
TJI86U9R8DEOMSQK1FVKC99HK243MCDV F:\securityonion\SecurityOnion.vmx
0FGVKHDM3OVCU8L6T073L7J2TK7BA34R F:\synackmachine\Kali-Linux-2019.3-vmware-amd64.vmx

Oh, but the functionality is a little sad :(

You can’t yet create VM’s from scratch, best you can do is copy existing one’s. That might work for some cases, so I’ll add a script here when i eventually use it.

Chad Duffey

Security Engineer