Score:0

Hyper-V won't boot customized Ubuntu Server ISO

us flag

I'm trying to create a customized Ubuntu Server ISO (using the instructions here) for use in Hyper-V VMs. I want to modify boot/grub/grub.cfg to add autoinstall to the kernel command line parameters to enable automated server installs.

menuentry "Install Ubuntu Server" {
    set gfxpayload=keep
    linux   /casper/vmlinuz   autoinstall quiet  ---
    initrd  /casper/initrd
}

If I create a new VM in Hyper-V and have it boot from an unmodified Ubuntu Server ISO and then manually modify the boot options in grub the auto-install runs flawlessly. However Hyper-V never boots from my customized ISO, skipping straight to PXE boot. The customized ISO does boot in KVM, so I must be missing something that just Hyper-V requires.

The specific command I run to create the new ISO after modifying grub.cfg comes from the guide linked above on customizing the install CD:

mkisofs -r -V "Custom Ubuntu Install CD" \
        -cache-inodes \
        -J -l -b isolinux/isolinux.bin \
        -c isolinux/boot.cat -no-emul-boot \
        -boot-load-size 4 -boot-info-table \
        -o custom.iso /path/to/iso/root

The base Ubuntu Server ISO I'm modifying is 20.04.3. My host is Windows 10.

Is there a way to modify the mkisofs command to include whatever Hyper-V requires, or a way to copy the exact settings from the standard ISO, since that works with Hyper-V already?

Score:0
gw flag

I figured it out for Ubuntu 20.04. You will need to create the ISO with a boot image. This is found on the iso it self it's called efi.img.

Sadly this does not work anymore with Ubuntu 22.04/10 as the efi.img is no longer present on the iso. I have yet to find a way to create the custom iso so it will boot in hyper v

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.