Skip to content

Instantly share code, notes, and snippets.

@bunchc
Created May 5, 2021 12:59
Show Gist options
  • Select an option

  • Save bunchc/a926b222e0df48a364d8485c49a58dcb to your computer and use it in GitHub Desktop.

Select an option

Save bunchc/a926b222e0df48a364d8485c49a58dcb to your computer and use it in GitHub Desktop.

Revisions

  1. bunchc created this gist May 5, 2021.
    62 changes: 62 additions & 0 deletions kickstart.ks
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    #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