Nov 13, 2022
Credit: https://askubuntu.com/questions/918021/encrypted-custom-install/918030
Credit: https://www.mikekasberg.com/blog/2020/04/08/dual-boot-ubuntu-and-windows-with-encryption.html
While running a hypervisor on virtualization technologies seems more and more possible, Proxmox does not really support Wi-Fi and Qubes has very strict hardware requirement so I guess the best way to run both Windows and Ubuntu on a personal computer is still to dual boot.
Windows is relatively straightforward to install: just remember to leave half of the disk to Ubuntu when partitioning.
Now comes the hard part. Boot into Ubuntu and select 'Try it'.
We need an unencrypted /boot
partition (around 1GB) and an encrypted root partition.
I use Disks
in Ubuntu to partition the free space into one 1GB part (nvme0n1p5
) and one other part (nvme0n1p6
). I think many tools are available (fdisk, etc.) and you can choose the one you like.
Encrypt our disk and call it CryptDisk:
Setup LVM and call it vg0:
Install the OS. Select "Something else" when asked how to install. Use /dev/mapper/vg0-root
as Ext4 and mount to /
. Use /dev/mapper/vg0-swap
as swap. Use /nvme0n1/nvme0n1p5
as Ext4 and mount to /boot
.
Select 'Keep Testing' and setup the loader:
Remember the UUID (something like bd3b598d-88fc-476e-92bb-e4363c98f81d).
Edit /etc/crypttab
Inside chroot
, replacing the UUID with your own:
Update the setting:
Restart, and configure the BIOS to get you into Ubuntu.
Edit and add this to /etc/default/grub
:
Run
And it should detect Windows.
Enable Bitlocker in Windows 11 Pro.
Use Win+R to run gpedit.msc
and open the Group Policy Editor.
Go to Computer Configuration > Administrative Templates > Windows Components > BitLocker Drive Encryption > Operating System Drives > Require Additional Authentication at Startup and enable it.
Add a PIN in the Bitlocker settings.
Do keep a copy of the recovery code! Ubuntu updates can break Windows Bitlocker and files may be lost if you do not have the code!
Sometimes Ubuntu and/or Windows updates break Grub. Here is a quick script that reinstalls Grub: