VMware Cloud Community
ognak
Contributor
Contributor

kickstart %firstboot problems

Hi,

I can't get %firstboot in a kickstart script to fire during an automated ESXi install. I've been trying various paths but need more troubleshooting knowledge to see what's going wrong. 

ESXi_Install.log shows:

2021-02-17T14:00:33.655Z INFO Staging the first-boot scripts in /tmp/onetime
2021-02-17T14:00:33.656Z INFO Writing 1079 chars to /tmp/onetime/var/lib/vmware/firstboot/001.firstboot_001

I've currently using an edited ISO to load the cfg file and it executes the top portion fine - I get a UK keyboard, password is set etc but the %firstboot section rarely if ever completes. I've tried DHCP/PXE and run into the same issue. I'm using standard stuff in this section: 

%firstboot --interpreter=busybox

sleep 60

# enable & start SSH
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh

# enable & start ESXi Shell
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell

There is more after this with esxli commands but this is just an example. /var/lib/vmware/firstboot/001.firstboot_001 has all the %firstboot data intact but it's not running for me. 

I didn't find anything useful in syslog.log or firstboot.log so hoping there some other file somewhere that will show me an error - anyone any suggestions?! I got it working once, repeated fine, made one change and it hasn't worked since, even after reverting which is annoying to say the least! Help!! 

0 Kudos
1 Reply
RobinDec
Contributor
Contributor

Hi,

 

I've been having the same issues as you. 

Can you please share your kickstart file? I have been double checking my files on small mistakes, put sleep timers between every large command (like import ova) and ran my commands from seperate scripts (e.g. deployova.sh). When running my commands from those scripts, make sure that there is no ^M or \r appended to your file when transferred from your storage device to esxi.

For now, I finally have a working version, but might not be the most "clean" example so that's why I'm not sharing it so others might not use my config as a clean example 😉

 

 

0 Kudos