Advertisement

news | articles | utilities | resources | about

Custom .iso with integrated kickstarts

Create kickstart configuration files for each machine

See Kickstart Part I for more details.

Generate a new boot image for the installation CD

The boot image for the ESX installation CD can be found in the isolinux directory at the root of the cd. We will first need to copy the initrd.img to a location where we can modify it.

[root@esx01 isolinux]# cp initrd.img /root

Next, we need to extract the image, and mount it as a loopback device.

[root@esx01 ~]# gunzip initrd.img --suffix .img
[root@esx01 ~]# mount -o loop /root/initrd /mnt/floppy/

Copy all of the kickstart configuration files to /mnt/floppy

[root@esx01 ~]# cp esx0[1-5].cfg /mnt/floppy/
[root@esx01 ~]# ls /mnt/floppy/
bin  esx01.cfg  esx03.cfg  esx05.cfg  linuxrc     modules  sbin  var
dev  esx02.cfg  esx04.cfg  etc        lost+found  proc     tmp

Finally, unmount and recompress the initrd

[root@esx01 ~]# umount /mnt/floppy/
[root@esx01 ~]# gzip --suffix .img initrd 

Modify isolinux.cfg

Modify isolinux.cfg to create entries for each of your configuration files as shown.

default esx
prompt 1
timeout 200
display boot.msg
F1 boot.msg
label esx
  kernel vmlinuz
  append apic devfs=nomount ramdisk_size=7168 vga=788 initrd=initrd.img 
label esx01
  kernel vmlinuz
  append vmware apic text ks=file:/esx01.cfg ramdisk_size=7168 initrd=initrd.img local
label esx02
  kernel vmlinuz
  append vmware apic text ks=file:/esx02.cfg ramdisk_size=7168 initrd=initrd.img local
label esx03
  kernel vmlinuz
  append vmware apic text ks=file:/esx03.cfg ramdisk_size=7168 initrd=initrd.img local
label esx04
  kernel vmlinuz
  append vmware apic text ks=file:/esx04.cfg ramdisk_size=7168 initrd=initrd.img local
label esx05
  kernel vmlinuz
  append vmware apic text ks=file:/esx05.cfg ramdisk_size=7168 initrd=initrd.img local

Inserting initrd.img and isolinux.cfg back into a bootable cdrom

Unfortunately, ESX does not come with the tools necessary to create an iso image from a directory structure, so for this step you will need another machine. For the linux section, I will assume that you have the mkisofs package available to you.

Creating an ISO image in linux

Copy the entire source of the ESX cd to /kickstart

[root@esx01 ~]# cp -pr /mnt/cdrom/.* /kickstart/

esx 3.0.x only, copy .discinfo from /mnt/cdrom to /kickstart

[root@esx01 ~]# cp -p /mnt/cdrom/.discinfo /kickstart/

Copy the modified initrd.img and isolinux.cfg to /kickstart/isolinux directory

[root@esx01 ~]# cp {isolinux.cfg,initrd.img} /kickstart/isolinux/ 
cp: overwrite `/kickstart/isolinux/isolinux.cfg'? y
cp: overwrite `/kickstart/isolinux/initrd.img'? y

You may also want to edit the file /kickstart/isolinux/boot.msg to reflect the new boot entries that you added to isolinux.cfg.


Generate a new ISO image from the /kickstart directory

[root@esx01 kickstart]# mkisofs -l -J -R -r -T -o /esx-custom.iso \
-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
-boot-load-size 4 -boot-info-table /kickstart

You will now have an ISO image located at /esx-custom.iso, burn this to a cd with whatever tool you have available.


 
Copyright © 2007 - vmprofessional. All rights reserved.