Last Modified: Thu, 03 May 2018 16:52:20 +0000 ; Created: Mon, 06 Nov 2017 22:32:55 +0000
I wanted a bootable USB that could install Ubuntu Server edition automatically. Normally I use a non-extracted iso method (i.e. casper), but that is only available with Ubuntu Desktop and not in the server iso.
So I used the following to create a bootable USB from the ubuntu-16.04.3-server-amd64.iso with a custom grub menuentry that runs the installer without any prompts (no language, keymap, etc. asked for just chosen).
/boot/grub/grub.cfgset default=0 set timeout=2 menuentry "Auto-install Ubuntu Server" { set gfxpayload=keep linux /install/vmlinuz file=/cdrom/preseed/automated.cfg locale=en_US keymap=us quiet --- initrd /install/initrd.gz } /preseed/automated.cfg# Care of https://help.ubuntu.com/lts/installation-guide/amd64/apb.html # These must also be set in the grub2.cfg boot line to avoid lang setting prompts d-i debian-installer/locale string en_US d-i keyboard-configuration/xkb-keymap select us d-i netcfg/get_hostname string unassigned-hostname d-i netcfg/get_domain string unassigned-domain d-i passwd/user-fullname string ubuntu d-i passwd/username string ubuntu d-i passwd/user-password-crypted password MmWbL6cJiRDbA d-i user-setup/encrypt-home boolean false d-i clock-setup/utc boolean true d-i time/zone string UTC # Leave it blank so the question is not asked d-i mirror/http/proxy string d-i pkgsel/update-policy select none # Install the Ubuntu Server seed. tasksel tasksel/force-tasks string server tasksel tasksel/first multiselect standard, openssh-server # Disk related # ============ # Regular partitioning, use the whole disk d-i partman-auto/method string regular d-i partman-auto/choose_recipe select atomic # This makes partman automatically partition without confirmation, provided # that you told it what to do using one of the methods above. d-i partman/confirm_write_new_label boolean true d-i partman/choose_partition select finish d-i partman/confirm boolean true d-i partman/confirm_nooverwrite boolean true # Install to MBR d-i grub-installer/only_debian boolean true # Reboot without message asking user to confirm d-i finish-install/reboot_in_progress note Bonus Custom ISO Bootinghttps://askubuntu.com/questions/625286/how-to-create-uefi-bootable-iso Above site has more up-to-date than Ubuntu Community Wiki page on how to build a custom iso with a preseed. xorriso -as mkisofs \ -isohybrid-mbr /usr/lib/syslinux/mbr/isohdpfx.bin \ -c isolinux/boot.cat \ -b isolinux/isolinux.bin \ -no-emul-boot \ -boot-load-size 4 \ -boot-info-table \ -eltorito-alt-boot \ -e boot/grub/efi.img \ -no-emul-boot \ -isohybrid-gpt-basdat \ -o /path/to/tmp.iso \ /path/to/tmp |
|