cloudymax / pxeless

An automated system install and image customization tool for when PXE is not an option, or is not an option yet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Working examples with Ubuntu 22.04.1 Desktop?

Poeschl opened this issue · comments

Thanks for taking over the ubuntu-autoinstall-iso-generator repro ❤️

Is there a working example known for an automatic install of ubuntu 22.04.1?
I'm having issues on setting it up correctly.

When I'm trying to use the provided sample and execute the builder with a pre-downloaded ubuntu iso and the command

./image-create.sh --no-verify --all-in-one --user-data basic-config.yml -s ubuntu-22.04.1-desktop-amd64.iso -d install-22.iso -n jammy

the iso is successfully created.

Now when booted from this iso in a VM, selected the default grup entry, the automatic procedure is not started correctly and I'm seeing the install wizard.

I looked into the syslog and the commands in the kernel seem to be correct. Any clues where to look at?

commented

Hoi 👋 Thanks for the question!

A couple points:

  • Ive changed the example user-data.basic file, it's now much simpler and as such is now less error prone.

  • I've also moved the previous version of the user-data file to user-data.advance and removed the storage section. This avoids and error in VM settings where the drives are not properly detected during the Storage module's run.

  • I was able to re-create the described behavior by running the image-create script in the same way you did on a desktop iso. I saw a successful completion of the pxeless process, but was sent to the installation wizard. I then repeated the test with a server ISO and was sent through the autoinstaller process.

  • I don't believe that the desktop image uses the same installer as the server image (i could be mistaken through) which would cause the behavior you described. I'm basing this on these docs https://ubuntu.com/server/docs/install/autoinstall

While I can't provide a solution to the exact problem at hand, I can suggest that you install your desired desktop environment as part of the the server iso's cloud-init process. there is a great blog post by Pudget Systems that talks about how they use this process to image their laptops.

Dr Donald Kinghorn (Scientific Computing Advisor)
How-To: Make Ubuntu Autoinstall ISO with Cloud-init

And here is the gist with their config file: https://gist.github.com/dbkinghorn/c236aea31d76028b2b6ccdf6d3c6f07e

In their setup, they install a minimal desktop then switch the network to use network-manager so wifi will work. This creates a similar end-result to installing via one of the desktop iso, though it is not a live-image.

If it helps for parity of testing environments, I test these images using a QEMU setup with 2 drives (the ISO as a CD-ROM and a blank virtual disk) then attach over vnc using TigerVNC to control the grub selection/reboots that way.

# luanch the VM to install from ISO to Disk
 216   │ create_vm_from_iso(){
 217   │   log "💿 Creating VM from iso file"
 218   │   tmux new-session -d -s "${VM_NAME}_session"
 219   │   tmux send-keys -t "${VM_NAME}_session" "sudo qemu-system-x86_64 \
 220   │     -machine accel=kvm,type=q35 \
 221   │     -cpu host,kvm="off",hv_vendor_id="null" \
 222   │     -smp sockets="$SOCKETS",cores="$PHYSICAL_CORES",threads="$THREADS" \
 223   │     -m "$MEMORY" \
 224   │     -cdrom $ISO_FILE \
 225   │     -object iothread,id=io1 \
 226   │     -device virtio-blk-pci,drive=disk0,iothread=io1 \
 227   │     -drive if=none,id=disk0,cache=none,format=qcow2,aio=threads,file=hdd.img \
 228   │     $NETDEV
 229   │     $DEVICE
 230   │     -bios /usr/share/ovmf/OVMF.fd \
 231   │     -vga virtio \
 232   │     -usbdevice tablet \
 233   │     -vnc $HOST_ADDRESS:$VNC_PORT \
 234   │     $@" ENTER
 235   │     tmux_stream
 236   │ }

Thanks a lot for this really details reply. 👍
I will try the server image to see if its an issue with the desktop iso. For my usecase I normally do not need a UI, but if needed it could be installed afterwards (as you said).

Trying again with the server iso and it worked perfectly. So indeed the desktop variant is not supporting the autoinstall procedure. 😀

commented

Trying again with the server iso and it worked perfectly. So indeed the desktop variant is not supporting the autoinstall procedure. 😀

Happy to hear it worked for you - Cheers!