ESXi Live CDs

Sometimes life can feel so messed up and hopeless that a lobotomy appears to be the only promising route to escape from the current conundrum.
Thats why I started to look into ESXi LiveCDs …
I had noticed that sometimes a VMFS-volume appears to be completely wiped when looking at it with the ESXi that had used it in the past.
A newly installed ESXi on the other hand was able to show the content as if everything was fine …
But setting up a fresh new ESXi is not convenient in many scenarios …
So why not try to create one that loads from CD or USB ?
ESXi can already start from USB so this could not be so tricky …
Looking into an ESXi Install ISO and into an ESXi installation on disk shows that the differences must be small:
In both cases we find a bunch of tarballs plus a boot.cfg.


boot.cfg of an ESXi 6.7 installation ISO:

bootstate=0
title=Loading ESXi installer
timeout=5
prefix=
kernel=/b.b00
kernelopt=cdromBoot runweasel
modules=/jumpstrt.gz — /useropts.gz — /features.gz — /k.b00 — /chardevs.b00 — /user.b00 — /procfs.b00 —

/vsanheal.v00 — /vsanmgmt.v00 — /tools.t00 — /xorg.v00 — /imgdb.tgz — /imgpayld.tgz
build=
updated=0


boot.cfg of an ESXi 6.7 installed to disk:

bootstate=0
title=Loading VMware ESXi
timeout=5
prefix=
kernel=b.b00
kernelopt= installerDiskDumpSlotSize=2560 no-auto-partition
modules=jumpstrt.gz — useropts.gz — features.gz — k.b00 — chardevs.b00 — user.b00 — procfs.b00 — uc_intel.b00

vsan.v00 — vsanheal.v00 — vsanmgmt.v00 — xorg.v00 — imgdb.tgz — state.tgz
build=6.7.0-8169922
updated=1


boot.cfg for an ESXi 6.7 LiveCD

bootstate=0
title=ESXi-LIVE 6.7 user root – pass //sanbarrow2019
timeout=5
prefix=
kernel=/b.b00
kernelopt=no-auto-partition
modules=/jumpstrt.gz — /useropts.gz — /features.gz — /k.b00 — /chardevs.b00 — /user.b00 — /procfs.b00 — /uc_intel.b00 —

/vmware_e.v00 — /vsan.v00 — /vsanheal.v00 — /vsanmgmt.v00 — /tools.t00 — /xorg.v00 — /imgdb.tgz — /state.tgz
build=6.7.0-8169922
updated=0


Those 3 boot.cfg files look almost the same with  just this differences:
– kernelopt=
– modules=
– build=
– updated=
– syntax to specify path / filenames

I found how to set the parameters for a LiveCD after a little bit of trial and error and some common-sense.

– kernelopt=
For the LiveCD project the essential parameter appears to be  no-auto-partition
We definitely do not want the option that starts the setup which appears to be runweasel

modules=
For the LiveCD project the essential difference to an Installer-ISO is the presence of the state.tgz tarball.
Other than that the list can have the same  items referenced.

build=
I dont know if this parameter is really important or critical – anyway specifying the build number seems to work.

updated=
Setting this to 0 like in a regular harddisk installation works.

syntax to specify path / filenames
For the LiveCD project specifying filenames like in a regular Installer-ISO did the trick.


At this point the ground work is done.
We know know the answers to the key questions.
1. how do we tell ESXi that this is no installation ?
– thats easy – just do not use the runweasel option.
2. which modules do we need to load ?
– thats easy and apparently uncritical – just load them all and make sure you add the state.tgz tarball.

Now we can think about the actual building procedure and here I could borrow from my experiences with LiveCDs for other operating systems.
It basically always boils down to the same …

1. create empty directory
2. copy the required source files from a regular Install-ISO
3. add the files that need to be customized – in this case that is only one: state.tgz
4. find out wether you want to create a ISO that can boot from EFI and MBR or just from one of them.
5. find a mkisofs binary that is suitable for the job
6. find out wether the config-files for the bootloader need to be edited – in this case that is ISOLINUX with isolinux.cfg
7. check if the files to load from EFI are present and wether the mkisofs binary is compatible
8. write a commandline with the correct parameters
9. create ISO

All but one of this steps can be scripted.
Preparing a state.tgz is something that you must do yourself.


Creating a state.tgz for the LiveCD …

…. coming soon – work in progress

Ulli