4

I get this message after I installed VMware. I saw a similar topic here in askubuntu, but this solution didn't work for me.

https://imgur.com/a/y5EQF08

karel
  • 114,770
  • 2
    Do: sudo apt install build-essential, a meta-package that installs the compiler, libraries, tools, that you need. – waltinator Nov 28 '23 at 19:02
  • 1
    Please provide OS & release details; deb packages are built for specific releases, and we currently don't know yours. – guiverc Nov 28 '23 at 21:14
  • This title will collect a flood of like problems created by the Jan. hwe upgrade to the Ubuntu 22.04 kernel version 6.5.The 6.5 kernel is compiled with gcc-12, and so any module compile needs that compiler version. You need to install it yourself (like many answers below), until Canonical adds a fix (dependency?). Do add yourself to the Nvidia module bug 2051457, since one such fix will fix all modules. – ubfan1 Feb 05 '24 at 17:36

4 Answers4

6

I took an update today on my Ubuntu 22.04 and encountered the error with VMware Workstation 16 Pro 16.2.4 build-20089737 shown in the question here.

GNU C Compiler (gcc) version 12.3.0, was not found. If you installed it in a non-default path you can specify the path below. Otherwise refer to your distribution's documentation for installation instructors and click Refresh to search again in default locations.

I've used VMWare every day since this OS was fresh installed in 2022.

There were three problems to fix:

Missing gcc 12

My gcc --version is 11.4.0. I checked ls /usr/bin/x86_64-linux-gnu-* and version 12 was not there.

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
$ sudo apt update
$ sudo apt install g++-12 gcc-12

Then try again.

skb_gso_segment undefined

The build breaks because of gcc header changes. The VMWare build provides a log file like /tmp/vmware-user/vmware_1234.log that shows the compiler error.

This particular function, skb_gso_segment, has moved to a new header that VMWare bridge.c does not #include.

To see for yourself the header where this function is defined, cd /usr/src/linux-hwe-6.5-headers-6.5.0-14/include/net and grep skb_gso_segment *.

To fix VMWare code:

$ sudo su
$ cd /usr/lib/vmware/modules/source

back up original tar file

$ cp vmnet.tar vmnet.tar.original

change the code

$ tar -xvf vmnet.tar $ nano vmnet-only/bridge.c

After the #include <linux/netdevice.h>, add

   #include <net/gso.h>

Save and exit. Then rebuild the tar file.

$ tar -cf vmnet.tar vmnet-only
$ exit

Then try again.

__pte_offset_map undefined

Next the build fails because a function has changed names. In VMWare Workstation 17, the code in pgtbl.h was changed like this by VMWare:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,5,0)
            pte_t *pte = pte_offset_kernel(pmd, addr);
#else
            pte_t *pte = pte_offset_map(pmd, addr);
#endif

To fix v16, I made a similar change.

$ sudo su
$ cd /usr/lib/vmware/modules/source

back up original tar file

$ cp vmmon.tar vmmon.tar.original

change the code

$ tar -xvf vmmon.tar $ nano vmmon-only/include/pgtbl.h

In the editor, search down to pte_offset_map and change it to pte_offset_kernel.

Save and exit. Then rebuild the tar file.

$ tar -cf vmmon.tar vmmon-only
$ exit

Then try again.

This got me back in operation.

jws
  • 191
  • Brilliant! Just notice the __pte_offset_map should be pte_offset_map. Also, will this fix affect future updates? – Desmond Jan 13 '24 at 10:42
  • Good catch, typo fixed! – jws Jan 13 '24 at 19:35
  • Hopefully if a future update to vmware reverts the changes to the tar files, it will contain these fixes. – jws Jan 13 '24 at 19:39
  • just ran into this issue after accepting/applying an Ubuntu 22.04 security update; in my case I'm running VMWare Workstation 17 Pro (17.0.2); followed the steps exactly as outlined and ... tada ... I'm up and running again. Thanks for the taking the time to list/detail each step, much appreciated! – markp-fuso Feb 02 '24 at 16:36
1

I too had this issue and what resolved it for me was as simple as

sudo apt install gcc-12 libgcc-12-dev
TomF247
  • 26
  • 3
0

The build-essential package is a metapackage which includes the following (in 22.04):

  • libc6-dev | libc-dev
  • gcc (>= 4:10.2)
  • g++ (>= 4:10.2)
  • make
  • dpkg-dev (>= 1.17.11)

Installing it with:

sudo apt update && sudo apt install build-essential

should solve the problem, ensuring you have all the basic C and C++ compiler tools available on your system.

moo
  • 878
0

Installing WS Pro 17.5 build 22583795 on Ubuntu 22.04 and also encountered this compiler not found message.

My gcc was showing as the latest version installed but was 11.04.

I tried the basic approach and ran sudo apt install g++-12 gcc-12

I closed and reopened WS Pro and it now said libraries needed to be compiled. I clicked OK and the setup wizard continued successfully.

JGO
  • 1