This guide describes how to set up a Linux System to build VeraCrypt from source and how to perform compilation.
The procedure for a Ubuntu 22.04 LTS system is described here as an example, the procedure for other Linux systems is analogous.
The procedure for a Ubuntu 22.04 LTS system is described here as an example, the procedure for other Linux systems is analogous.
The following components are required for compiling VeraCrypt:
- GNU Make
- GNU C/C++ Compiler
- YASM 1.3.0
- pkg-config
- wxWidgets 3.x shared library and header files installed by the system or wxWidgets 3.x library source code
- FUSE library and header files
- PCSC-lite library and header files
Below are the procedure steps. Clicking on any of the link takes directly to the related step:
- Installation of GNU Make
- Installation of GNU C/C++ Compiler
- Installation of YASM
- Installation of pkg-config
- Installation of wxWidgets 3.2
- Installation of libfuse
- Installation of libpcsclite
- Download VeraCrypt
- Compile VeraCrypt
They can also be performed by running the below list of commands in a terminal or by copying them to a script:
sudo apt update
sudo apt install -y build-essential yasm pkg-config libwxgtk3.0-gtk3-dev
sudo apt install -y libfuse-dev git libpcsclite-dev
git clone https://github.com/veracrypt/VeraCrypt.git
cd ~/VeraCrypt/src
make
Installation of GNU Make
- Open a terminal
-
Execute the following commands:
sudo apt update
sudo apt install build-essential
Installation of GNU C/C++ Compiler
If the build-essential were already installed in the step before, this step can be skipped.
- Open a terminal
-
Execute the following commands:
sudo apt update
sudo apt install build-essential
Installation of YASM
- Open a terminal
-
Execute the following commands:
sudo apt update
sudo apt install yasm
Installation of pkg-config
- Open a terminal
-
Execute the following commands:
sudo apt update
sudo apt install pkg-config
Installation of wxWidgets 3.2
- Open a terminal
-
Execute the following commands:
sudo apt update
sudo apt install libwxgtk3.0-gtk3-dev
Installation of libfuse
- Open a terminal
-
Execute the following commands:
sudo apt update
sudo apt install libfuse-dev
Installation of libpcsclite
- Open a terminal
-
Execute the following commands:
sudo apt update
sudo apt install libpcsclite-dev
Download VeraCrypt
- Open a terminal
-
Execute the following commands:
sudo apt update
sudo apt install git
git clone https://github.com/veracrypt/VeraCrypt.git
Compile VeraCrypt
Remarks:
-
By default, a universal executable supporting both graphical and text user interface (through the switch --text) is built.
On Linux, a console-only executable, which requires no GUI library, can be built using the 'NOGUI' parameter.
For that, you need to dowload wxWidgets sources, extract them to a location of your choice and then run the following commands:
make NOGUI=1 WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources wxbuild
make NOGUI=1 WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources -
If you are not using the system wxWidgets library, you will have to download and use wxWidgets sources like the remark above but this time the following commands should be run to build GUI version of VeraCrypt (NOGUI is not specified):
make WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources wxbuild
make WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources
- Open a terminal
-
Execute the following commands:
cd ~/VeraCrypt/src
make - If successful, the VeraCrypt executable should be located in the directory 'Main'.