WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Accessing bitlocker encryted drive

Open ghost opened this issue 10 years ago • 10 comments

Hi,

Is it supported to access files stored in a hard drive that is encrypted with bitlocker?

In my case, the letter appears in /mnt/ and I can even create new files in the encrypted drive from Bash, but I cannot see the files created through windows. Also, from windows I cannot see the files that I created from Bash.

Thanks!

ghost avatar Nov 14 '16 16:11 ghost

Hi @melonista -- for what it's worth, my C: drive is BitLocker-encrypted, and I can create new files on it and share them between Linux and Windows without (for the most part) any trouble. So this sounds like a bug to me. Could you provide some more details about your setup and some specific examples of commands that don't work for you?

I believe the drive does have to be NTFS-formatted. (I've never tried to use BitLocker with formats other than NTFS, but I assume that Windows otherwise lets you do so?)

aseering avatar Nov 14 '16 18:11 aseering

It is now working. No idea how or when happended. This is the secondary HD in my laptop, and it is NTFS formated. I just encrypted it using bitlocker (I selected the option of not encrypting the full drive, because it was empty). For some reason I can now access the content and generate new content from bash.

ghost avatar Nov 17 '16 09:11 ghost

It seems that the issue is that you have to unlock the unit before opening bash.

ghost avatar Nov 21 '16 12:11 ghost

I had the same issue. In my case, /mnt/e and E:\ seemed to be different worlds - WSL could create files on it that Explorer could no see, and vice-versa. Ejecting the drive, login off WSL, rebooting the computer, nothing would do, both Explorer and WSL would still see completely different things.

Eventually I managed to fix it by deleting /mnt/e and manually mounting the drive in WSL.

I think Microsoft should document what works and doesn't work with WSL and Bitlocker. Currently it's quite random and buggy.

laurent22 avatar Jun 10 '19 15:06 laurent22

It seems that the issue is that you have to unlock the unit before opening bash.

This issue still exists on wsl2 ;)

KnuX avatar Sep 28 '19 09:09 KnuX

And I had to close all wsl terminal windows before the folder would be visible.

lleeoo avatar Aug 21 '20 07:08 lleeoo

As a workaround, you can do "sudo mount -t drvfs -o uid=1000,gid=1000 e: /mnt/e"

KnuX avatar Aug 21 '20 08:08 KnuX

This gives me the following error:

$ sudo mount -t drvfs -o uid=1000,gid=1000 drvfs: /mnt/d
mount: /mnt/d: wrong fs type, bad option, bad superblock on drvfs:, missing codepage or helper program, or other error.
<3>init: (16561) ERROR: UtilCreateProcessAndWait:501: /bin/mount failed with status 0x2000
No error information

rklec avatar Jun 17 '22 09:06 rklec

Okay an upgrade to WSL v2 failed for me, but stopping and restarting worked.

rklec avatar Jun 17 '22 09:06 rklec

With /etc/wsl.conf:

[automount]
options = case = force

from the guide to enable case sensitivity fails and lets it not mount again. (Same with options = case = dir)

rklec avatar Jun 17 '22 11:06 rklec