Sithuk / ubuntu-server-zfsbootmenu

Ubuntu zfsbootmenu install script
123 stars 28 forks source link

Ubuntu Desktop check fails #54

Open andrewvaughan opened 2 months ago

andrewvaughan commented 2 months ago

There doesn't seem to be an ubuntu-desktop package any more with the Ubuntu Desktop LiveUSB (v24.04), so the Ubuntu Desktop check fails:

https://github.com/Sithuk/ubuntu-server-zfsbootmenu/blob/main/ubuntu_server_encrypted_root_zfs.sh#L112-L125

I am using the LiveUSB from ubuntu-24.04-desktop-amd64.iso after performing a full apt update/upgrade.

The casper check does seem to still work as-expected.

andrewvaughan commented 2 months ago

My understanding is this may be an alternative:

dpkg --get-selections | grep linux-image | grep -v deinstall

Resulting in something like:

linux-image-6.8.0-31-generic       install
linux-image-6.8.0-44-generic       install
linux-image-generic-hwe-24.04      install

If I understand correctly, the package(s) listed will contain the name generic if using Desktop, or server if using server, but I haven't tested this on a non-desktop version.

Although this is not definitive - you can techincally run the kernel images on anything.

Another option (and this is complete conjecture) would be to check for the ubuntu-desktop-bootstrap folder in the /snap directory - it's possible they moved this package from apt to a snap at some point.

Sithuk commented 2 months ago

Thank you for the feedback Andrew. The script supports both 22.04 and 24.04 so I'll need to look for a solution that works for both. Alternatively, I could put in separate checks for each, but I'd like to avoid that.

andrewvaughan commented 2 months ago

Thanks! I don't think checking for an apt package and snap as a backup should be an issue - both should be fairly explicitly showing that the desktop version is being used.

If the apt package is missing, but snap exists, that's pretty clear what's going on. Both package names are very clear that they are for desktop.

Is the desktop check of particular importance? How critical would things go wrong in the (IMO very unlikely state, if not impossible) this check has if it contains a false positive? Does that risk override supporting the latest Ubuntu version?

Sithuk commented 2 months ago

I have just successfully tested the following to install a server install in Virtualbox. Ubuntu 22.04.5 live desktop image to install an Ubuntu 22.04 server install. Ubuntu 24.04.1 live desktop image to install an Ubuntu 24.04 server install.

Were you installing on bare metal or using a VM? I noticed you said you did an update/upgrade in the Live environment before running the script. I didn't do that.

Sithuk commented 2 months ago

When you run the following command in the terminal of the Ubuntu 24.04.1 live desktop what text is returned? What is the exit code (echo $?)?

dpkg -l ubuntu-desktop

I get the following output, which results in a successful check when the script is run. Screenshot dpkg ubuntu-desktop

I am using the following ISO: ubuntu-24.04.1-desktop-amd64.iso

You noted in your first post that you are using the intitial release, not the point release? That is, ubuntu-24.04-desktop-amd64.iso and not, ubuntu-24.04.1-desktop-amd64.iso

I tested with the 24.04 initial release iso when I updated the script previously so that shouldn't make a difference. But it would be good if you could duplicate your testing with the latest desktop iso (24.04.1).

andrewvaughan commented 2 months ago

You can confirm that Canonical has, indeed, made this change on their desktop installer bootstrap repository starting in 24.04.01 (and to answer your question, yes this is the current version on the Ubuntu website and what I used):

https://github.com/canonical/ubuntu-desktop-provision

ubuntu_bootstrap - Flutter UI that drives subiquity in the 'device bootstrap' stage. This is the core of the ubuntu-desktop-bootstrap snap built from the ci/bootstrap branch and replaces the ubuntu-desktop-installer.

This is the new graphical installer for the LiveUSB. I believe if you choose "Try Ubuntu Desktop" instead of "Install Ubuntu Desktop" the ubuntu-desktop package is never installed.

Per your questions, if I choose "Try" and use the RAM filesystem created to bootstrap the server (as I think is intended?), the ubuntu-desktop image does not exist, either before or after an apt upgrade, so the command you requested returns a non-zero exit code.

Edit 2: I see where I wrote I was using the prior non-point release in my OP. I don't think that's correct, and may have been a typo, but I can confirm later today when I get access to my USB key.

andrewvaughan commented 2 months ago

The image I was using was, indeed the ubuntu-24.04.1-desktop-amd64.iso image.

andrewvaughan commented 2 months ago

Following up -

I tested this in a VM (via UTM) with the same image. The ubuntu-desktop package did exist. It doesn't exist when I use a USB key. I'll do some more digging and try to find a root cause.

Sithuk commented 2 months ago

Hi Andrew, thank you for the updates from your testing. That's interesting that booting the same iso in bare metal from a usb key vs booting in a VM presents a different environment. It certainly looks like I'll need to adapt the code. I'm just surprised no-one has flagged the issue yet. Perhaps most users are creating 22.04 instead of 24.04 installs.

andrewvaughan commented 2 months ago

Maybe! Let me confirm for you it's not user error. Although I think the snap check shouldn't create any false positives.

Sithuk commented 2 months ago

Hi Andrew, have you additional feedback? I can't easily test the script on bare metal so you're my only feedback for bare metal installs at the moment.

I introduced the check because a user incorrectly used the server iso to install from. It had a differently formatted apt sources file so the script didn't work. https://github.com/Sithuk/ubuntu-server-zfsbootmenu/issues/17

Note to lurkers: If you are experiencing the issue please let us know.

andrewvaughan commented 2 months ago

Thanks for checking up - not yet, unfortunately. The server I was provisioning is up and running, so I lost my device I was targeting. That said, I should have another here soon to test.

Sithuk commented 2 months ago

Ideally we will identify a way to virtualise whatever you are seeing on the bare metal install so I can test for it in future using a VM.

Sithuk commented 1 week ago

@andrewvaughan : Have you been able to carry out any further testing? It would be good to close this issue out if I can.