linux 环境手动安装vmware tools

情景: 在vcenter虚拟化平台中看不到机器的ip,想知道ip得进入命令窗口通过命令获得,非常麻烦,然后可以通过安装vmware-tools可以解决,但直接点击安装又不行,就只能手动安装了,以下是我在安装过程中遇到的问题和优质的解决方案,本人是用第二种方法解决的

注:对于较新的 Linux 发行版,系统会提示用户选择集成的 open-vm-tools。

方法一

源作者: 如何在Linux操作系统上安装VMwareTools-阿里云帮助中心_-阿里云帮助中心 (aliyun.com)

1、安装VMware Tools

2、挂载

3、命令安装

##挂载cdrom到/mnt目录
[root@localhost /]# mount /dev/cdrom /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost /]# 

##切换至/mnt目录
[root@localhost /]# cd /mnt/
[root@localhost mnt]# 

##复制VMware Tools安装包至/tmp目录
[root@localhost mnt]# cp VMwareTools-10.3.23-17030940.tar.gz  /tmp/
[root@localhost mnt]# 
[root@localhost mnt]# 

##切换至/tmp目录
[root@localhost mnt]# cd /tmp/

##解压安装包
[root@localhost tmp]# tar zxf VMwareTools-10.3.23-17030940.tar.gz 
[root@localhost tmp]# 

##切换入解压后的目录
[root@localhost tmp]# cd vmware-tools-distrib/
[root@localhost vmware-tools-distrib]# 
[root@localhost vmware-tools-distrib]# 

##运行如下命令开始安装
[root@localhost vmware-tools-distrib]# ./vmware-install.pl 
open-vm-tools packages are available from the OS vendor and VMware recommends 
using open-vm-tools packages. See http://kb.vmware.com/kb/2073803 for more 
information.
Do you still want to proceed with this installation? [no] yes ##选择yes,其它保持默认

INPUT: [yes]

Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files? 
[/usr/bin] 

INPUT: [/usr/bin]  default

What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
[/etc/rc.d] 

INPUT: [/etc/rc.d]  default

What is the directory that contains the init scripts? 
[/etc/rc.d/init.d] 

INPUT: [/etc/rc.d/init.d]  default

In which directory do you want to install the daemon files? 
[/usr/sbin] 

INPUT: [/usr/sbin]  default

In which directory do you want to install the library files? 
[/usr/lib/vmware-tools] 

INPUT: [/usr/lib/vmware-tools]  default

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] 

INPUT: [yes]  default

In which directory do you want to install the documentation files? 
[/usr/share/doc/vmware-tools] 

INPUT: [/usr/share/doc/vmware-tools]  default

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] yes

INPUT: [yes]

The installation of VMware Tools 10.3.23 build-17030940 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] 

INPUT: [yes]  default

Initializing...


Making sure services for VMware Tools are stopped.

Stopping vmware-tools (via systemctl):  [  OK  ]


The module vmci has already been installed on this system by another installer 
or package and will not be modified by this installer.

The module vsock has already been installed on this system by another installer
or package and will not be modified by this installer.

The module vmxnet3 has already been installed on this system by another 
installer or package and will not be modified by this installer.

The module pvscsi has already been installed on this system by another 
installer or package and will not be modified by this installer.

The module vmmemctl has already been installed on this system by another 
installer or package and will not be modified by this installer.

The VMware Host-Guest Filesystem allows for shared folders between the host OS 
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish 
to enable this feature? [no] 

INPUT: [no]  default

The vmxnet driver is no longer supported on kernels 3.3 and greater. Please 
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)

The vmblock enables dragging or copying files between host and guest in a 
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[no] 

INPUT: [no]  default


Skipping configuring automatic kernel modules as no drivers were installed by 
this installer.


Disabling timer-based audio scheduling in pulseaudio.

Do you want to enable Guest Authentication (vgauth)? [yes] 

INPUT: [yes]  default



Detected X server version 1.20.4



Distribution provided drivers for Xorg X server are used.

Skipping X configuration because X drivers are not included.


Skipping rebuilding initrd boot image for kernel as no drivers to be included 
in boot image were installed by this installer.

The configuration of VMware Tools 10.3.23 build-17030940 for Linux for this 
running kernel completed successfully.

You must restart your X session before any mouse or graphics changes take 
effect.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and 
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session
3. Restart your X session.

Found VMware Tools CDROM mounted at /run/media/root/VMware Tools. Ejecting 
device /dev/sr0 ...
Enjoy,

--the VMware team

[root@localhost vmware-tools-distrib]# 
##安装完成

方法二

CentOS / Rocky Linux

步骤 1:打开终端

首先,打开你的CentOS或Rocky Linux虚拟机并登录到系统。然后,打开终端应用程序。

步骤 2:安装所需软件包

在终端中,使用以下命令安装所需的软件包:

sudo yum install -y open-vm-tools

步骤 3:重新启动虚拟机

安装完成后,重新启动Linux虚拟机以应用更改。

sudo reboot

步骤 4:验证安装

虚拟机重新启动后,登录到系统。然后,在终端中运行以下命令以验证VM Tools是否成功安装:

vmware-toolbox-cmd --version

如果安装成功,将显示VM Tools的版本信息。

Ubuntu

步骤 1:打开终端

首先,打开你的Ubuntu虚拟机并登录到系统。然后,打开终端应用程序。

步骤 2:安装所需软件包

在终端中,使用以下命令安装所需的软件包:

sudo apt update

sudo apt install -y open-vm-tools

步骤 3:重新启动虚拟机

安装完成后,重新启动Linux虚拟机以应用更改。

sudo reboot

步骤 4:验证安装

虚拟机重新启动后,登录到系统。然后,在终端中运行以下命令以验证VM Tools是否成功安装:

vmware-toolbox-cmd --version

如果安装成功,将显示VM Tools的版本信息。

结论

通过以上步骤,你已经成功在线安装了VM Tools,使你的Linux虚拟机能够充分利用VMware虚拟化平台的功能和性能增强。现在,你可以享受更顺畅的虚拟机体验了!

报错a:

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?

解决a: 

解决方法:新开一个终端,创建目录,必要的时候需要重启系统

cd /etc
mkdir init.d
cd init.d
for i in {0,1,2,3,4,5,6}; do mkdir rc$i.d; done

报错b:

b, 找不到ifconfig 

解决b

解决方法:安装net-tools

pacman -S net-tools
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐