Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start a Shared VM with vmrun on VMWare Workstation

Im trying to create a script that will start a Shared Virtual Machine from a different computer. The script is completing however in the VMWare Workstation GUI the virtual machine is being put into the My Computer section and then started up and not started up in the Shared VMs section (where the VM is actually meant to be). The command is written below where the top line is the command and bottom is syntax - just for clarification.

vmrun -T ws 192.168.137.2:443/sdk start \\192.168.137.2\VMs\SKYNET\SKYNET.vmx gui
vmrun -T ws   HOST IP AND PORT     CMD       PATH TO VMX FILE ON NETWORK

EDIT: Just as clarification, i need to try and find a command that will start a vmware virtual machine as a shared machine, not one on "my computer". Any help would be great!

like image 767
user2992975 Avatar asked Oct 02 '22 10:10

user2992975


2 Answers

The following works for me:

vmrun -T ws-shared -h https://bnehyp03.dev.randomnoun:443/sdk \
  -u myLinuxUsername -p myLinuxPassword start \
  "[ha-datacenter/standard] bnedev01/bnedev01.vmx"

(replacing "bnehyp03.dev.randomnoun:443" with the host:port of your server, and the username/password and the path to the vmx file as appropriate)

Note the "[ha-datacenter/standard]" prefix to the vmx path, which doesn't seem to be necessary for non-shared VMs. I can't find this documented anywhere on the vmware site.

The vmx path is relative to the VM shared folder in VMware Workstation (under Edit->Preferences->Shared VMs)

Also, if you don't have exactly the same version of VMware running on both the client and the server, you may get a segmentation fault when you run the vmrun command.

like image 160
Greg Knox Avatar answered Oct 12 '22 11:10

Greg Knox


Here is the working example from my system based on Greg Knox's answer.

vmrun -T ws-shared -h https://<localmachinename-or-localhost>:443/sdk start "[ha-datacenter/standard] 00_W7CL01/00_W7CL01.vmx" nogui

(and then I enter user/pass manually)

like image 40
Bogdan Avatar answered Oct 12 '22 12:10

Bogdan