DEV Community

Abdenour ALIANE
Abdenour ALIANE

Posted on • Updated on

Use VMware Workstation with the latest Linux Kernel

Azul,
This is my first article, this my Hello World in dev.to community, I am here to help people as I got and still get helped from those online articles, but, to encourage people from my community to write and share their knowledge !

I am Abdenour ALIANE, Aicignaw Consulting founder, and teacher (and of course a student), I will write about computer (sure, since I am here), focusing on Cloud Computing (Google Cloud and on-premise solutions) and Linux, and everything related to those two big topics, and I will always try to break the topic to something anyone could understand (I suppose that I am a newbie that comes and read this article because I searched for a keyword on Google, and of course we never stop learning, so I am still a newbie, that's the key to learn ! so sorry if my articles will seem basic, and if you dont understand, please let me know in the comments section)

Today, I will start with this simple way on how to use VMWare Workstation on Linux distribution with a new kernel (since hypervisors and virtualization is important to explain how cloud works), if you know the basics, just scroll down to the yawning cat picture ^_^

Well, first, let's break down what I said :

Linux is a Kernel, a kernel is that part who manages the electricity flaw (those 1 and 0 signals), so if we try to understand using what most of people use on Desktop: Microsoft Windows :

  • When we install a driver, we are installing some 'code' that will work with our hardware to tell them how to behave; so when we find a driver compatible with Windows 8.1, that means, it works with the Windows kernel of this version, so chances that it could work with Windows 10, but Windows XP drivers could break for Windows 10 even if it's the same architecture as the two kernels have lot of differences

  • When Windows starts, the kernel is the part that protects the hardware from being broken by something a user or a program could do, which means, a virus for example (which is a program but does something a user will not like ...) will not burn the hardware by sending too much electricity to it (we will see that concept a lot with virtualization in next articles),

Linux is named after the guy who made it, Linus Torvalds, you can even check his git repo, or download it from the official website, but you need then to compile it to your own distribution, you can Google for it, I will make a topic on this later.
So now that we understood what is a kernel, what we use are Distributions and there are a LOT !

The good part of using a Linux distribution, is its modularity; we can install Ubuntu for example, change its user interface, and update its kernel to try some new features and bring some new hardware compatibility, without even touching the distribution version !

Important notice :
In computer world, there are two kind of people :

  1. Users who like to test and try new stuff, if it breaks, even if there is a loss, but there is time to repair,

  2. Professionals using machines as servers, no time to lose :

  • Here, the most important is stability over new stuff, they only do security patches and important updates, that's why some distributions offer what is called an Long Term Support (LTS)

  • Those servers are headeless, that's why we avoid installing graphical interface on those Linux distributions, so, headeless keyword is also used in Linux to say they dont have GUI
    * Headeless Linux means less security holes

  • That is said, DONT TRY THIS AT ... SERVER

tired cat

So, since you decided to change the kernel to the latest stable version, here is what happens, and how to solve the problem :

For this, I will give you my own experience :

I use Pop!_OS 22.04 LTS, which is based on Ubuntu 22.04 LTS which is a Debian based distribution, I used this version because this is what I personally found good on my laptop with Nvidia Optimus

if you are an Arch user, and want something on top of KDE that supports Optimus, there is the amazing EndeavourOS but that's not our main topic, this is just for people who want to discover the Linux world

Let's begin :

This is how to get your Linux distribution version :
cat /etc/os-release
And this is how to get your kernel version :
uname -r

The result

Kernel version

When you run VMWare Workstation, it will ask you to compile some modules for this kernel

compile kernel

Then it will start building the modules vmmon and vmnet

vmnet

And this where it messes and I got the error (unable to install all modules):

error

The log shows compilation error due to C libraries missing ...

log

So here is the solution that worked with me :

The solution is in this excellent repo, it is described :

This repository tracks patches needed to build VMware (Player and
Workstation) host modules against recent kernels. As it focuses on recent
kernels (older ones do not need patching), only vmmon and vmnet modules are
currently handled as the rest has been upstreamed for some time.

First, let's clone it to our machine
git clone https://github.com/mkubecek/vmware-host-modules.git

Git will create a new folder and name it the same name as the git repo, which is vmware-host-modules

cd vmware-host-modules

The repo appears almost empty, the files we need are in the branchs, we can check them with

git branch -r

We will find that it contains branchs for Player and Workstation, with their respective versions, I am using 16.2.4, to get the branch name, we can directly use :

If you use the latest Worsktation at the time of writing/editing this article, which is workstation-17.0.0 just replace the version number and you are all set !

git branch -r | grep -i 16.2.4

Then we switch to that branch depending on which version you need :

git checkout workstation-16.2.4

branchs

You can avoid all this by directly clone the branch (replace the VMWare version with the one you use) :
git clone -b workstation-16.2.4 https://github.com/mkubecek/vmware-host-modules.git

and then once we are there, we just need to compile our modules and install them with the famous :

make && sudo make install

it should not take time, and TADA !

Update : Nov 2022

After upgrading to kernel version 6.xx I got an issue, here is simply how to solve it :

... after doing make

tar -cf vmnet.tar vmnet-only

tar -cf vmmon.tar vmmon-only

sudo mv vmnet.tar /usr/lib/vmware/modules/source/

sudo mv vmmon.tar /usr/lib/vmware/modules/source/

sudo vmware-modconfig --console --install-all

And if you get issues with gcc as incompatible with the one you are using (gcc 11 vs gcc 12) just change the symlink to the newest one :

gcc --version

which gcc

Then :

sudo unlink /usr/bin/gcc

sudo ln /usr/bin/gcc-12 /usr/bin/gcc

And check again with

gcc --version

Tada

Top comments (0)