Ubuntu Server 26.04 could benefit hugely with what Canonical did to Ubuntu Desktop 26.04 for TPM-backed FDE

@paddylandau, I think you should give bridged networking a go. That way there is no NAT (network address translation) involved and you can use the advertised IP directly. In fact, Ubuntu Core will get its IP address from your local DHCP server, just like your host machine and other devices on your network. If nothing else, that’s the closest estimate of what a bare metal server would look like to your network environment.

For a VM you don’t actually have to write the image to a disk device. I haven’t; I simply told virt-manager to use the .img as the storage device. If you want to emulate how to do it on a server, you can set up a VM with internal storage, then run an Ubuntu Desktop live session and do the dd from there.
Say your VM has a disk device at /dev/sda, then you just do:

sudo dd if=/path/to/ubuntu-core-26-amd64.img of=/dev/sda

Reboot the VM without the live installer attached and Ubuntu Core will do its (first boot) thing.

1 Like

That was an improvement. I followed your instructions to dd the image onto a local disk (it took a bit of figuring out how to do it, because VirtualBox couldn’t directly load the .img file).

Anyway, the result is that after booting the machine, it runs through through the usual console messages, restarts, and repeats. It’s in an infinite loop.

Fate really does not want me to use Ubuntu Core!

I interrupted boot to get to GRUB, chose Factory Reset, and now I’m at a login screen. Obviously I cannot log in as there’s no user.

I tried using SSH to connect:

$ ssh [redacted]@192.168.55.218

which returns the result:

Received disconnect from 192.168.55.218 port 22:2: Too many authentication failures
Disconnected from 192.168.55.218 port 22

I’m giving up for today. I’ll try again tomorrow, assuming that I can find a way to proceed.

Are you sure it’s an infinite loop? Might just be the magic happening. With a clean TPM 2.0 and secure boot enabled, it took some additional reboot(s) (I didn’t count them). When it says “Press Enter to configure” (or similar) and you press Enter, it will probably come back with saying something like “Kernel is updating”, the next time around it will say a reboot is pending. I guess that’s required for the TPM-backed FDE setup. Eventually you should get to the point where you supply your email address, though. It is a bit counterintuitive, I’ll give you that.

Nah, I think those are just issues one encounters with VM’s. You could also just sudo dd if=/path/to/ubuntu-core-26-amd64.img of=/dev/disk/by-id/usb-<stick>[1] on the host machine and boot your home server from that USB stick; perhaps unplug any internal storage, just to be safe.


  1. see my post about persistent device names ↩︎

1 Like

You should actually see it doing the partitioning and installing on the very first boot, then it should reboot and greet you with a setup tool where you first configure the network and after this a screen where you type in your users email address …

In a VM you can just hit enter and have it use all the defaults for the network and once you gave it your email it will pull down the ssh key from login.ubuntu.com and create a user with this key for you … once it is done you will not see any login prompt but the ssh fingerprints for the machine. If this is visible you should be able to ssh in…

2 Likes

That part didn’t really happen for me. After seeing the fast-ish scrolling text boot messages (plymouth-text?), I was greeted with the “Press Enter to configure”; pressing Enter at that point seemed to do nothing at first and after a short delay it said pc-kernel and (not sure) core26 were updating. Then there was “Press Enter to configure” again; this time it replied with reboot pending. After the reboot, pressing Enter did drop me in the config dialog you described.

But there wasn’t really a stage in which it showed some sort of “doing this” progress indicator, unless you count the Plymouth text. I did spot a TPM/FDE refusal message by sheer accident, because it scrolled past rather quickly; I had tried to reuse my other Ubuntu Desktop TPM/FDE VM, which already had a key in the TPM, so that’s how I knew to spin up a new VM.

While it’s not a big issue for me, it’s adding more hurdles for the uninitiated.

1 Like

I had wanted to address this sooner but forgot. That’s what I meant by “bolting the front to door shut while the bathroom window is ajar”. :wink:
I believe you could look into sealing the full kernel command line; any change then results in the wrong measurement and failover to requesting the recovery key for decryption.

1 Like

I’m a bit late to the party on this one, but there is definitely a way to do tpm-backed encryption on Ubuntu server.

But the only way I know how to do it is with Ubuntu Autoinstall: https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html#supported-layouts

There is a storage layout called “hybrid” with optional encryption. If you use this layout, it should be exactly what you’re looking for.

If I understand correctly, this is exactly what the desktop installer is doing under the hood anyway.

Here is the relevant section:

Additionally, TPM-backed encryption can be enabled by using the hybrid layout with encrypted set to yes.

autoinstall:
  storage:
    layout:
      name: hybrid
      encrypted: yes

3 Likes

It very definitely looked like it. It was repeating the same thing over and over. I left it running for a while.

VirtualBox virtual disks are stored in a .vdi format, and this wouldn’t work. It has to be done within the VM, which I did do successfully.

Unfortunately, it didn’t happen, but fortunately, the factory-level reset did work. Although, as noted, I couldn’t proceed.

Today, when I started it up again, it returned to an infinite loop!

I have deleted the VM altogether, and I’ll start afresh.

Thank you for the details. This is probably what was missing in my knowledge base. I’ll try it when I redo the VM.

Thank you. This is an area that I haven’t learned, and it looks like quite a bit of learning for someone like me. At this stage, I wouldn’t even know where to start configuring this.

Well, I’ve recreated my Ubuntu Core VM from scratch.

Again, it goes into an infinite loop. It gets to this screen:

Shortly after that, it reboots, ad infinitum. This is clearly a bug.

Interrupting the boot to choose “Install using 20260506” in GRUB gets me to the configuration section.

Unfortunately, after giving my email address, at this point I can’t proceed because Ubuntu One is again returning a 500 error.

Ugh.

Hmm, it looks like the TPM stuff didn’t work at all in that screenshot, not sure if that’s a VirtualBox thing, I don’t see this happening in my qemu/kvm VMs …

I’ve just managed to get in! :tada:

I’m having a look at the “first steps” in the documentation now.

2 Likes

That screenshot shows pretty much the same problem I’m having right now with my TPM/FDE Desktop VM, which I brought on myself by messing with the TPM, so it looks like you were trying to use a pre-owned TPM.

This thread seems to describe the problem I’m having but there seems to be no solution other than wiping the TPM and then reinstalling from scratch, which you seem to have done in the meantime. :frowning:

This is why the Qemu instructions have this part:

https://documentation.ubuntu.com/core/how-to-guides/manage-ubuntu-core/test-on-qemu/#reset-the-tpm

… not sure how you would do that in VBox though …

No, definitely not. I had deleted the old VM, and created a brand new one, which means that the virtual TPM was fresh. VirtualBox doesn’t share the TPM between each VM; each one is unique and independent.