VeraCrypt on Raspberry Pi

From KHicks
Jump to: navigation, search

The Raspberry Pi runs on an ARM chip, and as such, it does not support the traditional VeraCrypt binaries. Therefore, it must be compiled from source. If that wasn't bad enough, there is a known bug in VeraCrypt that produces runtime errors if it is compiled with GCC 5.x. In this exercise, we will be installing VeraCrypt on a Raspberry Pi 2 running Ubuntu 16.04.

Install Ubuntu

First, obtain the Ubuntu 16.04 image for Raspberry Pi from the Ubuntu website. Follow the installation procedure and optionally the partition expansion steps.

Install GCC 4.9

This step is no longer necessary as of VeraCrypt 1.18.

While VeraCrypt will compile with the version of GCC provided with Ubuntu 16.04, it will produce runtime errors when attempting to create or mount a volume[1].

   # apt-get install build-essential
   # add-apt-repository ppa:ubuntu-toolchain-r/test
   # apt-get update
   # apt-get install gcc-4.9 g++-4.9 cpp-4.9
   # cd /usr/bin
   # rm gcc g++ cpp
   # ln -s gcc-4.9 gcc
   # ln -s g++-4.9 g++
   # ln -s cpp-4.9 cpp

Compile VeraCrypt

VeraCrypt 1.18 will not compile on ARM architectures. As a result, GCC 4.9 must be installed.

You will need to obtain a copy of the wxWidgets source code. This article will use version 3.1.0. Additionally, you will need a copy of the VeraCrypt source code. This article will use version 1.17.

Extract both of the archives into their own directories. For our purposes, we will use /home/user/veracrypt/ and /home/user/wxwidgets/. Once the files are extracted, run these commands as root. Be patient, as they will take a long time to complete.

cd /home/user/veracrypt/src/
make NOGUI=1 WX_ROOT=/home/user/wxwidgets/wxWidgets-3.1.0/ wxbuild
cp Main/veracrypt /usr/local/bin

VeraCrypt should now be installed and available to run with command veracrypt.