Encrypted custom image

October 14, 2018 788 views
Ubuntu 18.04 DigitalOcean

Hi all,

I’m trying to create a custom image whit an encrypted root filesystem (ie. encrypted with LUKS). The image was generated from a Ubuntu 18.04 server and from my personal qemu. Everything is working ok on my machine. When the server boots it asks for the LUKS passphrase (I’m using the console to enter the password) and everything is working well. It proves that this image is working with qemu.

This said, when I’m uploading the image on DO and creating a droplet from this one. The console never ask me for the passphrase and is stuck on “Booting from harddisk”. Is it possible to do this, am I missing something ?

Regards,

Daniel..

2 Answers

Hey friend!

I asked our team about this and this is a snippet of what I got in return: “I got full disk encryption to work on my Droplet a few weeks ago, though. Are they doing something unusual with the disk layout or GRUB configuration?”

In that light, can you tell me more about the steps taken to create the image? No guarantee that this gives me leverage to make a more informed response, but it seems like the best chance at moving forward on it.

Jarland

Hi Jarland,

I think it was my fault. I sparsified (with virt-sparsify) the image before uploading it. After uploading a flat image everything is working ok.

Should be pretty interesting to write a tutorial on how to create a encrypted image from scratch with packer or debootstrap.

I’m still in the process of automating this but I should be able to do it.

Thanks a lot for your help.

  • Hi Daniel, trying to replicate the same thing on DO here, do you have any tips? I’ve been having a hard time even getting an image to upload to DO. Any shortcoming that’s you’ve experience running an encrypted root device (wondering how you’re handling unattended restarts with LUKS encryption).

Have another answer? Share your knowledge.