kali 很多要安装,但是VMTOOLS 会遇到很多问题,今天就来解决一下:
1)解决安装vmware-tools出现的“The path "" is not a valid path to the 3.2.0-4-amd64 kernel headers”问题
1 sudo apt-get update
2 sudo apt-get install build-essential3 sudo apt-get install linux-headers-$(uname -r)安装对应版本的 kernel headers 可以tab 出来的
我的是 3.14-kali-686-pae
2)/etc/init.d/vmware-tools: 1090: local: ': bad variable name Blocking file system: failed
错误地方为:
local run_kver='get_version_integer'
看到是这个函数
# uname –r
3.7-trunk-686-pae
v1="3"
v2="7-trunk-686-pae"
v3=""
kernel_version_integer() {
echo $(((($1 * 256) + $2) * 256 + $3))
}
代码原意是
The correct operation should be:
((3 * 256) + 7) * 256 + 0
最后错误实现为 所以错了
((3 * 256) + 7-trunk-686-pae) * 256 +0
然后我们修改代码为:
get_version_integer() {
local version_uts
local v1
local v2
local v3
version_uts=`uname -r`
# There is no double quote around the back-quoted expression on purpose
# There is no double quote around $version_uts on purpose
set `IFS='.'; echo $version_uts`
v1="$1"
v2="$2"
v3="$3"
# There is no double quote around the back-quoted expression on purpose
# There is no double quote around $v3 on purpose
if [ -z "$v1" ]; then
v1="0"
else
set `IFS='-ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; echo $v1`
v1="$1"
fi
if [ -z "$v2" ]; then
v2="0"
else
set `IFS='-ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; echo $v2`
v2="$1"
fi
if [ -z "$v3" ]; then
v3="0"
else
set `IFS='-ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'; echo $v3`
v3="$1"
fi
kernel_version_integer "$v1" "$v2" "$v3"
}
还没说完呢,因为每次运行 vmware-config-tools.pl 都会重写 /etc/init.d/vmware-tools
所以我们在运行 vmware-config-tools.pl 后再去修改就可以了 最后成功