GNU C 编译器 (gcc) 版本 12.2.0,未在 vmware 中找到

ker*_*ter 4 vmware

安装 VMware 后我收到此消息。我在 askubuntu 中看到了类似的主题,但这个解决方案对我不起作用。

https://imgur.com/a/y5EQF08

jws*_*jws 6

16.2.4 build-20089737我今天在 Ubuntu 22.04 上进行了更新,并遇到了此处问题中所示的VMware Workstation 16 Pro 错误。

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.
Run Code Online (Sandbox Code Playgroud)

自从 2022 年全新安装 VMWare 操作系统以来,我每天都在使用该操作系统。

需要解决三个问题:

缺少海湾合作委员会 12

我的gcc --version是11.4.0。我查了一下ls /usr/bin/x86_64-linux-gnu-*,没有12版本。

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.
Run Code Online (Sandbox Code Playgroud)

然后再试一次。

skb_gso_segment 未定义

由于 gcc 标头更改,构建中断。VMWare 构建提供了一个类似/tmp/vmware-user/vmware_1234.log显示编译器错误的日志文件。

这个特定的函数skb_gso_segment已移至 VMWarebridge.c没有的新标头#include

亲自查看定义此函数的标头,cd /usr/src/linux-hwe-6.5-headers-6.5.0-14/include/net以及grep skb_gso_segment *.

要修复 VMWare 代码:

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y
$ sudo apt update
$ sudo apt install g++-12 gcc-12
Run Code Online (Sandbox Code Playgroud)

之后#include <linux/netdevice.h>,添加

$ 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
Run Code Online (Sandbox Code Playgroud)

保存并退出。然后重建 tar 文件。

   #include <net/gso.h>
Run Code Online (Sandbox Code Playgroud)

然后再试一次。

__pte_offset_map 未定义

接下来,构建失败,因为函数已更改名称。在VMWare Workstation 17中,VMWare将中的代码pgtbl.h更改为这样:

$ tar -cf vmnet.tar vmnet-only
$ exit
Run Code Online (Sandbox Code Playgroud)

为了修复 v16,我做了类似的更改。

#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
Run Code Online (Sandbox Code Playgroud)

在编辑器中,向下搜索pte_offset_map并将其更改为pte_offset_kernel

保存并退出。然后重建 tar 文件。

$ 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
Run Code Online (Sandbox Code Playgroud)

然后再试一次。

这让我重新开始工作。