VMware Communities
ttabi
Enthusiast
Enthusiast

How do I use vmrest to suspend a VM from the Linux command line?

I'm sure if I spent a couple hours, I could figure this out, but I'm hoping someone already has and can just tell me.

Since vmrun is no longer shipped with VM Player, I have to use vmrest.  I know I can use the web interface, but that doesn't help me.  Instead, I need to talk directly to the REST API provided by vmrest.  Well, like I said, I'm hoping someone out there has already done this (e.g. with some Python program) and would be willing to share that code with me.  I'm just looking for a way to suspend a VM, nothing else.

0 Kudos
1 Reply
wila
Immortal
Immortal

Hi,

VIX - and thus vmrun - actually is supplied with VMware Player, just not for the Linux version (don't ask me why).

Shared virtual machines is no more... so no you can't use a web interface either, at least not in the latest 16.x version.

If you want to use python, then maybe this works: https://github.com/CobblePot59/vmrest/blob/main/vmrest.py (don't know, haven't tried.. google gave this as one of the first results)

Interesting, the old API showed examples using curl, looks like the new API does not.

https://developer.vmware.com/apis/1042#/VM%20Power%20Management/changePowerState

At least not by default, I guess you still can as it has the swagger spec as well, but you'll have to use the swagger tools to view it.

 

edit: Try this:
https://petstore.swagger.io/

and then paste the swagger URL from above doc (so https://vdc-download.vmware.com/vmwb-repository/dcr-public/3e518893-527a-43d6-8aec-3c906158627b/74e7... ) and you can navigate the doc in swagger like it used to work.

--
Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
0 Kudos