VMware Communities
BarAchdut
Contributor
Contributor

Vmrun Start command on shared machines

Hi, Im Running Vmware WS 15 on Server inside my work domain, I have 14 shared VMs that i want to wake them up automatically after the server doing reboot.

When the machines arn't shared i succeeded to do it but when they are shared the script isn't working with an "Comunication error" messege (it changes to the machine window but do nothing).

my command: vmrun -T ws start "C:\Users\Public\Documents\Shared Virtual Machines\%%s\%%s.vmx" gui

(the %ss is because i have for loop at my batch file.)

I think that this is something that belong to the fact that when i change the machine to shared the VMware moves the machine folder into Public user (maybe premissions?) but i trie to run the script as admin and also as guest user and still i got the same error.

Need help please!

0 Kudos
7 Replies
wila
Immortal
Immortal

Hi,

You need to use the -h host option for shared machines.

The reason is that it runs under another user account (not admin, but SYSTEM) and with the -h option you can access the VM from your own account.

--

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
BarAchdut
Contributor
Contributor

Hi, Thanks for the reply!

Can you gove me example of the syntax? i try with this syntax:  vmrun -T ws -h host start "C:\Users\Public\Documents\Shared Virtual Machines\%%s\%%s.vmx" gui

and still it changes to the vm windows but it still down...

Also try to run cmd as system user and run this command or my batch file and i got the same result.

Thanks!

0 Kudos
wila
Immortal
Immortal

Hi,

For location you have to use the datastore syntax,  "[storage1]\%%s\%%s\.vmx"

An example would be:

vmrun -h "https://192.168.11.34/sdk​" -u hostUser -p hostPassword start "[standard] vm/myVM.vmx"

You can find the datastore syntax in the virtual machine settings of the shared VM.

pastedImage_1.png

When just testing it here, I had to drop the "-T ws" syntax or it would not even try to connect.

Also note that you might have a different port defined on your Workstation setup as the default port 443, if so then you have to adjust the URL.

Finally, when I just tried here I always got a "unable to connect" error, even after moving to a different port (I realized that IIS got installed, so 443 is used by IIS) and trying with/without /sdk.

But generally, the above is how it is supposed to work.

Re. running a cmd as SYSTEM user? Not sure how you did that as you normally cannot elevate yourself to system user? The only thing I can come up with to do that easily is by running your batch from a task via task scheduler.

--

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
batibix
Contributor
Contributor

This is so weird. I'm trying

vmrun -h "https://<my LAN IP>/sdk" -u hostUser -p hostPassword start "[standard] Debian 10/Debian 10.vmx"

on VMWare Workstation Pro 15.5.0 but all I get is

Unable to connect to host.

Error: The operation is not supported

My hostUser has the VM User role, but I get the same error with a user that has the Administrator role.

Sharing is enabled and the port is the default one (443). vmrun reports version 1.17.0 build-14665864.

This worked in VMWare 11.x, then VMWare axed it and since vmrun can start non-shared VMs in Workstation 15, I thought that this functionality was restored also for shared VMs.

wila​, did you have to change your vixwrapper-config.txt?

This is mine:

# Workstation 15.0.0

ws        19  vmdb  15.5.0 Workstation-15.0.0

player    19  vmdb  15.5.0 Workstation-15.0.0

# latest un-versioned

ws        19  vmdb  e.x.p Workstation-15.0.0

player    19  vmdb  e.x.p Workstation-15.0.0

0 Kudos
wila
Immortal
Immortal

Hi,

The above is no longer working for me.

I even moved the port to another port in order to rule out that it wasn't vmware listening on the 443 port.

No cigar.

The only thing that works for me is the -undocumented- solution of using a SYSTEM account to communicate directly -instead of via the http interface- with shared virtual machines.

I cannot recommend the undocumented method as VMware might yank it away any time they want.

Then again, the official -supposedly supported- way does not appear to work.

So where does that leave you then i wonder?

edit:

One of the things that strikes me as odd, is that the certificate which is served on the https://localhost:443 port (or another port if you changed the default config) is not valid.

Worse, when you download that cert and try to import it then Windows 10 refuses to accept that cert as a valid one.

That by itself is a good reason for why it would not want 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
batibix
Contributor
Contributor

Thanks for the reply, wila​. This looks kind of dark. I just tried MS Hyper-V. Migrating to that, would solve my problems with the Windows VMs, but it really sucks for Linux VMs. My 3 GB Debian VMWare VM grew to 36 GB in Hyper-V and none of the solutions for compacting it worked. Right now, I'm about to test VirtualBox.

0 Kudos
pwolf
Enthusiast
Enthusiast

Look at this thread VMrun functionality drastically reduced in WS 15 (and maybe WS14, which I did skip)

In fact - with the exception of this workaround - there is no possiblity to manage shared VMs from a script since WS 15. And after WS 15.5.5 not even the ability to connect to the console of remote shared machines (in many cases).

0 Kudos