VMware Workstation

From Leo's Notes
Last edited on 29 June 2021, at 22:20.

VMware Workstation is a commercial virtualization software package that runs on Windows and Linux.

While VMware Workstation works flawlessly on Windows, there are some issues that need to be addressed for Linux.

WSL 2 compatibility issues[edit | edit source]

WSL 2 on Windows 10 seems to work with VMware Workstation 16 for the most part. However, I started noticing the following symptoms:

  • Input events (like mouse clicks, release, drags) are randomly skipping, causing GUI interactions to absolutely suck
  • PXE booting fails. It doesn't even try to DHCP the network interface
  • Legacy BIOS screen is really sluggish. Almost like it's rendered through a 9600 baud serial

These issues were only rectified by reverting WSL 2 to WSL 1 and uninstalling the Virtual Machine Platform and Hypervisor Platform Windows features by running as admin the following command and then rebooting.

> dism.exe /online /disable-feature /featurename:VirtualMachinePlatform /featurename:HypervisorPlatform /norestart

More information: https://tcpip.me/2020/11/14/vmware-workstation-nested-virtualization-and-wsl2-disaster/

Debugging Linux Issues Running[edit | edit source]

If you are having issues getting VMware Workstation to run on your linux machine, read the application log located in /tmp/vmware-$USER/vmware-apploader-$$.log.

VMware Workstation 12.5.7[edit | edit source]

Fedora 26, Kernel 4.11.11[edit | edit source]

After installing the VMware bundle file, vmware immediately quits and returns a status code of 1.

The issue here is the libexpact and libz libraries. To fix this:

# cp -r /usr/lib/vmware-installer/2.1.0/lib/lib/libexpat.so.0 /usr/lib/vmware/lib
# mv /usr/lib/vmware/lib/libz.so.1/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1-old
# ln -s /usr/lib64/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1

VMware also does not like the GCC compiler on Fedora 26. In order to get the modules working, you will have to compile it manually. To do so:

# mkdir /lib/modules/`uname -r`/misc

## vmmon
# cd /usr/lib/vmware/modules/sources
# tar -xf vmmon.tar
# cd vmmon-only
# make
# cp vmmon.ko /lib/modules/`uname -r`/misc

## vmnet
# cd /usr/lib/vmware/modules/sources
# tar -xf vmnet.tar
# cd vmnet-only
# make
# cp vmnet.ko /lib/modules/`uname -r`/misc

## Load the modules
# depmod -a
# modprobe vmmon vmnet

If the modules are loaded correctly, you should see the devices in /dev.

# ls -al /dev/{vmmon,vmnet*}
crw-rw-rw-. 1 root root  10, 165 Aug  1 11:58 /dev/vmmon
crw-rw-rw-. 1 root root 119,   0 Aug  1 11:59 /dev/vmnet0
crw-rw-rw-. 1 root root 119,   1 Aug  1 11:59 /dev/vmnet1
crw-rw-rw-. 1 root root 119,   8 Aug  1 11:59 /dev/vmnet8

You may need to run vmware-netcfg in order for the vmnet devices to show up (odd...).

I'm unable to run this as a normal user without vmware complaining about gcc.

VMware Workstation 12.5[edit | edit source]

Fedora 25, Kernel 4.9.13[edit | edit source]

Modules couldn't be compiled unless the following changes were made:

vmnet-only/userif.c

+ retval = get_user_pages(addr, 1, 0, &page, NULL);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
-     retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
- #else
-     retval = get_user_pages(current, current->mm, addr,
-                 1, 1, 0, &page, NULL);
- #endif

vmmon-only/linux/hostif.c

+ unsigned int anonPages = global_page_state(NR_ANON_MAPPED);
- unsigned int anonPages = global_page_state(NR_ANON_PAGES);

+ retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
-    retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
- #else
-    retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
-                            numPages, 0, 0, ppages, NULL);
- #endif

Make the changes by running:

# cd /usr/lib/vmware/modules/source
# tar -xf vmmon.tar vmnet.tar
## Make the changes above
# tar -cf vmmon.tar vmmon-only
# tar -cf vmnet.tar vmnet-only
# vmware-modconfig --console --install-all


VMware Workstation 12[edit | edit source]

Unlike previous versions, VMware Workstation 12 makes use of the mainline kernel source for its kernel modules. This means no more patching is required in order to build the modules.

Fedora 23, Kernel 4.3.3[edit | edit source]

When building vmmon, the build fails with the following error:

CC [M]  /tmp/modconfig-IY8VE3/vmmon-only/linux/driver.o
  CC [M]  /tmp/modconfig-IY8VE3/vmmon-only/linux/hostif.o
  CC [M]  /tmp/modconfig-IY8VE3/vmmon-only/common/memtrack.o
  CC [M]  /tmp/modconfig-IY8VE3/vmmon-only/common/apic.o
  CC [M]  /tmp/modconfig-IY8VE3/vmmon-only/common/vmx86.o
  CC [M]  /tmp/modconfig-IY8VE3/vmmon-only/common/cpuid.o
/tmp/modconfig-IY8VE3/vmmon-only/linux/driver.c: In function ‘cleanup_module’:
/tmp/modconfig-IY8VE3/vmmon-only/linux/driver.c:390:8: error: void value not ignored as it ought to be
    if (misc_deregister(&linuxState.misc)) {
        ^
At top level:
/tmp/modconfig-IY8VE3/vmmon-only/linux/driver.c:1285:1: warning: always_inline function might not be inlinable [-Wattributes]
 LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
 ^
scripts/Makefile.build:258: recipe for target '/tmp/modconfig-IY8VE3/vmmon-only/linux/driver.o' failed
make[2]: *** [/tmp/modconfig-IY8VE3/vmmon-only/linux/driver.o] Error 1
make[2]: *** Waiting for unfinished jobs....

Edit the driver.c source file and take out the if.

# cd /usr/lib/vmware/modules/source
# tar -xf vmmon.tar
# vi ./vmmon-only/linux/driver.c

## Edit with the following changes:
## -   if (misc_deregister(&linuxState.misc)) { 
## -      Warning("Module %s: error unregistering\n", linuxState.deviceName); 
## -   } 
## +   misc_deregister(&linuxState.misc); 

# mv vmmon.tar vmmon.tarbackup
# tar cf vmmon.tar ./vmmon-only
# vmware-modconfig --console --install-all

Fedora 23, Kernel 4.2.3[edit | edit source]

Library Loading Issue[edit | edit source]

When attempting to run VMware Workstation 12 on Fedora 23, the program will not start. The logs contained:

2015-11-11T16:41:28.225-07:00| appLoader| I125: Loading shipped version of libvmwareui.so.
2015-11-11T16:41:28.444-07:00| appLoader| W115: Unable to load libvmwareui.so from /usr/lib/vmware/lib/libvmwareui.so/libvmwareui.so: /usr/lib/vmware/lib/libvmwareui.so/libvmwareui.so: undefined symbol: _ZN4Glib10spawn_syncERKSsRKNS_11ArrayHandleISsNS_17Container_Helpers10TypeTraitsISsEEEENS_10SpawnFlagsERKN4sigc4slotIvNSA_3nilESC_SC_SC_SC_SC_SC_EEPSsSG_Pi
2015-11-11T16:41:28.445-07:00| appLoader| W115: Unable to load dependencies for /usr/lib/vmware/lib/libvmware.so/libvmware.so
2015-11-11T16:41:28.445-07:00| appLoader| W115: Unable to execute /usr/lib/vmware/bin/vmware.

This was resolved by overwriting VMware's bundled libraries with the system ones and forcing VMware to use the bundled libraries.

cd /usr/lib/vmware/lib
/bin/cp -afv /usr/lib64/libgio-2.0.so.0.4600.1 libgio-2.0.so.0/libgio-2.0.so.0
/bin/cp -afv /usr/lib64/libglib-2.0.so.0.4600.1 libglib-2.0.so.0/libglib-2.0.so.0
/bin/cp -afv /usr/lib64/libgmodule-2.0.so.0.4600.1 libgmodule-2.0.so.0/libgmodule-2.0.so.0
/bin/cp -afv /usr/lib64/libgobject-2.0.so.0.4600.1 libgobject-2.0.so.0/libgobject-2.0.so.0
/bin/cp -afv /usr/lib64/libgthread-2.0.so.0.4600.1 libgthread-2.0.so.0/libgthread-2.0.so.0

Add the following line near the top of the vmware shell script /usr/bin/vmware:

export VMWARE_USE_SHIPPED_LIBS="force"

Missing libsvgr2 Dependency[edit | edit source]

If you are missing the libsvgr2 package, you will see the following error in the logs:

2015-11-12T03:28:18.915-05:00| vmui| W115: Unhandled cui::Error exception: class 'N3cui5ErrorE', details 'Unable to load image-loading module: /usr/lib/vmware/libconf/lib/gtk-2.0/2.10.0/loaders/svg_loader.so: librsvg-2.so.2: cannot open shared object file: No such file or directory'

VMware will also not start when executed.

This can be fixed by installing the libsvgr2 package.

VMware Workstation 11[edit | edit source]

When building kernel modules on kernel versions > 2.6, patching is required. Check out ArchLinux's AUR vmware-patch repository at: https://aur.archlinux.org/packages/vmware-patch

TODO: Import VMware 11 installation information here

Headless Workstation[edit | edit source]

To run a virtual machine on a headless machine, use the vmrun command.

For example:

$ vmrun -T ws start  "/scratch/vm/CentOS 7/CentOS 7.vmx" nogui

Trial License[edit | edit source]

The trial license on Windows seems to be placed at HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\VMware, Inc.\VMware Workstation\License.ws.15.0.e1.201804. Removing this key should reset the trial to its initial state.

On ESXi, the key should be placed in /etc/vmware/license.cfg. Run cp /etc/vmware/.#license.cfg /etc/vmware/license.cfg, then restart vpxa.

See Also[edit | edit source]