VMware VMRC: connect to a remote console without the vSphere Client
Posted by jpluimers on 2021/06/21
Interesting tool: https://www.vmware.com/go/download-vmrc.
Back when scheduling this post in 2019, this was the most recent version: [WayBack] Download VMware vSphere: Download VMware Remote Console 10.0.4
- WayBack: VMware Remote Console 10.0.4 for Windows (zip)
- WayBack: VMware Remote Console 10.0.4 for Mac (dmg)
- WayBack: VMware Remote Console 10.0.4 for Linux (bundle)
From [WayBack] ovf – How to connect ESXi vm console from ESXi host console – Stack Overflow:
Example of vmrc.exe command :
"C:\Program Files (x86)\VMware\VMware Remote Console\vmrc.exe" vmrc://<ESXi host username>@<ESXi host IP>/?moid=<VM ID>
Basically it uses the vmrc
scheme to start a connection to the remote screen for a specific MoRef ID. On ESXi, this is actually the VM ID that you get from vim-cmd vmsvc/getallvms
. In that sense this is very similar to getting a single screenshot for the VM from the ESXi host by using the https://%5BHOST%5D:%5BPORT%5D/?id=%5BVM-MOREF%5D like described in ESXi and VMware Workstation: quick way of getting Console screenshots in PNG format; some URLs on your ESXi machine.
In MacOS, starting VMware Remote Console is slightly different as you have to start it through a URI using using the vmrc
scheme from either a browser or with the open
command on the console.
The reason is that there is no vmrc
binary on MacOS.
- [WayBack] Using VMware’s Standalone Remote Console for OS X with free ESXi | Der Flounder:
vmrc://@[HOST]:[PORT]/?moid=[VM-MOREF]
- HOST = the hostname or IP address of the ESXi server
- PORT = the HTTPS port of the ESXi server, which is usually 443
…
open 'vmrc://@server_name_here:port_number_here/?moid=vmid_number_here'
- [WayBack] Standalone VMRC now available for Mac OS X:
just provide the following URI which will prompt for your ESXi credentials
vmrc://@[HOST]:[PORT]/?moid=[VM-MOREF]
Once you have generated the VMRC URI, you MUST launch it through a web browser as that is how it is passed directly to the Standalone VMRC application. In my opinion, this is not ideal especially for customers who wish to automatically generate this as part of a VM provisioning workflow to their end users and not having to require a browser to launch the Standalone VMRC application. If you have some feedback on this, please do leave a comment.
In the mean time, a quick workaround is to use the “open” command on Mac OS X along with the VMRC URI which will automatically load it into your default browser and launch the Standalone VMRC application for you.
open 'vmrc://@192.168.1.60:443/?moid=vm-18'
On one of my test systems, for VMID 3 (see below), this comes down to this:
open 'vmrc://@192.168.71.94:443/?moid=3'
Note you have to accept the ESXi self generated TLS certificate once on MacOS:
After this, these processes were started (note there is no vmrc
like on Windows):
± ps -ax | grep -i "\(vmware\|vmrc\)"
65239 ?? 0:04.15 /Applications/VMware Remote Console.app/Contents/MacOS/VMware Remote Console
65343 ?? 0:00.01 /Applications/VMware Remote Console.app/Contents/Library/services/VMRC Services 3 4
65360 ?? 0:00.16 /Applications/VMware Remote Console.app/Contents/Library/vmware-usbarbitrator
65363 ?? 0:00.01 /Applications/VMware Remote Console.app/Contents/Library/services/VMware USB Arbitrator Service 3 4
65393 ?? 0:01.29 /Applications/VMware Remote Console.app/Contents/Library/vmware-remotemks -@ vmdbPipeHandle=42; vm=_7FD2A461E8E0_3; gui=true -H 44 -R -P 2 -# product=256;name=VMware Remote Console;version=10.0.1;buildnumber=5898794;licensename=VMware Remote Console;licenseversion=10.0; -s libdir=/dev/null/Non-existing DEFAULT_LIBDIRECTORY
65872 ttys001 0:00.00 grep -i \(vmware\|vmrc\)
VM IDs (or VM-MOREFs)
You get the VM IDs using the vim-cmd vmsvc/getallvms
command; they appear in the left column:
[root@ESXi-X9SRI-3F:/] vim-cmd vmsvc/getallvms Vmid Name File Guest OS Version Annotation 1 Lampje [EVO860_250GB] Lampje/Lampje.vmx opensuse64Guest vmx-14 3 X9SRI-3F-W10P-NL [EVO860_250GB] X9SRI-3F-W10P-NL/X9SRI-3F-W10P-NL.vmx windows9_64Guest vmx-14
Note that in practice, this is much harder so I wrote a script for that which you can find in VMware ESXi console: viewing all VMs, suspending and waking them up: part 1.
bundle
files
I did not know about bundle files, but they seem to be sh
scripts that precede a binary: [WayBack] What is a .bundle file and how do I run it? – Super User.
Inspecting such a files, shows it starts with this code:
#!/usr/bin/env bash # # VMware Installer Launcher # # This is the executable stub to check if the VMware Installer Service # is installed and if so, launch it. If it is not installed, the # attached payload is extracted, the VMIS is installed, and the VMIS # is launched to install the bundle as normal. # Architecture this bundle was built for (x86 or x64) ARCH=x64 if [ -z "$BASH" ]; then # $- expands to the current options so things like -x get passed through if [ ! -z "$-" ]; then opts="-$-" fi # dash flips out of $opts is quoted, so don't. exec /usr/bin/env bash $opts "$0" "$@" echo "Unable to restart with bash shell" exit 1 fi
–jeroen
Leave a Reply