sh 自动静默安装VMware Tools,包括启用自动内核模块更新

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 自动静默安装VMware Tools,包括启用自动内核模块更新相关的知识,希望对你有一定的参考价值。

#!/bin/bash

# Create temp workign directory
mkdir -p /mnt/vmw-tools

# Mount VMware Tools ISO
mount /dev/cdrom /mnt/vmw-tools

# Retrieve the VMware Tools package name from the directory
VMW_TOOLS=$(ls /mnt/vmw-tools/ | grep .gz)

# Copy VMware Tools package to /tmp
cp -f /mnt/vmw-tools/${VMW_TOOLS} /tmp/

# Unmount the VMware Tools ISO
umount /mnt/vmw-tools

# Clean up and remove temp mount directory
rmdir /mnt/vmw-tools

# Extract VMware Tools installer to /tmp
tar -zxvf /tmp/${VMW_TOOLS} -C /tmp/

# Change into VMware Tools installer directory
cd /tmp/vmware-tools-distrib/

# Create silent answer file for VMware Tools Installer

# If you wish to change which Kernel modules get installed
# The last four entries (no,no,yes,no) map to the following:
#   VMware Host-Guest Filesystem
#   vmblock enables dragging or copying files
#   VMware automatic kernel modules
#   Guest Authentication
# and you can also change the other params as well
cat > /tmp/answer << __ANSWER__
yes
/usr/bin
/etc
/etc/init.d
/usr/sbin
/usr/lib/vmware-tools
yes
/usr/share/doc/vmware-tools
yes
yes
no
no
yes
no

__ANSWER__

# Install VMware Tools and redirecting the silent instlal file
./vmware-install.pl < /tmp/answer

# Final clean up
rm -rf vmware-tools-distrib/
rm -f /tmp/${VMW_TOOLS}
cd ~

以上是关于sh 自动静默安装VMware Tools,包括启用自动内核模块更新的主要内容,如果未能解决你的问题,请参考以下文章

如何安装VMware tool的具体过程~

新人求助,关于vmware tools安装

VMware tools 我安装系统后、怎么不自动安装啊?

win10 vmware tools怎么安装

vmware tools 怎么安装不上去

vsphere批量更改vmware-tools为全部安装方法