最近在 PD 中安装了新版的 Mint Linux,死活装不上 PD,很多功能无法正常使用。
看了一下日志,是因为内核的原因造成的问题,Google 一波之后,找到了解决办法,整理一下分享给大家,下文是以 Ubuntu 18.04 作为实验对象,应该是新版本的内核都适用。
本文介绍方法出处:
https://gist.github.com/rudolfratusinski/a4d9e3caff11a4d9d81d2e84abc9afbf
准备
- 选中虚拟机,点击 Parallels Action -> "Install Parallels Tools"
- 包含" Parallels Tools" 的CD 被插入 Ubuntu 虚拟机中。
- 双击打开 CD,拷贝所有的内容到一个新文件夹,起个有识别度的名字,比如"parallels_fixed"
- 打开终端,cd 到该目录
- 给 install 增加执行权限(chmod +x install)
- cd 到 "installer" 目录
- 给一些脚本文件增加可执行权限:
chmod +x installer.* *.sh prl_*
必须修改一些文件
- 到 kmods 目录(cd ~/Desktop/parallels_fixed/kmods),解压缩文件(tar -xzf prl_mod.tar.gz)
- 删除
prl_mod.tar.gz(rm prl_mod.tar.gz)
修改文件1/3
- 打开 "prl_eth/pvmnet/" 目录(cd ~/Desktop/parallels_fixed/kmods/prl_eth/pvmnet)
- 使用文本编辑器打开"pvmnet.c"文件
- 编辑438行:
MODULE_LICENSE("Parallels");
修改为:
MODULE_LICENSE("GPL");
- 保存
修改文件2/3
- 打开 "prl_tg/Toolgate/Guest/Linux/prl_tg/" 目录 (cd ~/Desktop/parallels_fixed/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg)
- 使用文本编辑器打开"prltg.c"
- 编辑1535行:
MODULE_LICENSE("Parallels");
修改为:
MODULE_LICENSE("GPL");
- 保存
修改文件3/3
- 打开"prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/" 目录(cd ~/Desktop/parallels_fixed/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze)
- 使用文本编辑器打开"prl_fs_freeze.c"文件
- 在212行,你将找到"thaw_timer_fn"函数
void thaw_timer_fn(unsigned long data)
{
struct work_struct *work = (struct work_struct *)data;
schedule_work(work);
}
修改为:
void thaw_timer_fn(unsigned long data)
{
struct work_struct *work = (struct work_struct *)data;
schedule_work(work);
}
void thaw_timer_fn_new_kernel(struct timer_list *data)
{
struct work_struct *work = data->expires;
schedule_work(work);
}
然后找到220行:
DEFINE_TIMER(thaw_timer, thaw_timer_fn, 0, (unsigned long)&(thaw_work));
修改为:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
DEFINE_TIMER(thaw_timer, thaw_timer_fn_new_kernel);
#else
DEFINE_TIMER(thaw_timer, thaw_timer_fn, 0, (unsigned long)&(thaw_work));
#endif
打包
- 回到
kmods目录(cd ~/Desktop/parallels_fixed/kmods),执行:tar -zcvf prl_mod.tar.gz . dkms.conf Makefile.kmods - 目录中将会生成 "prl_mod.tar.gz" 文件
安装
- 回到顶级目录(cd ../ 或者 cd ~/Desktop/parallels_fixed),然后执行
sudo ./install进行安装。
这时应该正常了。