For those that have a need to prompt for additional user input during an installation of ESXi, whether that is an interactive session or using a scripted install (Kickstart) may have noticed the solution posted in my 2015 blog post no longer works with recent releases of ESXi (newer than 6.0).



I was recently contacted by VMTN community cacheman, who authored the original snippet after my 2011 post with an updated solution that would work with newer releases of ESXi (e.g. 6.5 or newer). Thanks to Chris, he discovered the following after taking another look at the initial hack:

It seems that the tty1 techsupport.sh which I had commented out in /etc/inittab is having no effect in these versions and the login prompt is starting on tty1. As far as I can tell this is because for versions >= 6.5, the init process starts before the extras.tgz is unpacked, so it reads the /etc/inittab that comes natively with ESXi rather than the modified one in extras.tgz.

Chris was kind enough to provide me with the updated code and I have integrated that into a complete working kickstart example which you can find below. Thanks for your contribution (again) Chris!

accepteula install --firstdisk --overwritevmfs rootpw VMware1! reboot <span class="crayon-ta">%</span><span class="crayon-v">include</span> <span class="crayon-o">/</span><span class="crayon-v">tmp</span><span class="crayon-o">/</span><span class="crayon-i">networkconfig</span> ############################################################################### # Pre-installation section ############################################################################### %pre --interpreter=busybox ################################################################################ # Force init to re-read /etc/inittab ################################################################################ init_pid=`ps -c|grep '\/bin\/init'|awk '{ print $1 }'` kill -1 ${init_pid} ################################################################################ # Kill /bin/techsupport.sh and associated getty process ################################################################################ techsupp_pid=`ps -c|grep '\/bin\/techsupport\.sh'|awk '{ print $1 }'` kill -9 ${techsupp_pid} getty_pid=`ps -c|grep 'getty.*tty1'|awk '{ print $1 }'` kill -9 ${getty_pid} ############################################################################### # Change to virtual terminal 2 ############################################################################### /usr/bin/chvt 1 ############################################################################### # Make sure keyboard comes with us ############################################################################### exec < /dev/tty1 > /dev/tty1 2>&1 ############################################################################### # Clear screen ############################################################################### clear ############################################################################### # INSERT YOUR CODE HERE ############################################################################### HOSTNAME="" IPADDR="" NETMASK="" GATEWAY="" DNS="" while [[ "$HOSTNAME" == "" ]] || [[ "${IPADDR}" == "" ]] || [[ "${NETMASK}" == "" ]] || [[ "${GATEWAY}" == "" ]] || [[ "${DNS}" == "" ]] ; do echo echo " *** Please enter the following details: *** " echo read -p "Hostname: " HOSTNAME read -p "IP Address: " IPADDR read -p "Netmask: " NETMASK read -p "Gateway: " GATEWAY read -p "DNS: " DNS done clear echo "network --bootproto=static --addvmportgroup=true --device=vmnic0 --ip=${IPADDR} --netmask=${NETMASK} --gateway=${GATEWAY} --nameserver=${DNS} --hostname=${HOSTNAME}" > /tmp/networkconfig echo -e "Applying the following configuration:

" echo "Hostname = ${HOSTNAME}" echo "IP Address = ${IPADDR}" echo "Netmask = ${NETMASK}" echo "Gateway = ${GATEWAY}" echo -e "DNS = ${DNS}

" sleep 5 /usr/bin/chvt 2 %firstboot --interpreter=busybox vim-cmd hostsvc/enable_ssh vim-cmd hostsvc/start_ssh vim-cmd hostsvc/enable_esx_shell vim-cmd hostsvc/start_esx_shell 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 accepteula install -- firstdisk -- overwritevmfs rootpw VMware1 ! reboot < span class = "crayon-ta" > % < / span > < span class = "crayon-v" > include < / span > < span class = "crayon-o" > / < / span > < span class = "crayon-v" > tmp < / span > < span class = "crayon-o" > / < / span > < span class = "crayon-i" > networkconfig < / span > ############################################################################### # Pre-installation section ############################################################################### % pre -- interpreter = busybox ################################################################################ # Force init to re-read /etc/inittab ################################################################################ init_pid = ` ps - c | grep '\/bin\/init' | awk '{ print $1 }' ` kill - 1 $ { init_pid } ################################################################################ # Kill /bin/techsupport.sh and associated getty process ################################################################################ techsupp_pid = ` ps - c | grep '\/bin\/techsupport\.sh' | awk '{ print $1 }' ` kill - 9 $ { techsupp_pid } getty_pid = ` ps - c | grep 'getty.*tty1' | awk '{ print $1 }' ` kill - 9 $ { getty_pid } ############################################################################### # Change to virtual terminal 2 ############################################################################### / usr / bin / chvt 1 ############################################################################### # Make sure keyboard comes with us ############################################################################### exec < / dev / tty1 > / dev / tty1 2 > & 1 ############################################################################### # Clear screen ############################################################################### clear ############################################################################### # INSERT YOUR CODE HERE ############################################################################### HOSTNAME = "" IPADDR = "" NETMASK = "" GATEWAY = "" DNS = "" while [ [ "$HOSTNAME" == "" ] ] || [ [ "${IPADDR}" == "" ] ] || [ [ "${NETMASK}" == "" ] ] || [ [ "${GATEWAY}" == "" ] ] || [ [ "${DNS}" == "" ] ] ; do echo echo " *** Please enter the following details: *** " echo read - p "Hostname: " HOSTNAME read - p "IP Address: " IPADDR read - p "Netmask: " NETMASK read - p "Gateway: " GATEWAY read - p "DNS: " DNS done clear echo "network --bootproto=static --addvmportgroup=true --device=vmnic0 --ip=${IPADDR} --netmask=${NETMASK} --gateway=${GATEWAY} --nameserver=${DNS} --hostname=${HOSTNAME}" > / tmp / networkconfig echo - e "Applying the following configuration:

" echo "Hostname = ${HOSTNAME}" echo "IP Address = ${IPADDR}" echo "Netmask = ${NETMASK}" echo "Gateway = ${GATEWAY}" echo - e "DNS = ${DNS}

" sleep 5 / usr / bin / chvt 2 % firstboot -- interpreter = busybox vim - cmd hostsvc / enable_ssh vim - cmd hostsvc / start_ssh vim - cmd hostsvc / enable_esx_shell vim - cmd hostsvc / start_esx_shell