You can access the VMware Workstation Player REST API from a local machine.

Note: To view the Workstation Player API online, search VMware API Explorer for the appropriate version of the Workstation Player API.

Procedure

  1. Install Workstation Player on the host machine.
  2. Before you start the REST API service the first time, set up your credentials.
    1. In a terminal window, change directories to the Workstation Player installation folder and run the vmrest.exe -C command.
    2. Enter a user name and password as prompted.

      You do not need to set up credentials when you start the REST API on subsequent occasions.

      The user name and password are saved to the %USERPROFILE%\vmrest.cfg file.

  3. Configure the REST API service for HTTP and HTTPS access.
    You can configure the REST API service to provide HTTP access locally and HTTPS access locally.
    • Provide HTTP service.
      1. In a terminal window, run the vmrest command.

        The command returns the IP address and port number from which you can access the HTTP service. The default IP address is 127.0.0.1:8697.

      2. Open a web browser and go to http://address-returned-by-vmrest-command.
      3. Click Authorize in the top-right corner of the Workstation Player API Explorer page.
      4. Enter the user name and password you configured in Step 2.
    • Provide HTTPS service.

      You can configure the REST API service to provide HTTPS service. In this situation, when you use the vmrest command to start the REST API service, you must use the -c and -k options together to specify the certificate and private key.

      1. In a terminal window, run a command to generate a certificate and a private key.

        The example command that follows, generates a self-signed OpenSSL-based certificate and a private key.

        openssl req -x509 -newkey rsa:4096 -keyout playerapi-key.pem -out playerapi-cert.pem -days 365 -nodes

      2. To start the Workstation Player REST API service, run the command that follows. Replace the placeholders with the full path to the certificate file and the full path to the private key file.

        vmrest -c certificate-file -k private-key-file

        The command returns the IP address and port number from which you can access the HTTPS service.

      3. Open a web browser and go to https://address-returned-by-vmrest-command.
      4. Click Authorize in the top-right corner of the Workstation Player API Explorer page.
      5. Enter the user name and password you configured in Step 2.