# Create Debian ISO for VMM To use VMM, the ISO image you provide must support the serial console. In this guide, we download and modify the debian ISO to boot from serial console. ## Download and verify ISO $ ftp https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.1.0-amd64-netinst.iso $ ftp https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS $ ftp https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/SHA512SUMS.sign If gpg is not already installed: $ doas pkg_add gnupg then: $ gpg --keyserver keyserver.ubuntu.com --recv-keys DF9B9C49EAA9298432589D76DA87E80D6294BE9B $ gpg --verify SHA512SUMS.sign SHA512SUMS gpg: Signature made Sat Aug 14 15:22:04 2021 CDT gpg: using RSA key DF9B9C49EAA9298432589D76DA87E80D6294BE9B gpg: Good signature from "Debian CD signing key " [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: DF9B 9C49 EAA9 2984 3258 9D76 DA87 E80D 6294 BE9B # sha512 debian-11.0.0-amd64-netinst.iso SHA512 (debian-11.1.0-amd64-netinst.iso) = 5f6aed67b159d7ccc1a90df33cc8a314aa278728a6f50707ebf10c02e46664e383ca5fa19163b0a1c6a4cb77a39587881584b00b45f512b4a470f1138eaa1801 # grep debian-11.1.0-amd64-netinst.iso SHA512SUMS 5f6aed67b159d7ccc1a90df33cc8a314aa278728a6f50707ebf10c02e46664e383ca5fa19163b0a1c6a4cb77a39587881584b00b45f512b4a470f1138eaa1801 debian-11.1.0-amd64-netinst.iso The two checksums must match perfectly or else you should stop installation. We run these steps as root: # vnconfig vnd0 debian-11.1.0-amd64-netinst.iso # mkdir old new # mount /dev/vnd0c old # cp -R old/* new # cp -R old/.disk new # umount old # vnconfig -u vnd0 ## Make Changes Here are the diffs of the changes we make: # diff -ru {old,new}/isolinux/ diff -ru old/isolinux/adtxt.cfg new/isolinux/adtxt.cfg --- old/isolinux/adtxt.cfg Sat Aug 14 05:09:00 2021 +++ new/isolinux/adtxt.cfg Sat Aug 21 10:52:36 2021 ` -1,9 +1,9 ` label expert menu label E^xpert install kernel /install.amd/vmlinuz - append priority=low vga=788 initrd=/install.amd/initrd.gz --- + append priority=low vga=normal initrd=/install.amd/initrd.gz --- console=ttyS0,1 15200n8 include rqtxt.cfg label auto menu label ^Automated install kernel /install.amd/vmlinuz - append auto=true priority=critical vga=788 initrd=/install.amd/initrd.gz --- qui et + append auto=true priority=critical vga=normal initrd=/install.amd/initrd.gz --- console=ttyS0,115200n8 diff -ru old/isolinux/isolinux.cfg new/isolinux/isolinux.cfg --- old/isolinux/isolinux.cfg Sat Aug 14 05:09:00 2021 +++ new/isolinux/isolinux.cfg Sat Aug 21 10:51:41 2021 ` -1,5 +1,7 ` # D-I config version 2.0 # search path for the c32 support libraries (libcom32, libutil etc.) +serial 0 115200 +console 0 path include menu.cfg default vesamenu.c32 diff -ru old/isolinux/txt.cfg new/isolinux/txt.cfg --- old/isolinux/txt.cfg Sat Aug 14 05:09:00 2021 +++ new/isolinux/txt.cfg Sat Aug 21 10:51:56 2021 ` -1,4 +1,4 ` label install menu label ^Install kernel /install.amd/vmlinuz - append vga=788 initrd=/install.amd/initrd.gz --- quiet + append vga=normal initrd=/install.amd/initrd.gz --- console=ttyS0,115200n8 ## Generate ISO # pkg_add xorriso # xorriso -as mkisofs -r -J -joliet-long -l -cache-inodes -partition_offset 16 -A "Debian/VMM" -b isolinux/isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o debian-11.1.0-vmm.iso ./new (:if false:) **WARNING**: I tried the follow below but it did not work, so don't attempt it: # cat /dev/zero | tr '\000' '\220' | dd of=isofloppy.bin bs=512 count=2880 # dd if=isolinux.bin of=isofloppy.bin conv=notrunc # mv isofloppy.bin isolinux.bin # mkhybrid -a -R -T -L -l -d -D -N -o debian-11.1.0-vmm.iso \ -A "Debian 11.1.0 amd64 netinst" \ -P "Copyright (C) 1997-2021 SPI and others" \ -p "Aaron Lin " \ -V "Debian/amd64 11.1.0 netinst" \ -b isolinux/isolinux.bin -c boot.cat \ new (:ifend:) ## VMM In /etc/vm.conf, we update the cdrom image: vm "username" { owner username memory 1024M cdrom "/home/iso/debian-11.1.0-vmm.iso" disk /home/username/username.qcow2 interface { locked lladdr aa:bb:cc:dd:ee:ff switch "switch0" } } (:ifend false:) # Install Install grub into /dev/vda Ideas taken from: https://giocher.com/words/2018/ubuntu-on-openbsd-vmm/