ESXi 安装程序包含一个默认安装脚本,该脚本可对第一个检测到的磁盘执行标准安装。

默认 ks.cfg 安装脚本位于 /etc/vmware/weasel/ks.cfg 的初始内存磁盘中。您可以使用 ks=file://etc/vmware/weasel/ks.cfg引导选项指定默认 ks.cfg 文件的位置。请参见输入引导选项以启动安装或升级脚本

使用 ks.cfg 脚本安装 ESXi 时,默认根密码为 myp@ssw0rd

不能在安装介质上修改默认脚本。安装后,可使用 vSphere Client登录到用于管理 ESXi 主机的 vCenter Server 并修改默认设置。

默认脚本包含以下命令:

#
# Sample scripted installation file
#

# Accept the VMware End User License Agreement
vmaccepteula

# Set the root password for the DCUI and Tech Support Mode
rootpw myp@ssw0rd

# Install on the first local disk available on machine
install --firstdisk --overwritevmfs

# Set the network to DHCP on the first network adapter
network --bootproto=dhcp --device=vmnic0

# A sample post-install script
%post --interpreter=python --ignorefailure=true
import time
stampFile = open('/finished.stamp', mode='w')
stampFile.write( time.asctime() )