Parallels 13.3.1如下Ubuntu安裝Tools error處理

Parallels 13.3.1如下Ubuntu安裝Tools error處理

在mac上,用paralles虛擬機安裝完ubuntu時,在Parallels 版本小於13.3.1且ubuntu版本大於14.4.4時會出現paralles tools安裝失敗的現象,具體以下圖node

圖片描述

圖片描述

狀況一:Parallels 版本小於12,且Ubuntu版本小於16時

能夠經過以下步驟修復:linux

  1. 掛載 Parallels Tools鏡像
  2. 打開一個terminal,執行以下命令(或者手動複製後添加相應權限)

    cd /media/<username>/Parallels Tools/
    mkdir ~/Desktop/tools
    cp -pr * ~/Desktop/tools
    cd ~/Desktop/tools
    chmod -R 777 kmodsgit

  3. 用解壓縮工具打開~/Desktop/tools/kmods目錄下的prl_mod.tar.gz
  4. 在壓縮工具裏用gedit打開./prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c,在其餘include的代碼後面添加以下代碼github

    #include <linux/vmalloc.h>
  5. 在壓縮工具裏用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
    }
  6. 在~/Desktop/tools目錄執行以下命令:cookie

    sudo ./install

狀況二:不符合以上狀況或上面沒解決時嘗試

  1. 掛載 Parallels Tools鏡像
  2. 打開一個terminal,執行以下命令(或者手動複製後添加相應權限)
    cd /media/<username>/Parallels Tools/
    mkdir ~/Desktop/parallels_fixed
    cp -pr * ~/Desktop/parallels_fixed
    cd ~/Desktop/parallels_fixed
    chmod -R 777 kmods
  3. 用解壓縮工具打開~/Desktop/tools/kmods目錄下的prl_mod.tar.gz
  4. 修改3個文件
  • 進入"prl_eth/pvmnet/" (cd ~/Desktop/parallels_fixed/kmods/prl_eth/pvmnet) 目錄,修改pvmnet.c文件,在438行,修改
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

其餘

  • 在parallels 13.3.1版本中已經對tools在ubuntu目前的最新版18.04提供了支持,升級parallels是最簡單的解決方案
  • 前文的兩種方法是在網上處處搜索實踐比較得出的有效的方法,這裏感謝上面兩個方法的提供者
  • 若是你不想升級parallels,也以爲按上面說的改文件太麻煩,這裏提供一份我修改好的供你們使用,下載而後給權限,執行sudo ./install便可 (fix-Parallels-Tools-for-Ubuntu)

ref:

參考1
參考2
相關文章
相關標籤/搜索