Workaround for vmrun under VMWare Workstation 12
Ever since upgrading to VMWare Worksation 12 (12.0.0, 12.0.1 and 12.1.0), I haven't been able to use 'vmrun' to work with my Shared virtual machines. This had been working since (at least WS8) and up to (and including) VMWare Workstation 11.1.2.
I used to be able to do this in shared workstation mode:
$ /usr/bin/vmrun -T ws-shared -h https://localhost:943/sdk -u user1 listRegisteredVM
Total registered VMs: 23
[ha-datacenter/standard] WinVista/winVista.vmx
[ha-datacenter/standard] RHEL6_x64/RHEL6.vmx
[ha-datacenter/standard] VCS41_node1/VCS4.vmx
[ha-datacenter/standard] VCS41_node2/VCS4.vmx
[ha-datacenter/standard] VCS41_node3/VCS4.vmx
[ha-datacenter/standard] VCS41_node4/VCS4.vmx
[ha-datacenter/standard] VCS51_node1/VCS5.vmx
[ha-datacenter/standard] VCS51_node2/VCS5.vmx
[ha-datacenter/standard] VCS51_node3/VCS5.vmx
[ha-datacenter/standard] WinXP/winXPPro.vmx
[ha-datacenter/standard] VCS51_node4/VCS5.vmx
I used to be able to do this in shared workstation mode:
$ /usr/bin/vmrun -T ws-shared -h https://localhost:943/sdk -u user1 listRegisteredVM
Total registered VMs: 23
[ha-datacenter/standard] WinVista/winVista.vmx
[ha-datacenter/standard] RHEL6_x64/RHEL6.vmx
[ha-datacenter/standard] VCS41_node1/VCS4.vmx
[ha-datacenter/standard] VCS41_node2/VCS4.vmx
[ha-datacenter/standard] VCS41_node3/VCS4.vmx
[ha-datacenter/standard] VCS41_node4/VCS4.vmx
[ha-datacenter/standard] VCS51_node1/VCS5.vmx
[ha-datacenter/standard] VCS51_node2/VCS5.vmx
[ha-datacenter/standard] VCS51_node3/VCS5.vmx
[ha-datacenter/standard] WinXP/winXPPro.vmx
[ha-datacenter/standard] VCS51_node4/VCS5.vmx
[....]
Now, on VMW 12, I just get this failure:
$ /usr/bin/vmrun -T ws-shared -h https://localhost:943/sdk -u user1 listRegisteredVM
Host password:
Unable to connect to host.
Error: The specified service provider was not found
Fortunately, vmrun (part of the VIX API bundle) is quite flexible and I just found a workaround.
On a normal VMW 12 install, there's a text config file that lists the API endpoints:
$ cat /usr/lib/vmware-vix/vixwrapper-config.txt
[....]
# Workstation 12.0.0
ws 19 vmdb 12.0.0 Workstation-12.0.0
player 19 vmdb 12.0.0 Workstation-12.0.0
# Workstation 12.0.1
ws 19 vmdb 12.0.1 Workstation-12.0.0
player 19 vmdb 12.0.1 Workstation-12.0.0
# EOF
On VMW 11, you'll note that the 'ws-shared' entries are present whereas they are missing from VMW 12.
$ cat /usr/lib/vmware-vix/vixwrapper-config.txt
[....]
# Workstation 11.0.0
ws 17 vmdb 11.0.0 Workstation-11.0.0-and-vSphere-6.0.0
player 17 vmdb 7.0.0 Workstation-11.0.0-and-vSphere-6.0.0
ws-shared 17 none 11.0.0 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 11.1.0
ws 17 vmdb 11.1.0 Workstation-11.0.0-and-vSphere-6.0.0
player 17 vmdb 7.1.0 Workstation-11.0.0-and-vSphere-6.0.0
ws-shared 17 none 11.1.0 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 11.1.2
ws 17 vmdb 11.1.2 Workstation-11.0.0-and-vSphere-6.0.0
player 17 vmdb 7.1.2 Workstation-11.0.0-and-vSphere-6.0.0
ws-shared 17 none 11.1.2 Workstation-11.0.0-and-vSphere-6.0.0
# ESX/vSphere/Server2.0 support
viserver 12 none 2.0.0 Workstation-11.0.0-and-vSphere-6.0.0
esx 12 none 4.0.0 Workstation-11.0.0-and-vSphere-6.0.0
The workaround is a two-part process:
- copy the libs from a VMW11 to your VMW12 install.
That's only the /usr/lib/vmware-vix/Workstation-11.0.0-and-vSphere-6.0.0 directory.
- edit vixwrapper-config.txt on VMW12 to add the missing entries and point to the libs you just copied over.
$ cd /usr/lib/vmware-vix
$ diff -c vixwrapper-config.txt.orig vixwrapper-config.txt
*** vixwrapper-config.txt.orig Fri Oct 30 11:52:49 2015
--- vixwrapper-config.txt Fri Nov 20 15:59:39 2015
***************
*** 26,34 ****
--- 26,36 ----
# Workstation 12.0.0
ws 19 vmdb 12.0.0 Workstation-12.0.0
player 19 vmdb 12.0.0 Workstation-12.0.0
+ ws-shared 19 none 12.0.0 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.0.1
ws 19 vmdb 12.0.1 Workstation-12.0.0
player 19 vmdb 12.0.1 Workstation-12.0.0
+ ws-shared 19 none 12.0.1 Workstation-11.0.0-and-vSphere-6.0.0
# EOF
That's the end of the story, vmrun works again with VMW 12 in Shared VMWare Workstation mode...:
$ /usr/bin/vmrun -T ws-shared -h https://localhost:943/sdk -u user1 listRegisteredVM
Host password:
Total registered VMs: 42
[ha-datacenter/standard] VCS41_node1/VCS4.vmx
[ha-datacenter/standard] VCS41_node2/VCS4.vmx
[ha-datacenter/standard] VCS41_node3/VCS4.vmx
[ha-datacenter/standard] VCS41_node4/VCS4.vmx
[ha-datacenter/standard] VCS51_node1/VCS5.vmx
[ha-datacenter/standard] VCS51_node2/VCS5.vmx
[ha-datacenter/standard] VCS51_node3/VCS5.vmx
[ha-datacenter/standard] WinXP/winXPPro.vmx
[ha-datacenter/standard] VCS51_node4/VCS5.vmx
[ha-datacenter/standard] DOS622/dos.vmx
[ha-datacenter/standard] Beini_122/Beini.vmx
[....]
For your convenience, I placed a zip file here with the proper files on my site.
Extract with:
$ sudo unzip -o -d / vmrun_ws-shared_VMW12.zip
Thank you, I followed your instructions successfully. However, I had to edit one more file:
ReplyDelete/usr/lib/vmware/vixwrapper-product-config.txt
and add one more line there:
ws-shared 19 vmdb 12.1.0 Workstation-11.0.0-and-vSphere-6.0.0
Hi Vincent,
ReplyDeleteyour solution was working fine since the last upgrade to wokrstation 12.5.2. After that i get messages like "Cannot open VM: ... There was an error in communication" when i try to stop VMs, despite starting it works fine.
Do you encounter the same problem or already got an solution for that?
Thanks,
Christian
Hi Christian,
DeleteI am still running 12.1.1 and have not yet upgraded to 12.5.2 due to other issues.
I couldn't get vmrun to run properly on 12.5.2 so the whole issue will need to be re-explored.
Regards,
Vincent
You have to update the config file for 12.5.2 and you should be fine
DeleteConfirming: it was working on 12.1.1. Broken on 12.5.4. Downgrade it is...
DeleteHi Eugene,
ReplyDeleteYou don't need to downgrade.. you can keep using 12.5.5 and use the hacks provided here. This is what I have on RHEL6.9:
# cat /usr/lib/vmware-vix/vixwrapper-config.txt
# Workstation 12.0.0
ws 19 vmdb 12.0.0 Workstation-12.0.0
player 19 vmdb 12.0.0 Workstation-12.0.0
ws-shared 19 none 12.0.0 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.0.1
ws 19 vmdb 12.0.1 Workstation-12.0.0
player 19 vmdb 12.0.1 Workstation-12.0.0
ws-shared 19 none 12.0.1 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.1.0
ws 19 vmdb 12.1.0 Workstation-12.0.0
player 19 vmdb 12.1.0 Workstation-12.0.0
ws-shared 19 none 12.1.0 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.1.1
ws 19 vmdb 12.1.1 Workstation-12.0.0
player 19 vmdb 12.1.1 Workstation-12.0.0
ws-shared 19 none 12.1.1 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.5.0
ws 19 vmdb 12.5.0 Workstation-12.0.0
player 19 vmdb 12.5.0 Workstation-12.0.0
ws-shared 19 none 12.5.0 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.5.1
ws 19 vmdb 12.5.1 Workstation-12.0.0
player 19 vmdb 12.5.1 Workstation-12.0.0
ws-shared 19 none 12.5.1 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.5.2
ws 19 vmdb 12.5.2 Workstation-12.0.0
player 19 vmdb 12.5.2 Workstation-12.0.0
ws-shared 19 none 12.5.2 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.5.3
ws 19 vmdb 12.5.3 Workstation-12.0.0
player 19 vmdb 12.5.3 Workstation-12.0.0
ws-shared 19 none 12.5.3 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation 12.5.4
ws 19 vmdb 12.5.4 Workstation-12.0.0
player 19 vmdb 12.5.4 Workstation-12.0.0
ws-shared 19 none 12.5.4 Workstation-11.0.0-and-vSphere-6.0.0
# Workstation12.5.5
ws 19 vmdb 12.5.5 Workstation-12.0.0
player 19 vmdb 12.5.5 Workstation-12.0.0
ws-shared 19 none 12.5.5 Workstation-11.0.0-and-vSphere-6.0.0