Building¶
The following instructions will help you build Looking Glass from source code. Before attempting this, you should have a basic understanding of how to use the shell.
Downloading¶
Visit the Looking Glass Download Page, and download the stable version (recommended). You can also download a bleeding-edge version, or the latest RC version during a Release Candidate cycle.
Developers can clone the source code repo with git
.
git clone --recursive https://github.com/gnif/LookingGlass.git
Warning
Please only clone from Git if you’re a developer, and know what you’re doing. Looking Glass requires git submodules that must be setup and updated when building. Source code downloads from the website come bundled with the necessary submodules.
Note
When using the latest bleeding-edge client version, you MUST download and install the corresponding host application.
Client¶
Installing Build Dependencies¶
These required libraries and tools should be installed first.
Required Dependencies¶
cmake
gcc | clang
fonts-freefont-ttf
libegl-dev
libgl-dev
libfontconfig1-dev
libgmp-dev
libsdl2-dev
libsdl2-ttf-dev
libspice-protocol-dev
make
nettle-dev
pkg-config
May be disabled¶
These dependencies are required by default, but may be omitted if their feature is disabled when running cmake.
Disable with
cmake -DENABLE_BACKTRACE=no ..
binutils-dev
Disable with
cmake -DENABLE_X11=no ..
libx11-dev
libxfixes-dev
libxi-dev
libxss-dev
Disable with
cmake -DENABLE_WAYLAND=no ..
libwayland-bin
libwayland-dev
wayland-protocols
You can fetch these dependencies on Debian systems with the following command:
apt-get install binutils-dev cmake fonts-freefont-ttf libfontconfig1-dev
libsdl2-dev libsdl2-ttf-dev libspice-protocol-dev libx11-dev nettle-dev
wayland-protocols
Building¶
If you’ve downloaded the source code as a zip file, simply unzip and cd
into the new directory. If you’ve cloned the repo with git
, then cd
into the LookingGlass directory.
mkdir client/build
cd client/build
cmake ../
make
This will build the looking-glass-client binary, which is used to display frames from the guest.
See also
Note
The most common compile error is related to backtrace support. This can be
disabled by adding the following option to the cmake command:
-DENABLE_BACKTRACE=0
. However, if you disable this and need support for
a crash, use gdb
to obtain a backtrace manually.
Host¶
These instructions help you build the host yourself from the downloaded source code.
Warning
Building the host from source code is not recommended for most purposes, and should only be attempted by users who are prepared to handle issues on their own. Please download the pre-built binary installers from https://looking-glass.io/downloads for stability, and increased support.
Note
The pre-built binaries also include NvFBC support built in, which is only available to current Nvidia SDK license holders, and cannot be enabled when building the host without also having a license.
For Windows on Windows¶
Download and install msys2 x86_64 from http://www.msys2.org/ following the setup instructions provided
Run the MSYS2 shell
Download build dependencies with pacman
pacman -Fy
pacman -Sy git make mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake
Change directory to the source tree with
cd
Configure the project and build it
mkdir host/build
cd host/build
cmake -G "MSYS Makefiles" ..
make
For Linux on Linux¶
Make a host/build
directory, then run cmake
mkdir host/build
cd host/build
cmake ..
make
For Windows cross compiling on Linux¶
Like For Linux on Linux, but using the mingw64 toolchain to
cross-compile a Windows .exe
file.
mkdir host/build
cd host/build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-mingw64.cmake ..
make