7z -y x ubuntu-22.04.5-live-server-amd64.iso -osource-files
```
4. In the source-files directory, you will see the ISO files plus a directory named ‘[BOOT]’, which contains 1-Boot-NoEmul.img and 2-Boot-NoEmul.img. Those are, respectively, the mbr (master boot record) and efi (UEFI) partition images from the ISO. They will be used to create the modified ISO. There is no reason to leave the raw image files on the new ISO, so move them out of the way and give the directory a better name.
```bash
cd source-files
ls
mv '[BOOT]' ../BOOT
```
5. Edit the grub.cfg file at `source-files/boot/grub/grub.cfg`
```bash
vim boot/grub/grub.cfg
```
Add the following above the existing menu entries:
```bash
menuentry "Autoinstall Ubuntu Server" {
set gfxpayload=keep
linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s=/cdrom/server/ ---
initrd /casper/initrd
}
```
This will enable autoinstall and reference the `server` directory where our `user-data` and `meta-data` files will be located.
6. Create and add your custom autoinstall data files
```bash
mkdir server
cd server
touch meta-data
vim user-data
```
Paste the `user-data.yaml` content into the `user-data` file.
7. Generate a new Ubuntu 22.04 server autoinstall ISO
The following command is helpful when trying to set up the arguments for building an ISO. It will give flags and data to closely reproduce the source base install ISO.