ubuntu10上安装vmwaretool

本文详细介绍了在Ubuntu 10.10上安装VMWare Tools时可能遇到的问题及解决办法,包括如何正确指定内核头文件路径、解决内核版本不匹配问题以及缺失autoconf.h文件的处理方案。

Install VMware Tool

#sudo -i 切换到root用户下

 root# ./vmware-install.pl

Ubuntu 10.10 在安装的时候目前会碰到几个问题:

Console代码
What is the location of the directory of C header files that match your running 
kernel? [/usr/src/linux/include] <直接按 Enter> 
 
The path "/usr/src/linux/include"  is not an existing directory. 
What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] <直接按 Enter>

The path "/usr/src/linux/include" is not an existing directory.
由于 Kernel 版本是 APT 抓下來的最新版,所以会需要输入 “/usr/src/linux-headers-2.6.35-22-generic/include “

要注意的是,VMWare Tools 安装时会询问目前系统使用的 Kernel header,所以如果 /usr/src 下有多个 Kernel header 目录,最好先执行 “uname -r“ 指令,确认应该使用那个本版。

Console代码
What is the location of the directory of C header files that match your running  kernel? 【/usr/src/linux/include] /usr/src/linux-headers-2.6 . 35 - 22 -generic/include 
What is the location of the directory of C header files that match your running
kernel? [/usr/src/linux/include] /usr/src/linux-headers-2.6.35-22-generic/include
按回车以后,还是报错说,指定的Kernel headers喝当前系统使用的版本不匹配。

Console代码
The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match 
your running kernel (version 2.6 . 35 - 22 -generic). Even if the module were to 
compile successfully, it would not load into the running kernel.   
The directory of kernel headers (version @@VMWARE@@ UTS_RELEASE) does not match
your running kernel (version 2.6.35-22-generic). Even if the module were to
compile successfully, it would not load into the running kernel.  
但事实并不是不匹配,而是 Kernel 中有一个变量 UTS_RELEASE 的不存在了。以前这个定义放在 /usr/src/linux-headers-2.6.35-22-generic/include/linux/version.h ,而现在已经移到了/usr/src/linux-headers-2.6.35-22-generic/include/generated /utsrelease.h。所以简单的方法,我们只需要在version.h中添加 #define UTS_RELEASE "2.6.35-22-generic" (具体值使用 “uname -r“ 查看)

接下来继续,又会有新的错误提示!! -_-|| 找不到 autoconf.h 原因是因为 autoconf.h 不再VMware tools 安装程序预设的寻址目录中。

Console代码
The path  "/usr/src/linux-headers-2.6.35-22-generic/include"  is a kernel header 
file directory, but it does not contain the file "linux/autoconf.h"  as 
expected. This can happen if the kernel has never been built, or if you have 
invoked the "make mrproper"  command in your kernel directory. In any case, you 
may want to rebuild your kernel.   
The path "/usr/src/linux-headers-2.6.35-22-generic/include" is a kernel header
file directory, but it does not contain the file "linux/autoconf.h" as
expected. This can happen if the kernel has never been built, or if you have
invoked the "make mrproper" command in your kernel directory. In any case, you
may want to rebuild your kernel.  
可以简单的把它链接过来:

cd /usr/src/linux-headers-2.6.35-22-generic/include/linux

sudo ln -s ../generated/autoconf.h ./ (../generated/autoconf.h是原文件。)

下面可以正常了。 

### Ubuntu 上重新安装 VMware Tools 的操作步骤 在 Ubuntu 虚拟机中重新安装 VMware Tools 工具可以按照以下方法实现。以下是详细的说明: #### 卸载已有的 VMware Tools 如果系统中已经存在旧版本的 VMware Tools,则需要先卸载它们,以避免冲突。可以通过以下命令完成此操作: ```bash sudo apt-get autoremove --purge open-vm-tools open-vm-tools-desktop ``` 上述命令会彻底删除现有的 `open-vm-tools` 和其桌面组件[^2]。 #### 准备工作 启动虚拟机并挂载 VMware Tools ISO 文件到 `/mnt` 目录下。通过 VMware GUI 或者快捷键组合 (Ctrl + D),将 VMware Tools 镜像加载到虚拟光驱中[^1]。 验证镜像是否成功挂载: ```bash ls /mnt/ ``` #### 复制并解压 VMware Tools 压缩包 复制 VMware Tools 到临时目录 `/tmp` 并进行解压缩: ```bash cp /mnt/VMwareTools-*.tar.gz /tmp cd /tmp tar -zxvf VMwareTools-*.tar.gz cd vmware-tools-distrib ``` 以上步骤确保了 VMware Tools 的源码被正确提取至当前路径[^3]。 #### 执行安装脚本 运行安装程序,并按提示逐步完成配置: ```bash sudo ./vmware-install.pl ``` 大多数情况下,接受默认选项即可满足需求。如果有特殊需求,可以根据实际情况调整设置。 #### 更新依赖项(可选) 为了进一步优化环境,在某些场景下可能还需要额外安装支持库: ```bash sudo apt-get update sudo apt-get install build-essential linux-headers-$(uname -r) ``` 这些工具对于编译模块至关重要,尤其是在较新的 Linux 内核环境下[^4]。 #### 安装 Open VM Tools Desktop 组件 作为替代方案或者补充措施,可以直接利用 APT 包管理器快速部署官方维护版的 VMware Tools 功能集: ```bash sudo apt-get install open-vm-tools-desktop -y ``` 该方式无需手动干预,适合追求简便性的用户群体[^5]。 最后重启计算机使更改生效: ```bash sudo reboot ``` --- ### 注意事项 - 如果遇到错误消息提到缺少内核头文件或其他开发套件,请确认是否遗漏了必要的构建工具链。 - 对于图形界面的支持部分功能仅限于 `open-vm-tools-desktop` 版本提供;而原生 VMware 提供的二进制形式则更加全面兼容硬件特性。 ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值