0x00 前言

这个问题还是弄到了凌晨三点,最可恶的是还弄不好。。

早上起了个大早继续弄,在逛pd的论坛发现里面说了pd现在还不支持最新的5.18内核,所以还是建议安装5.16和5.17,5.17我还找不到,所以就用5.16成功安装了。

有兴趣的同学可以去尝试安装GalaxyMaster)的补丁包,我是没能成功:

https://forum.parallels.com/threads/patch-support-for-kernel-5-18-parallel-tools-17-1-4-51567.357611/

0x01 解决问题

1、环境

  • macOS Monterey 12.3
  • Parallels Desktop 17.1.2
  • Kali Linux 2022.2 (linux-headers-5.16-kali5)

2、解决过程

更新源:

apt-get update

挂载parallels tools并移动到桌面:

cp -R /media/cdrom0/ ~/Desktop/pdtools/

安装

./install

这个时候就开始出错了,因为之前报错的log:

In file included from /usr/src/linux-headers-5.16.0-kali7-common/include/linux/io.h:13,
                 from /usr/src/linux-headers-5.16.0-kali7-common/include/linux/pci.h:39,
                 from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:7:
/usr/src/linux-headers-5.16.0-kali7-common/arch/x86/include/asm/io.h:281:41: note: expected 'int' but argument is of type 'void *'
  281 | static inline unsigned type in##bwl(int port)                           \
      |                                     ~~~~^~~~
/usr/src/linux-headers-5.16.0-kali7-common/arch/x86/include/asm/io.h:336:1: note: in expansion of macro 'BUILDIO'
  336 | BUILDIO(l, , int)
      | ^~~~~~~
In file included from /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:11:
...
...
/bin/sh: 1: /usr/src/linux-headers-5.16.0-kali7-common/scripts/pahole-flags.sh: not found
  CC [M]  /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/pvmnet.o
  LD [M]  /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/prl_eth.o
/bin/sh: 1: /usr/src/linux-headers-5.16.0-kali7-common/scripts/pahole-flags.sh: not found
/bin/sh: 1: /usr/src/linux-headers-5.16.0-kali7-common/scripts/pahole-flags.sh: not found
  MODPOST /usr/lib/parallels-tools/kmods/prl_eth/pvmnet/Module.symvers

这里不展示安装补丁的过程了,因为没成功,但是有一个点可以提醒一下,关于执行补丁命令论坛里面说的命令是:

patch -p1 file.patch

-p1 是表示忽略第一层目录

但是执行会停留在那里不动,可以使用以下的命令进行:

patch -p1 < file.patch

下面是5.16内核的安装方法

我们直接执行./install 一般会出现系统缺少了dkmslinux-header,可以使用下面的命令进行安装:

apt install dkms

但安装头文件的时候就出问题了,我们可以直接去找软件包进行安装:

http://old.kali.org/kali/pool/main/l/linux/

下载以下的文件

如果提示缺少kbuild可以下载:

使用dpkg -i安装就完事了:

dpkg -i linux-kbuild-5.16_5.16.18-1kali1_amd64.deb
dpkg -i linux-kbuild-5.16-dbgsym_5.16.18-1kali1_amd64.deb
dpkg -i linux-headers-5.16.0-kali7-common_5.16.18-1kali1_all.deb
dpkg -i linux-headers-5.16.0-kali7-amd64_5.16.18-1kali1_amd64.deb

最后重新执行以安装文件:

./install

重启就可以正常使用了~

0x02 总结

可以参考一下pd论坛,上面很多大神可以解决问题:

https://forum.parallels.com/forums/linux-guest-os-discussion.61/

附上论坛里面的一个解决方案:

Got it working with these steps.
sudo apt-get update
sudo apt-get install dkms
sudo apt-get install libelf-dev

Downloaded the 3 file from https://http.kali.org/kali/pool/main/l/linux/
linux-headers-5.16.0-kali7-arm64_5.16.18-1kali1_arm64.deb
linux-kbuild-5.16_5.16.18-1kali1_arm64.deb
linux-headers-5.16.0-kali7-common_5.16.18-1kali1_all.deb

sudo dpkg -i linux-headers-5.16.0-kali7-common_5.16.18-1kali1_all.deb
sudo dpkg -i linux-kbuild-5.16_5.16.18-1kali1_arm64.deb
sudo dpkg -i linux-headers-5.16.0-kali7-arm64_5.16.18-1kali1_arm64.deb

Install tools
sudo mount -oro,exec,remount /media/cdrom0
sudo /media/cdrom0/install

Hope that helps.

如果已经更新了5.18的版本可以重启到启动解决,选择高级->选择5.16的版本进行启动然后按照上面的步骤进行。