Debian下安装VMware Tools

我在VMware中装上Debian/Linux后就是装不上VMware-tools,在网上搜集了一下资料没有一个适合我的,而且讲的都是很简单就装上来,没办法,只能自己下手,经过几个小时的努力终于解决了,现在把自己的方法公布给大家,防止大家走弯路。

用到了以下几个命令apt-get、apt-cache、uname-a

首先检查的Debian在安装时,根本就没有安装gcc、内核头文件也没有。

执行步骤如下:

1.在vmware的菜单中选择Vm->install vmware-tools,这个时候vmware就会把安装文件映射到你的cdrom。

2.进入你的cdrom,点右键复制VMwareTools-5.5.0-18463.tar.gz到/tmp目录下,右键单击选择解压。当然这两步你也可以使用命令行方式,我对命令行不熟悉。详细的命令行方式,大家自己在网上就能搜到资料。

3.安装c编译器(前提没有安装gcc,可以通过which gcc命令来查看是否已安装)。

a.在命令行中键入:su (进入root进行程序安装,普通用户不能使用apt-get install),输入root的密码即可此时命令行从qinfengling@debian:$变为debian:/home/qinfengling#

b:接着在命令行中键入apt-get install gcc,选择默认就可顺利装上著名的gcc编译器

4.安装kernel-header (主要是为了解决What is the location of the directory of C header files that match your running kernel?问题),步骤如下:

a.在命令行中键入:uname -a 查看版本我的版本是:Linux debian 2.6.18-4-686

b.接着键入:apt-cache search headers 2.6.18-4-686(然后搜一下内核的头文件)

c.键入命令安装:apt-get install Linux hearders-2.6.18-2-686

5.之后你就顺利了,首先在命令行中进入/tmp/vmware-tools-distrib文件夹下,之后输入./vmware-install.pl,选择默认安装就行了,遇到[yes]就输入yes或者y。

之后就会出现如下类似的提示:

A previous installation of VMware software has been detected.
The previous installation was made by the tar installer (version 3).
Keeping the tar3 installer database format.
Uninstalling the tar installation of VMware Tools.
Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [确定]
File /etc/X11/xorg.conf is backed up to /etc/X11/xorg.conf.old.0.
File /etc/modprobe.conf is backed up to /etc/modprobe.conf.old.0.
The removal of VMware Tools 5.5.3 build-34685 for Linux completed successfully.
Thank you for having tried this software.
Installing the content of the package.
In which directory do you want to install the binary files?
[/usr/bin]
What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]
What is the directory that contains the init scripts?
[/etc/rc.d/init.d]
In which directory do you want to install the daemon files?
[/usr/sbin]
In which directory do you want to install the library files?
[/usr/lib/vmware-tools]
The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]
The installation of VMware Tools 5.5.3 build-34685 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".
Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes] (运行vmware-config-tools来配置)

Stopping VMware Tools services in the virtual machine:
Guest operating system daemon: [确定]
Trying to find a suitable vmhgfs module for your running kernel.
None of the pre-built vmhgfs modules for VMware Tools is suitable for your
running kernel. Do you want this program to try to build the vmhgfs module for
your system (you need to have a C compiler installed on your system)? [yes]
Using compiler "/usr/bin/gcc". Use environment variable CC to override.
9.直到该步骤,拷贝粘贴第7步的路径,然后一直按回车,直到选择屏幕分辨率。
What is the location of the directory of C header files that match your running
kernel? [/usr/src/kernels/2.6.18-1.2849.fc6-i686/include]
Extracting the sources of the vmhgfs module.
Building the vmhgfs module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config3/vmhgfs-only'
make -C /usr/src/kernels/2.6.18-1.2849.fc6-i686/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-1.2849.fc6-i686'
CC [M] /tmp/vmware-config3/vmhgfs-only/cpName.o
CC [M] /tmp/vmware-config3/vmhgfs-only/cpNameLinux.o
CC [M] /tmp/vmware-config3/vmhgfs-only/dev.o
CC [M] /tmp/vmware-config3/vmhgfs-only/driver.o
CC [M] /tmp/vmware-config3/vmhgfs-only/hgfsUtil.o
CC [M] /tmp/vmware-config3/vmhgfs-only/main.o
CC [M] /tmp/vmware-config3/vmhgfs-only/staticEscape.o
LD [M] /tmp/vmware-config3/vmhgfs-only/vmhgfs.o
Building modules, stage 2.
MODPOST
CC /tmp/vmware-config3/vmhgfs-only/vmhgfs.mod.o
LD [M] /tmp/vmware-config3/vmhgfs-only/vmhgfs.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-1.2849.fc6-i686'
cp -f vmhgfs.ko ./../vmhgfs.o
make: Leaving directory `/tmp/vmware-config3/vmhgfs-only'
Unable to make a vmhgfs module that can be loaded in the running kernel:
insmod: error inserting '/tmp/vmware-config3/vmhgfs.o': -1 Invalid module format
There is probably a slight difference in the kernel configuration between the
set of C header files you specified and your running kernel. You may want to
rebuild a kernel based on that directory, or specify another directory.
The filesystem driver (vmhgfs module) is used only for the shared folder
feature. The rest of the software provided by VMware Tools is designed to work
independently of this feature.
If you wish to have the shared folders feature, you can install the driver by
running vmware-config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine.
These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]
pcnet32 38085 0
Unloading pcnet32 module
Trying to find a suitable vmxnet module for your running kernel.
None of the pre-built vmxnet modules for VMware Tools is suitable for your
running kernel. Do you want this program to try to build the vmxnet module for
your system (you need to have a C compiler installed on your system)? [yes]
Extracting the sources of the vmxnet module.
Building the vmxnet module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config4/vmxnet-only'
make -C /usr/src/kernels/2.6.18-1.2849.fc6-i686/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-1.2849.fc6-i686'
CC [M] /tmp/vmware-config4/vmxnet-only/vmxnet.o
Building modules, stage 2.
MODPOST
CC /tmp/vmware-config4/vmxnet-only/vmxnet.mod.o
LD [M] /tmp/vmware-config4/vmxnet-only/vmxnet.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-1.2849.fc6-i686'
cp -f vmxnet.ko ./../vmxnet.o
make: Leaving directory `/tmp/vmware-config4/vmxnet-only'
Unable to make a vmxnet module that can be loaded in the running kernel:
insmod: error inserting '/tmp/vmware-config4/vmxnet.o': -1 Invalid module format
There is probably a slight difference in the kernel configuration between the
set of C header files you specified and your running kernel. You may want to
rebuild a kernel based on that directory, or specify another directory.
The fast network device driver (vmxnet module) is used only for our fast
networking interface. The rest of the software provided by VMware Tools is
designed to work independently of this feature.
If you wish to have the fast network driver enabled, you can install the driver
by running vmware-config-tools.pl again after making sure that gcc, binutils,
make and the kernel sources for your running kernel are installed on your
machine. These packages are available on your distribution's installation CD.
 
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: 1. 首先,需要在Debian 10中安装open-vm-tools软件包。可以使用以下命令进行安装: sudo apt-get update sudo apt-get install open-vm-tools 2. 安装完成后,需要重新启动Debian 10系统。 3. 在VMware虚拟机菜单中,选择“VM”->“Install VMware Tools”。 4. 在Debian 10系统中,打开终端并输入以下命令: sudo mount /dev/cdrom /mnt cd /mnt sudo ./vmware-install.pl 5. 按照提示进行安装安装完成后,重新启动Debian 10系统即可。 注意:如果在安装过程中出现错误,请确保已经安装了必要的编译工具和内核头文件。可以使用以下命令进行安装: sudo apt-get install build-essential linux-headers-$(uname -r) ### 回答2: Debian 10在虚拟机中安装VMware Tools是一项很重要的任务,因为它可以提供更好的虚拟机性能和增强功能。下面是一些步骤,指导您如何在Debian 10中安装VMware Tools: 第一步:安装必要的软件 在安装VMware Tools之前,您需要先安装一些必要的软件。打开终端并执行以下命令: sudo apt-get update sudo apt-get install gcc make linux-headers-$(uname -r) 这将更新Debian 10的软件包并安装必要的软件,以便为VMware Tools进行编译和安装。 第二步:安装VMware Tools 打开VMware虚拟机并在菜单栏中选择“虚拟机”>“安装VMware Tools”。 这将加载一个虚拟的CD-ROM驱动器并在Debian 10的桌面上显示一个VMware Tools安装器。 双击它并在终端中输入以下命令: tar xzf /media/cdrom/VMwareTools-x.x.x-xxxx.tar.gz -C /tmp/ 将“x.x.x”替换为VMware Tools安装程序的版本号。执行此命令后,您将看到一个“vmware-tools-distrib”文件夹出现在/tmp/目录中。 转到该目录并运行以下命令: cd /tmp/vmware-tools-distrib/ sudo ./vmware-install.pl 它将启动VMware Tools安装向导。按照向导的提示进行操作并选择默认选项。在向导完成安装后,重新启动Debian 10以使更改生效。 第三步:验证VMware Tools安装 安装完成后,您可以验证VMware Tools是否已正确安装。打开终端并输入以下命令来检查VMware Tools服务的运行状态: sudo systemctl status vmware-tools.service 如果运行状态为“Active(running)”,则表示VMware Tools已正确安装,并且您可以使用诸如共享文件夹等增强功能。 总结 安装VMware Tools是在虚拟机中使用Debian 10的一个必要步骤。上述步骤将指导您完成整个安装过程。安装VMware Tools可以提高虚拟机的性能,增强其功能并提高用户体验。 ### 回答3: 对于Debian 10用户来说,安装VMware Tools是非常必要的。VMware Tools是一个可选的虚拟机组件,它提供了对VMware虚拟化环境的更好支持。安装VMware Tools的最大优点是提高了虚拟机性能,如增加显存、增强网络组件等等。本文将会为大家介绍如何在Debian 10中安装VMware Tools。 首先,我们需要确保虚拟机是处于开机状态的情况下。接着,选择VM菜单中的”安装VMware Tools”选项。在窗口中,可以选择“下载”或“本地安装”,这里我们选择“下载”。 下载完成后,我们将会看到一个压缩文件,例如,VMwareTools-yyyy-mm-dd-xxxx.tar.gz,其中,”yyyy-mm-dd”代表的是VMware Tools的版本,”xxxx”代表的是操作系统的类型。我们需要解压缩这个文件,并进入该目录。 打开终端窗口,并进入VMware Tools解压缩后的目录。执行以下命令,以开始安装VMware Tools。 sudo ./vmware-install.pl 在安装过程中,会提示你回答几个问题。按enter键即可。如果你不确定选择什么设置,可以使用默认值。当安装完成后,重启虚拟机。 sudo reboot 重启后完成后,就可以正常使用VMware Tools了。如果你还遇到了其他问题或错误,可以请参考VMware官方文档。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值