Software & AppsOperating SystemLinux

Fixing Failed to Build vmmon Error When Installing VMware on Ubuntu 18.04

Ubuntu 10

VMware is a widely used virtualization solution that allows users to run multiple operating systems on a single machine. However, when installing VMware on Ubuntu 18.04, you may encounter the “Failed to build vmmon” error. This error typically occurs due to incompatibility issues between VMware and the kernel version of Ubuntu. In this guide, we will provide detailed solutions to fix this error.

Quick Answer

To fix the "Failed to build vmmon" error when installing VMware on Ubuntu 18.04, you can try patching the vmmon module, using a script to build and install vmware-host-modules, or consider downgrading the kernel. However, it is always recommended to refer to official documentation or seek assistance from the VMware or Ubuntu community for specific issues.

Solution 1: Patching the vmmon Module

The first solution involves patching the vmmon module. This process updates the module to be compatible with your current kernel version.

  1. Download the patch script: Open a terminal and run the following command to download the patch script:
wget https://raw.githubusercontent.com/mkubecek/vmware-host-modules/fadedd9c8a4dd23f74da2b448572df95666dfe12/vmmon-only/linux/hostif.c.patch

The wget command is used to download files from the web. The URL following the wget command is the location of the patch script.

  1. Navigate to the downloaded patch script: Use the cd command to navigate to the directory where the patch script is downloaded.
  2. Apply the patch: Run the following command to apply the patch:
sudo patch -p0 -i hostif.c.patch

The patch command applies the patch to the vmmon module. The -p0 option tells the patch command to not strip any leading directories from the file names, and the -i option specifies the patch file.

  1. Retry the VMware installation: After applying the patch, retry the VMware installation. If the error persists, proceed to the next solution.

Solution 2: Using a Script to Build and Install vmware-host-modules

This solution involves using a script to build and install the vmware-host-modules. This can help to resolve any issues with the vmmon module.

  1. Create a new script file: Open a text editor and create a new file.
  2. Copy and paste the script into the file: Copy and paste the following script into the file:
#!/bin/bash
VMWARE_VERSION=workstation-12.5.9
TMP_FOLDER=/tmp/patch-vmware
rm -fdr $TMP_FOLDER
mkdir -p $TMP_FOLDER
cd $TMP_FOLDER
git clone https://github.com/mkubecek/vmware-host-modules.git
cd $TMP_FOLDER/vmware-host-modules
git checkout $VMWARE_VERSION
git fetch
make
sudo make install
sudo rm /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo /etc/init.d/vmware restart

This script first sets the VMware version and temporary folder. It then removes any existing temporary folder and creates a new one. After that, it clones the vmware-host-modules from GitHub, checks out to the specified VMware version, and builds and installs the modules. Finally, it replaces the libz.so.1 library in the VMware directory with a symbolic link to the system’s libz.so.1 library, and restarts VMware.

  1. Save the file with a .sh extension: For example, you can name it vmware-install.sh.
  2. Make the script executable: Open a terminal and navigate to the directory where the script is saved. Run the following command to make the script executable:
chmod +x vmware-install.sh

The chmod command changes the permissions of the file. The +x option makes the file executable.

  1. Execute the script: Run the following command to execute the script:
./vmware-install.sh

This command runs the script, which should fix the “Failed to build vmmon” error.

Solution 3: Downgrading the Kernel

If the above solutions do not work, you can consider downgrading the kernel to a version that is compatible with VMware. However, this solution is not recommended as it may cause compatibility issues with other software and system components.

Please note that these solutions are provided as suggestions and may not work in all cases. It is always recommended to refer to official documentation or seek assistance from the VMware or Ubuntu community for specific issues.

In conclusion, the “Failed to build vmmon” error when installing VMware on Ubuntu 18.04 can be resolved by patching the vmmon module, using a script to build and install vmware-host-modules, or downgrading the kernel. However, it is always best to keep your system and software up to date to avoid such errors.

What is VMware?

VMware is a virtualization solution that allows users to run multiple operating systems on a single machine. It creates virtual machines that simulate the hardware of a physical computer, enabling users to run different operating systems and applications within isolated environments.

Why am I getting the “Failed to build vmmon” error when installing VMware on Ubuntu 18.04?

The "Failed to build vmmon" error occurs due to incompatibility issues between VMware and the kernel version of Ubuntu 18.04. VMware may not have been updated to support the specific kernel version you are using, resulting in the error.

How can I fix the “Failed to build vmmon” error?

There are several solutions to fix the "Failed to build vmmon" error. You can try patching the vmmon module, using a script to build and install vmware-host-modules, or consider downgrading the kernel. These solutions are provided in the guide above.

How do I patch the `vmmon` module?

To patch the vmmon module, you need to download the patch script, navigate to the downloaded patch script, apply the patch using the patch command, and then retry the VMware installation. The detailed steps are provided in Solution 1 of the guide.

What is the purpose of using a script to build and install `vmware-host-modules`?

Using a script to build and install vmware-host-modules helps to resolve any issues with the vmmon module. The script automates the process of cloning the vmware-host-modules repository, checking out the specified VMware version, building and installing the modules, and restarting VMware.

Is it recommended to downgrade the kernel to fix the “Failed to build vmmon” error?

Downgrading the kernel is not recommended as a solution for the "Failed to build vmmon" error. It may cause compatibility issues with other software and system components. It is best to explore other solutions or seek assistance from the VMware or Ubuntu community before considering downgrading the kernel.

Are the provided solutions guaranteed to fix the “Failed to build vmmon” error?

The provided solutions are suggestions based on common methods to resolve the "Failed to build vmmon" error. However, the effectiveness of these solutions may vary depending on the specific system configuration and circumstances. It is always recommended to refer to official documentation or seek assistance from the VMware or Ubuntu community for specific issues.

Leave a Comment

Your email address will not be published. Required fields are marked *