兵團基地

一起學習、共同進步。
兵團基地

Kali Linux 2021.2 安装 Parallels Guest Tools 失败的解决办法

1. 起因

安装 Kali Linux 2021.2 失败。

我尝试了用官方的直装系统(4G+那个),然后自已升级系统;也试了VirtualBox (但VirtualBox 在Mac 上是真的好难用🌚)因为太不好用就缷了。最后还是回来用Parallels 了。不过在安装Parallels Tools 时发现怎么装都装不上。。

2. 现象

这次用的是官方网络直装版(300m+),也就是软件会在安装时下载。等于安装加更新一起做了。记得在开始前设置好安装的源到国内,这样下载才快。

常见源:

# 官方源
 deb http://http.kali.org/kali kali-rolling main non-free contrib
 deb-src http://http.kali.org/kali kali-rolling main non-free contrib
 
 # 中科大源
 deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
 deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
 
 # 阿里云源
 deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
 deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
 
 # 清华大学源
 deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
 deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
 
 # 浙大源
 deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
 deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
 
 # 东软大学源
 deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
 deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
 
 # 新加坡 Kali源
 deb http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
 deb-src http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
 
 # 163 Kali源
 deb http://mirrors.163.com/debian wheezy main non-free contrib
 deb-src http://mirrors.163.com/debian wheezy main non-free contrib
 

安装好系统后,点击菜单的Parallels Guest Tools 开始安装。

直接安装的话可能会出现以下这两个错误,如果不是这个错误的话就可以不用看下去了😆

make[2]: Entering directory '/usr/src/linux-headers-5.10.0-kali9-amd64'
   CC [M]  /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.o
   CC [M]  /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.o
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c: In function 'init_buffer_descriptor':
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:58:31: error: implicit declaration of function 'segment_eq' [-Werror=implicit-function-declaration]
    58 |  bd->user = (user == 0) ? 0 : segment_eq(get_fs(), USER_DS) ? 1 : 0;
       |                               ^~~~~~~~~~
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:58:42: error: implicit declaration of function 'get_fs'; did you mean 'sget_fc'? [-Werror=implicit-function-declaration]
    58 |  bd->user = (user == 0) ? 0 : segment_eq(get_fs(), USER_DS) ? 1 : 0;
       |                                          ^~~~~~
       |                                          sget_fc
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:58:52: error: 'USER_DS' undeclared (first use in this function); did you mean 'USER_HZ'?
    58 |  bd->user = (user == 0) ? 0 : segment_eq(get_fs(), USER_DS) ? 1 : 0;
       |                                                    ^~~~~~~
       |                                                    USER_HZ
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:58:52: note: each undeclared identifier is reported only once for each function it appears in
 cc1: some warnings being treated as errors
 make[4]: *** [/usr/src/linux-headers-5.10.0-kali9-common/scripts/Makefile.build:284: /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.o] Error 1
 
make[2]: Entering directory '/usr/src/linux-headers-5.10.0-kali9-amd64'
   CC [M]  /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.o
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c: In function 'freeze_sb':
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:115:8: error: implicit declaration of function 'freeze_bdev'; did you mean 'freeze_sb'? [-Werror=implicit-function-declaration]
   115 |  res = freeze_bdev(sb->s_bdev);
       |        ^~~~~~~~~~~
       |        freeze_sb
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:115:6: warning: assignment to 'struct super_block *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   115 |  res = freeze_bdev(sb->s_bdev);
       |      ^
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c: In function 'thaw_sb':
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:136:3: error: implicit declaration of function 'thaw_bdev' [-Werror=implicit-function-declaration]
   136 |   thaw_bdev(fsb->sb->s_bdev, fsb->sb);
       |   ^~~~~~~~~
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c: In function 'seq_show':
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:330:11: error: 'BDEVNAME_SIZE' undeclared (first use in this function); did you mean 'FRAME_SIZE'?
   330 |  char buf[BDEVNAME_SIZE];
       |           ^~~~~~~~~~~~~
       |           FRAME_SIZE
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:330:11: note: each undeclared identifier is reported only once for each function it appears in
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:333:2: error: implicit declaration of function 'bdevname' [-Werror=implicit-function-declaration]
   333 |  bdevname(fsb->sb->s_bdev, buf);
       |  ^~~~~~~~
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:330:7: warning: unused variable 'buf' [-Wunused-variable]
   330 |  char buf[BDEVNAME_SIZE];
       |       ^~~
 cc1: some warnings being treated as errors
 make[4]: *** [/usr/src/linux-headers-5.10.0-kali9-common/scripts/Makefile.build:284: /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.o] Error 1
 make[3]: *** [/usr/src/linux-headers-5.10.0-kali9-common/Makefile:1845: /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze] Error 2
 make[2]: *** [/usr/src/linux-headers-5.10.0-kali9-common/Makefile:185: __sub-make] Error 2
 

3. 解决

因为镜像里的文件没法直接修改,所以我们要先复制文件出去。

sudo su && cd ~
 cp -r /media/cdrom0 .
 cd cdrom0/kmods
 tar -zxvf prl_mod.tar.gz
 

然后修改:

# 这个文件在头部增加两句
 vi ./prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
 
/*
  *   prlfs/inode.c
  *
  *   Copyright (C) 1999-2016 Parallels International GmbH
  *   Author: Vasily Averin <vvs@parallels.com>
  *
  *   Parallels linux shared folders filesystem
  *
  *   Inode related functions
  */
 
 + #define segment_eq(a, b) (b)
 + #define USER_DS 1
 #include <linux/module.h>
 #include <linux/fs.h>
 #include "prlfs.h"
 #include <linux/ctype.h>
 #include <linux/pagemap.h>
 #include <linux/namei.h>
 #include <linux/cred.h>
 
# 这个文件在头部增加一句
 vi ./prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c
 
///////////////////////////////////////////////////////////////////////////////
 ///
 /// @file prl_freeze.c
 ///
 /// kernel module for suspend or resume
 ///
 /// Copyright (c) 1999-2016 Parallels International GmbH.
 /// All rights reserved.
 /// http://www.parallels.com
 ///
 ///////////////////////////////////////////////////////////////////////////////
 
 
 + #include <linux/blkdev.h>
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/buffer_head.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 

做完上面的修改后,重新打包一下文件就可以安装了:

rm prl_mod.tar.gz
 tar -zcvf prl_mod.tar.gz . dkms.conf Makefile.kmods
 
 cd ~/cdrom0
 chmod 777 ./installer/*.sh
 ./installer/install-cli.sh -i --verbose
 

耐心等待安装完成就可以了~

Kali Linux 2021.2 安装 Parallels Guest Tools 失败的解决办法

1. 起因

安装 Kali Linux 2021.2 失败。

我尝试了用官方的直装系统(4G+那个),然后自已升级系统;也试了VirtualBox (但VirtualBox 在Mac 上是真的好难用🌚)因为太不好用就缷了。最后还是回来用Parallels 了。不过在安装Parallels Tools 时发现怎么装都装不上。。

2. 现象

这次用的是官方网络直装版(300m+),也就是软件会在安装时下载。等于安装加更新一起做了。记得在开始前设置好安装的源到国内,这样下载才快。

常见源:

# 官方源
 deb http://http.kali.org/kali kali-rolling main non-free contrib
 deb-src http://http.kali.org/kali kali-rolling main non-free contrib
 
 # 中科大源
 deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
 deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
 
 # 阿里云源
 deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
 deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
 
 # 清华大学源
 deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
 deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
 
 # 浙大源
 deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
 deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
 
 # 东软大学源
 deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
 deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
 
 # 新加坡 Kali源
 deb http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
 deb-src http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
 
 # 163 Kali源
 deb http://mirrors.163.com/debian wheezy main non-free contrib
 deb-src http://mirrors.163.com/debian wheezy main non-free contrib
 

安装好系统后,点击菜单的Parallels Guest Tools 开始安装。

直接安装的话可能会出现以下这两个错误,如果不是这个错误的话就可以不用看下去了😆

make[2]: Entering directory '/usr/src/linux-headers-5.10.0-kali9-amd64'
   CC [M]  /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/super.o
   CC [M]  /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.o
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c: In function 'init_buffer_descriptor':
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:58:31: error: implicit declaration of function 'segment_eq' [-Werror=implicit-function-declaration]
    58 |  bd->user = (user == 0) ? 0 : segment_eq(get_fs(), USER_DS) ? 1 : 0;
       |                               ^~~~~~~~~~
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:58:42: error: implicit declaration of function 'get_fs'; did you mean 'sget_fc'? [-Werror=implicit-function-declaration]
    58 |  bd->user = (user == 0) ? 0 : segment_eq(get_fs(), USER_DS) ? 1 : 0;
       |                                          ^~~~~~
       |                                          sget_fc
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:58:52: error: 'USER_DS' undeclared (first use in this function); did you mean 'USER_HZ'?
    58 |  bd->user = (user == 0) ? 0 : segment_eq(get_fs(), USER_DS) ? 1 : 0;
       |                                                    ^~~~~~~
       |                                                    USER_HZ
 /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c:58:52: note: each undeclared identifier is reported only once for each function it appears in
 cc1: some warnings being treated as errors
 make[4]: *** [/usr/src/linux-headers-5.10.0-kali9-common/scripts/Makefile.build:284: /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.o] Error 1
 
make[2]: Entering directory '/usr/src/linux-headers-5.10.0-kali9-amd64'
   CC [M]  /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.o
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c: In function 'freeze_sb':
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:115:8: error: implicit declaration of function 'freeze_bdev'; did you mean 'freeze_sb'? [-Werror=implicit-function-declaration]
   115 |  res = freeze_bdev(sb->s_bdev);
       |        ^~~~~~~~~~~
       |        freeze_sb
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:115:6: warning: assignment to 'struct super_block *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   115 |  res = freeze_bdev(sb->s_bdev);
       |      ^
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c: In function 'thaw_sb':
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:136:3: error: implicit declaration of function 'thaw_bdev' [-Werror=implicit-function-declaration]
   136 |   thaw_bdev(fsb->sb->s_bdev, fsb->sb);
       |   ^~~~~~~~~
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c: In function 'seq_show':
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:330:11: error: 'BDEVNAME_SIZE' undeclared (first use in this function); did you mean 'FRAME_SIZE'?
   330 |  char buf[BDEVNAME_SIZE];
       |           ^~~~~~~~~~~~~
       |           FRAME_SIZE
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:330:11: note: each undeclared identifier is reported only once for each function it appears in
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:333:2: error: implicit declaration of function 'bdevname' [-Werror=implicit-function-declaration]
   333 |  bdevname(fsb->sb->s_bdev, buf);
       |  ^~~~~~~~
 /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c:330:7: warning: unused variable 'buf' [-Wunused-variable]
   330 |  char buf[BDEVNAME_SIZE];
       |       ^~~
 cc1: some warnings being treated as errors
 make[4]: *** [/usr/src/linux-headers-5.10.0-kali9-common/scripts/Makefile.build:284: /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.o] Error 1
 make[3]: *** [/usr/src/linux-headers-5.10.0-kali9-common/Makefile:1845: /usr/lib/parallels-tools/kmods/prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze] Error 2
 make[2]: *** [/usr/src/linux-headers-5.10.0-kali9-common/Makefile:185: __sub-make] Error 2
 

3. 解决

因为镜像里的文件没法直接修改,所以我们要先复制文件出去。

sudo su && cd ~
 cp -r /media/cdrom0 .
 cd cdrom0/kmods
 tar -zxvf prl_mod.tar.gz
 

然后修改:

# 这个文件在头部增加两句
 vi ./prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
 
/*
  *   prlfs/inode.c
  *
  *   Copyright (C) 1999-2016 Parallels International GmbH
  *   Author: Vasily Averin <vvs@parallels.com>
  *
  *   Parallels linux shared folders filesystem
  *
  *   Inode related functions
  */
 
 + #define segment_eq(a, b) (b)
 + #define USER_DS 1
 #include <linux/module.h>
 #include <linux/fs.h>
 #include "prlfs.h"
 #include <linux/ctype.h>
 #include <linux/pagemap.h>
 #include <linux/namei.h>
 #include <linux/cred.h>
 
# 这个文件在头部增加一句
 vi ./prl_fs_freeze/Snapshot/Guest/Linux/prl_freeze/prl_fs_freeze.c
 
///////////////////////////////////////////////////////////////////////////////
 ///
 /// @file prl_freeze.c
 ///
 /// kernel module for suspend or resume
 ///
 /// Copyright (c) 1999-2016 Parallels International GmbH.
 /// All rights reserved.
 /// http://www.parallels.com
 ///
 ///////////////////////////////////////////////////////////////////////////////
 
 
 + #include <linux/blkdev.h>
 #include <linux/version.h>
 #include <linux/module.h>
 #include <linux/fs.h>
 #include <linux/buffer_head.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 

做完上面的修改后,重新打包一下文件就可以安装了:

rm prl_mod.tar.gz
 tar -zcvf prl_mod.tar.gz . dkms.conf Makefile.kmods
 
 cd ~/cdrom0
 chmod 777 ./installer/*.sh
 ./installer/install-cli.sh -i --verbose
 

耐心等待安装完成就可以了~

兵团基地
Power by React, GraphQL | Design by Puls Garney | Version: 3.1.6
Copyright © 2017-2024 Puls Garney - All Rights Reserved.
Power by React, GraphQL
Design by Puls Garney
Version: 3.1.6

Copyright © 2017-2024 Puls Garney
All Rights Reserved.