Can I easily have an encrypted home in WSL?

As a long-term Linux user, I tried running Ubuntu under the Windows Subsystem for Linux. I works!

I have tried to setup ecryptfs, but this fails complaining that kernel module is missing. Here I don't know enough about WSL, but it appears to come with a custom kernel.

Can I essily encrypt WSL? If Luks is the answer, how do I enter the passphrase? The boot process is hidden.

18 points · 7 comments · view on lemmy.world

7 Comments

PumpkinEscobar@lemmy.world · 10 pts · 3y

For the easy option / question - do you have bitlocker enabled? That’s not enough?

Do you want the encrypted folder to be automatically-unlocked or unlocked with a password

You can build your own Linux kernel for WSL, I haven’t done it and unless that sounds like fun to you that’s not the route I’d go.

Chais@sh.itjust.works · 6 pts · 3y

Not sure if the Linux crowd can answer this Windows question.

phx@lemmy.ca · 2 pts · 3y

I think this might be possible with WSL2, which is more of a VM type instance, but WSL1 has issues with kernel modules and some networking stuff due to how it integrates with Windows

projectdp@lemmy.ml · 2 pts · 3y

I've read that systemd-homed can do encrypted home directories but I haven't tried it, much less on WSL but that may get you to achieve the encrypted home directory at least.

Personally I don't think I would have a need to encrypt all of WSL, but maybe that also makes sense for your case.

ArchWiki example: https://wiki.archlinux.org/title/Systemd-homed

flashgnash@lemm.ee · 2 pts · 3y

Would it not be encrypted if you just encrypt your windows drive with bitlocker? Seems kinda redundant to double encrypt to me

llama_spit@lemm.ee · 1 pts · 3y (1 reply)

Yes.

You'll just boot up into a blank home folder and a completely uncustomized bash (or whatever your default shell is).

After mounting you'll have to restart your shell or source your .${SHELL}rc

_s10e@feddit.de · 1 pts · 3y

Ok, so via LUKS. Thanks