您现在的位置是:首页 >技术杂谈 >Linux Shell 实现一键部署VMware Workstation网站首页技术杂谈
Linux Shell 实现一键部署VMware Workstation
简介Linux Shell 实现一键部署VMware Workstation
VMware Workstation 前言
VMware Workstation Pro 是业界标准的桌面 Hypervisor,用于在 Linux 或 Windows PC 上运行虚拟机
download VMware_Workstation
VMware_Workstation Windows | VMware_Workstation linux | 文档 |
download | download | 参考 |
Linux 各系统下载使用参考
Red Hat | Rocky Linux | Oracle Linux | AlmaLinux | ubuntu | suselinux | esxi | RHEL标准安装 | 系统安装参考 | YUM参考 | MobaXterm 远程连接工具 | Red Hat Enterprise 9.0 文档 | Kickstart 生成器 | |||||
download | download | download | download | download | download | download | 参考 | 参考 | 配置参考 | download | 参考 | Kickstart | |||||
版本兼容性 |
创建一键部署VMware_Workstation
- 安装时间较长耐心等待预计一小时,原因基础依赖环境安装较多,也可在安装操作系统的时候把这些基础环境包全部安装了这样节省很多时间,我的环境是迷你版环境。
- 最中实现在线下载VMware_Workstation,安装VMware_Workstation,授权,安装基础环境依赖,配置VMware_Workstation,初始化VMware Workstation,安装完成后需要重启服务器必须要重启,重复安装操作系统之前安装了依赖环境那就不需要重启系统。
- vmware-installer -u vmware-workstation #卸载使用此命令
- systemctl set-default graphical.target #将系统引导方式改为图形化引导
- systemctl set-default multi-user.target #将系统引导方式改为命令行引导
vi /install_vmware-workstation.sh
#!/bin/bash
# -*- coding: utf-8 -*-
# Author: CIASM
# update 2023/05/16
directory=/root
vmware_workstation_url=https://download3.vmware.com/software/WKST-1702-LX/
vmware_workstation_bundle=VMware-Workstation-Full-17.0.2-21581411.x86_64.bundle
vmware_workstation_directory_check=/usr/lib/vmware
vmware_workstation_key=JU090-6039P-08409-8J0QH-2YR7F
install_vmware_workstation (){
if [ ! -d ${vmware_workstation_directory_check} ];then
echo "install vmware_workstation"
if [ $? -eq 0 ];then
echo "Close selinux"
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
echo "install Dependent environment"
yum install -y http://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
yum install -y kernel-devel kernel-headers perl
yum install -y libXtst-devel libXrender-devel xinetd bison libgcrypt
yum install -y gcc gcc-c++ make cmake vim wget net-tools
yum install -y kernel* elfutils-libelf-devel pcsc-lite-libs
yum install -y mesa-libGL -y
dnf groupinstall "Server with GUI" -y
echo "gtk modules config"
cat >>/etc/ld.so.conf.d/gtk-2.0.conf<<EOF
/usr/lib64/gtk-2.0/modules
EOF
ldconfig
echo "downlod vmware_workstation"
wget -N -P $directory $vmware_workstation_url/$vmware_workstation_bundle
chmod +x $directory/$vmware_workstation_bundle
echo "install vmware_workstation"
sh $directory/$vmware_workstation_bundle --console --eulas-agreed --required --set-setting vmware-workstation serialNumber $vmware_workstation_key
echo "proxy server"
mkdir -p /etc/vmware/hostd/
cat >>/etc/vmware/hostd/proxy.xml<<EOF
<HttpProxyConfig>
<Enabled>false</Enabled>
<ServerName>proxy.example.com</ServerName>
<ServerPort>8080</ServerPort>
</HttpProxyConfig>
EOF
echo "Deleting an installation package"
rm -f $directory/$vmware_workstation_bundle
echo "vmware_workstation version check"
vmware --version | awk '{print $3}'
echo "reboot system"
reboot
echo -e "