简体   繁体   中英

VMWare Workstation won't suspend from command line

I'm trying to automate VMWare Desktop on Windows 7 to suspend all vm's before I do a backup job each night. I used to have a script that did this but I've noticed now that it won't suspend anymore with the same command that used to work.

If I do vmrun list I get a list of the running vms with no issue.

If I do vmrun suspend "V:\\Virtual Machines\\RICHARD-DEV\\RICHARD-DEV.vmx" it just hangs and I have to kill the command with CTRL+C.

I've even tried a newer command using -T to specify it's workstation, ie vmrun -T ws suspend "V:\\Virtual Machines\\RICHARD-DEV\\RICHARD-DEV.vmx" and still no love.

If I have the vm already stopped, I can issue vmrun start "V:\\Virtual Machines\\RICHARD-DEV\\RICHARD-DEV.vmx" and it starts fine.

As well as the suspend command, the stop command also does not work. I'm running VMWare Workstation 11.1.3 build-3206955 on Windows 7.

Any ideas?

Update:

I installed latest VMWare Tools on the guest, as well as the latest Vix on the Host so everything should be up to date.

I can start a vm using vmrun with no problem using vmrun -T ws start <path to vmx> but the command doesn't come back to the command prompt, so I'm assuming it's not getting confirmation from the vm that it is now running.

If I cancel the 'start' command and now try and suspend I'm getting the same lack of communication from the guest. If I manually suspend the vm, once it's suspended I get an 'Error: vm is not running' and the 'suspend' command finally times out and comes back.

So, it looks to me like there is no communication from vmrun to the guest about what state it's in etc. Is there a way to debug the communication from the host to the guest using vmrun or other means? Are there ports I need open in the guest OS?

So, I never did get vmrun to work properly on my main system, although I did get it behave ok on my laptop so there is something weird happening on this machine. I also installed a trial of the latest VMWare 12 and the same thing happens.

As a workaround, I ended up changing the power management settings in my guest OS so that it would 'sleep' after 1 hr of inactivity. When this happens VMWare detects it and automatically suspends the guest which is really what I'm looking for. Not the most slick solution but it does manage to unlock the files I need to be backed up in a nightly backup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM