54

How could I mount my BitLocker encrypted drive on Ubuntu?

I have checked the Wine website, and it had no BitLocker support, and I have no idea how to install Dislocker on my computer.

I can not remove the encryption because my school computers use Windows OS instead of Linux OS. Also because I installed Ubuntu because my Windows OS was not working.

Flimm
  • 41,766
Neugdae
  • 665
  • 1
  • 6
  • 8

6 Answers6

59

Since Ubuntu 18.04, Dislocker is available in the Ubuntu Universe packages. It can be installed using

sudo apt install dislocker

You may need to

sudo add-apt-repository universe
sudo apt update

First, we make two folders, /media/bitlocker and /media/mount:

sudo mkdir /media/bitlocker /media/mount

Then, download and then extract Dislocker.

You'll want to install some needed packages:

sudo apt-get install libfuse-dev

To install it, we need to change directory to the dislocker folder:

cd dislocker

Depending on your operating system, you'll need to choose one of these:

  • For Debian-like distos based on Debian Jessie or Ubuntu 14.04 or older:

     aptitude install gcc cmake make libfuse-dev libpolarssl-dev ruby-dev
    
  • For Debian-like distos based on Debian Stretch or Ubuntu 16.04 or later:

     aptitude install gcc cmake make libfuse-dev libmbedtls-dev ruby-dev
    

Now we finally install dislocker:

cmake .
make
sudo make install

Here, we need to find our partition so we dont erase all of our drives accidentally:

sudo fdisk -l

If we have a recovery password, we can decrypt it using this:

sudo dislocker -r -V /dev/sdaX -p 1536987-000000-000000-000000-000000-000000-000000-000000 -- /media/bitlocker

PS: You should replace 1536987-000000-000000-000000-000000-000000-000000-000000 with your recovery password.

If you know your password, we can just use that too:

sudo dislocker -r -V /dev/sdaX -u yourPassword -- /media/bitlocker

If your disk is mounted to sdb, use option sdb1.

If you are decrypting with a recovery file then use "path/to/.BEK" instead:

sudo dislocker-fuse -V /dev/sdcX -f /media/user/usb-drive/00000000-0X0X-0XX0-XXX0-XXXX0XXX00XX.BEK -- /media/bitlocker

Now, we finally mount our file:

sudo -i
cd /media/bitlocker
mount -r -o loop dislocker-file /media/mount

(If the mount above fails with "Permission denied" add the -r option and try again.)

Now you can move to the /media/mount folder and see your decrypted data.

Read the source for more information and details.

Maythux
  • 84,289
  • I don't have recovery password. And I'm not sure where to get this from. Can you tell me about this ? – Ejaz Karim May 16 '15 at 10:05
  • 1
    I also needed this: sudo apt-get install libpolarssl-dev - otherwise make would fail. – friederbluemle Dec 20 '15 at 17:56
  • 4
    Does this also allow for writing to the bitlockered drive as well as reading? – Samir Sep 06 '16 at 10:18
  • nazar@android:~/dislocker$ cmake . -- The C compiler identification is GNU 6.2.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Could NOT find POLARSSL (missing: – nazar2sfive Nov 06 '16 at 04:15
  • nazar@android:~/dislocker$ sudo apt-get install libpolarssl-dev Reading package lists... Done Building dependency tree
    Reading state information... Done E: Unable to locate package libpolarssl-dev
    – nazar2sfive Nov 06 '16 at 04:16
  • 1
    failed on ubuntu 16.10 – nazar2sfive Nov 06 '16 at 04:16
  • sudo fdisk -l lists /dev/sdb1 to /dev/sdb3 even though there is no partition on the USB-Stick. Also the dislocker command does not work on any of them – Thorsten Niehues Jan 25 '17 at 09:26
  • 1
    dislocker should support read-write (rw) access to some bitlocker containers/versions, "the source" link says windows 8 rw access wasn't supported yet (in 2014) and a comment says it would "silently mount as ro (even though mount shows as rw)" probably leading to the mount error "ntfs-3g-mount: mount failed: Permission denied". Omitting the -r option to dislocker & mount should try mounting rw – Xen2050 Jan 25 '17 at 10:45
  • I don't think method works anymore for discs cyrpted with newer Bitlocker introduced in Windows 10. sudo fdisk -l doesn't even recognize the disk drive. I can only think of this is why. – emrecnl Jul 21 '17 at 12:19
  • In case you get -like me- a /usr/include/ruby-2.5.0/ruby/ruby.h:24:10: fatal error: ruby/config.h: No such file or directory #include "ruby/config.h" just use sudo cp /usr/include/x86_64-linux-gnu/ruby-2.5.0/ruby/config.h /usr/include/ruby-2.5.0/ruby/ – Qohelet Nov 21 '18 at 14:27
  • on debian-based systems ther is simpler way to install: sudo apt install dislocker – gdbdable Dec 11 '18 at 09:09
  • Thanks a lot! :) – Romanzhivo Dec 08 '19 at 20:29
  • It worked fine on Ubuntu 20.04 too! Thank you very much. – Pereira Apr 22 '21 at 11:43
8

You need Dislocker to use BitLocker-encrypted drives. You can download it from here or there is a GitHub repository also.

To install it you will need:

  • A compiler, GCC or Clang;
  • Make (or gmake, for FreeBSD)
  • Headers for FUSE;
  • Headers for PolarSSL;
  • A partition encrypted with BitLocker, from Windows Vista, 7 or 8.

For detailed instructions, see this page or refer to install.txt file in the downloaded Dislocker archive.

Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
Ron
  • 20,638
6

Very good tutorial, however there's one problem. Since the file is read only you will need to use the read-only flag:

mount -ro loop dislocker-file /media/mount

Also the -u (--user-password) option to make this much easier:

sudo dislocker -r -V /dev/sdaX -u -- /media/mount
Enter the user password:▯ 

If you want to mount again in the same folder use:

sudo dislocker -r -V /dev/sdaX -u -- -o nonempty /media/mount

(Where X should be replaced by the number of your encrypted drive, e.g. /dev/sda7)

technop
  • 61
  • 1
  • 2
  • 3
    Also, do NOT use make uninstall for this package. It will break your symlinks and it will look like your /usr/bin has been deleted and you will think you will have to reinstall your distro however the files are all there after you reboot. I can't find the page that helped me fix this problem however there are other problems with the Makefile that the maintainer should be aware of. – technop Oct 12 '15 at 06:24
1

Modern versions of Ubuntu/Kubuntu can decrypt BitLocker partitions without extra software.

At least, I've tested in Kubuntu 22.04 (and everything is fine).

gabeweb
  • 533
0

I installed dislocker recently and running the script cmake . triggered errors on trying to find polarssl despite it being installed.

By chance, I eventually managed to install it: you should not run cmake under /dislocker/src directory as mentioned in the first reply (maybe it worked in the past) but should:

cd /dislocker
cmake .
Fabby
  • 34,259
0

the new package name for libpolarssl is: libmbedtls-dev

so you can install the libpolarssl compoments for cmake by installing it:

apt-get install libmbedtls-dev

Then cname and everything else will work fine

stevel
  • 1
  • So this and all older solutions entail that the encryption key is fully stored on the drive itself, rather than part of it being stored only on the TPU of the motherboard as is the case with BitLocker itself, right? – matanox Dec 20 '17 at 18:49