Skip to content

Instantly share code, notes, and snippets.

@bunchc
Created May 5, 2021 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bunchc/a926b222e0df48a364d8485c49a58dcb to your computer and use it in GitHub Desktop.
Save bunchc/a926b222e0df48a364d8485c49a58dcb to your computer and use it in GitHub Desktop.
ESXi Kickstart file
#Accept the VMware End User License Agreement
vmaccepteula
# clear paritions and install
clearpart --firstdisk --overwritevmfs
install --firstdisk --ignoressd --overwritevmfs --novmfsondisk
#set the root password
rootpw VMware1!
#Host Network Settings
network --bootproto=dhcp --device=vmnic0 --addvmportgroup=0
reboot
#Firstboot section 1
%firstboot --interpreter=busybox
sleep 30
#Enter Maintenance mode
vim-cmd hostsvc/maintenance_mode_enter
#enable & start remote ESXi Shell (SSH)
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
#enable & start ESXi Shell (TSM)
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell
#suppress Shell Warning
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1
esxcli system settings advanced set -o /UserVars/ESXiShellTimeOut -i 1
#Firstboot Section 2
%firstboot --interpreter=busybox
#Disable IPv6
esxcli network ip set --ipv6-enabled=false
#Disable CEIP
esxcli system settings advanced set -o /UserVars/HostClientCEIPOptIn -i 2
#Firewall Settings
esxicli network firewall set --default-action false --enabled yes
FIREWALL_SERVICES="syslog sshClient ntpClient updateManager httpClient netdump"
for SERVICE in ${FIREWALL_SERVICES}
do
esxcli network firewall ruleset set --ruleset-id ${SERVICE} --enabled yes
done
# persist changes
/sbin/auto-backup.sh
# Exit Maintenance Mode
vim-cmd hostsvc/maintenance_mode_exit
#Reboot
sleep 30
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment