在mac上,用paralles虛擬機安裝完ubuntu時,在Parallels 版本小於13.3.1且ubuntu版本大於14.4.4時會出現paralles tools安裝失敗的現象,具體以下圖node
能夠經過以下步驟修復:linux
cd /media/<username>/Parallels Tools/
mkdir ~/Desktop/tools
cp -pr * ~/Desktop/tools
cd ~/Desktop/tools
chmod -R 777 kmodsgit
在壓縮工具裏用gedit打開./prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c,在其餘include的代碼後面添加以下代碼github
#include <linux/vmalloc.h>
在壓縮工具裏用gedit打開./prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c,找到prlfs_follow_link (大約在650行)並修改成以下代碼(包括 compat_follow_link_t)ubuntu
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) #define compat_follow_link_t const char* #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) #define compat_follow_link_t void* #else #define compat_follow_link_t int #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) static compat_follow_link_t prlfs_follow_link(struct dentry *dentry, void **cookie) #else static compat_follow_link_t prlfs_follow_link(struct dentry *dentry, struct nameidata *nd) #endif { #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) return do_read_symlink(dentry); #else #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) nd_set_link(nd, do_read_symlink(dentry)); #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) return NULL; #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) return 0; #else return vfs_follow_link(nd, do_read_symlink(dentry)); #endif #endif }
在~/Desktop/tools目錄執行以下命令:cookie
sudo ./install
MODULE_LICENSE("Parallels"); 爲 MODULE_LICENSE("GPL");
而後保存並更新壓縮包工具
進入"prl_tg/Toolgate/Guest/Linux/prl_tg/" (cd ~/Desktop/parallels_fixed/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg) 目錄,修改prltg.c文件,在1535行,修改spa
MODULE_LICENSE("Parallels"); 爲 MODULE_LICENSE("GPL");
而後保存並更新壓縮包.net
進入"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行,修改code
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
而後保存並更新壓縮包
最後在~/Desktop/parallels_fixed目錄執行以下命令:
sudo ./install
ref:
參考1
參考2