I've been trying to suspend a running vm with vmrun suspend 'path to vmx' but it isn't getting suspended at all. In fact nothing happens at all.
Does anyone have any ideas on how to troubleshoot this? I used to do this in earlier versions of Workstation for a backup job and it worked well.
I'm using Workstation 11
Welcome to VMware Workstation community.
Please add more detail info? (eg, the log file vmware-vix-*.log, vmware-vixWrapper-*.log under path %temp%/vmware-<username>)
Here is a link to the log file on dropbox, https://dl.dropboxusercontent.com/u/3842763/vmware.log
Thanks for the help
edit by wila removed duplicate post. PS HuanguoZhong asked for different files as that.
are you able to provide your entire script?
THat hat might help lead to a resolution.
additionally has anything in your configuration changed since the last time it worked? Patches, software upgrades, script changes, permission changes etc.
I'm just trying these from the command line for now:
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.
The only thing that has changed is the version of VMWare Desktop. I can't say which version it changed in because I only found out a couple weeks ago when the backups were all nulled and I had to revert to an old stored vm I had backed up (luckily).
I'm running VMWare Workstation 11.1.3 build-3206955 on Windows 7 currently. I know it's not the latest version of Workstation but I don't really want to upgrade unless I know the upgrade will fix this issue. I'm wondering if I should just uninstall the version I have, reboot and then reinstall to see if that fixes it.
Have you tried to add the [hard] command?
its possible that the default (in the .vmx) is soft, and your command is waiting for system scripts to run.
Docs are a bit dated - https://www.vmware.com/support/developer/vix-api/vix112_vmrun_command.pdf
what version of vix do you have installed?
I just tried the hard command and it didn't have any effect. I installed the latest vix api from here, https://my.vmware.com/group/vmware/details?downloadGroup=PLAYER-1200-VIX1150&productId=535&download=... Version 1.15.0.
I upped the vix log level and couldn't see anything weird in there.
When I do the 'vmrun -T ws suspend <path to vmx>' command from the command line, it just sits there seemingly waiting to timeout. If I then go and manually suspend the vm, the vm suspends and the command finally times out with 'Error: The virtual machine is not powered on". I can then start it from the command line with 'vmrun -T ws start <path to vmx>', the vm resumes and then that command will not finish in the command window, again seemingly waiting for the VM to indicate it has resumed. My thought then is that the vmrun command cannot connect/communicate with the vm at all. I've reinstalled vmware tools on the guest etc. I've also tried other vmrun command that list processes in the guest and the same command waiting for a timeout or some communication. What port does the vmrun command use to communicate with the guest? Is there a way to troubleshoot that because I think that is where it falls down.
Interesting, I'm not sure if I have good news or bad news for you. I cloned a local vm I had, and ran the following commands:
$vmRun ="C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe"
$vmx_path = "C:\Users\justin\Documents\Virtual Machines\Win_7_test_vm_01\Win_7_test_vm_01.vmx"
. $vmrun start $vmx_path
. $vmrun suspend $vmx_path
Now I am running powershell as administrator (not sure what you are using).
I was able to start the vm (waited for tools to start)
Then I was able to suspend with no problems.
My software includes:
VIX 1.12.1.33347
workstation 12.1.0
So it appears it's either a bug in the version of vmWorkstation you have (I doubt it), or its something environmental you have going on. As you suggested, uninstalling workstation and re-installing might do the trick, or upgrading to 12.
At this point I think I've tried everything I can and it's still not working. I uninstalled and reinstalled. Tried various Vix versions, nothing seems to matter. I might create a small vm and test it on my laptop as well and see if it works over there. If not then I'll download the latest (v12) and try that out. If it fixes the issue then I'll upgrade and I can get back to doing work again
I installed VMWare and created a new VM on my laptop and vmrun ran with no issues there. I then copied that new VM to my main machine and tried it there but it exhibits the same problems so at least I know it's not VM dependent.
Do you happen to know how vmrun communicates to the VM to suspend it? Are there specific port in play or does it use COM or something like that to talk to the VM host?
You won't believe but I found the solution.
The issue is that VMWare Workstation Server is not running.
vmware-hostd.exe
It fails to start because it tries to bind port 8307 multimple times.
'netsh winsock reset' didn't help which was helpful at times.
Deleting datastores.xml in hostd folder also didn't work.
I found a guy who used IDA 7.0 (low-level debugging), he found a solution to edit vmware-hostd.exe in WinHex editor to replace 'localhost' with '127.0.0.1'
Works like a charm!
http://misty.moe/2018/08/30/fix-vmware-hostd-resourceinuseexception-failure/
Today this problem came back in conjuction with VMs being force-shutdown after drag'n'drop action.
See: Re: VMWare 15.5.1, dragging files in caused a vm force shutdown
I went to services and VMWare Server (hostd) was stopped with Disabled status (who did this?).
I set to auto and launched hostd with no issues (Shared VMs setting works and SSL port listened), but vmrun doesn't work.