Tuesday, September 25, 2018

Using VMware Remote Console on Debian Linux

If you're a Linux user and have tried the built-in VM console in the VMware vSphere web interface, then you probably know that it's clunky, buggy, and difficult to use.  Luckily, VMware has a separate Remote Console tool which is more robust and does not suffer from the shortcomings of the web-based console.

VMware's Remote Console is not certified to run on Debian Linux, but with a small amount of trial and error, I was able to get it working just fine and now it works flawlessly.


The Problem:

The VMware installer puts everything it needs under the /usr/lib/vmware directory.  That's fine.  But beyond that, there are several problems:

  1. The required libraries are in /usr/lib/vmware/lib but they are split up into subdirectories named like the actual library files, like /usr/lib/vmware/lib/libssl.so.1.0.2/libssl.so.1.0.2

  2. The libraries are not added to the system's search path during install, so when you launch Remote Console, it tries to use the existing system libraries and not the ones delivered with the product.  This can lead to a variety of different errors.

  3. Adding the libraries to the system's search path results in those libraries taking precedence over the OS-delivered versions, so then other programs like Firefox and Chrome try to use the specialized VMware-delivered versions of these libraries when they launch, and they fail.

  4. The actual executable -- /usr/lib/vmware/bin/vmrc -- is actually a symbolic link to /usr/lib/vmware/bin/appLoader.  Since appLoader uses the name of the command that was actually invoked in order to know what to do, the invoked command must be vmrc.

The Solution:

We need to create a script which sets up the correct library path (putting every single one of those stupid library-named subdirectories into the LD_LIBRARY_PATH environment variable) and then run the Remote Console with that library path.  The name of the invoked command has to be vmrc, so I ended up creating a temporary symlink to appLoader as /tmp/vmrc and calling that from the script:

#!/bin/bash

# Set the library and bin directories
LIBDIR="/usr/lib/vmware/lib"
BINDIR="/usr/lib/vmware/bin"

# Clear the LD_LIBRARY_PATH
LD_LIBRARY_PATH=""

# Build the LD_LIBRARY_PATH with all of the $LIBDIR subdirectories
for dir in $(find ${LIBDIR} -type d) ; do
    LD_LIBRARY_PATH="${dir}:${LD_LIBRARY_PATH}"
done

export LD_LIBRARY_PATH

# Create a temporary symlink to appLoader in /tmp and run it
ln -s ${BINDIR}/appLoader /tmp/vmrc
/tmp/vmrc $*

# Delete the symlink and exit
rm -f /tmp/vmrc
exit 0

Simply delete /usr/lib/vmware/bin/vmrc and replace it with this script, and it works!

3 comments:

  1. Hi There,

    Thank you for the Blog, I'm trying to install the VMRC on Debian 10, but I'm not have the version 9, the vmware removed from the official repository
    If you have the link can you please share?

    ReplyDelete
    Replies
    1. Hello! It looks like Remote Console 9 is no longer available. Unfortunately I don't have any links for it. But if you have a VMware.com login, you can get to the download for version 10.0.6 here:

      https://my.vmware.com/group/vmware/details?downloadGroup=VMRC1006&productId=896

      Delete