looking-glass/client
2020-08-11 14:45:08 +10:00
..
clipboards [build] make "common" a static library (part 2/2) 2019-04-11 11:12:59 +10:00
cmake [client] egl: move shaders into seperate files and build into objects 2019-03-28 14:59:54 +11:00
decoders [build] make "common" a static library (part 2/2) 2019-04-11 11:12:59 +10:00
fonts [build] make "common" a static library (part 2/2) 2019-04-11 11:12:59 +10:00
include [client] gracefully restart if the host application restarts 2020-08-11 14:30:44 +10:00
parsers [all] update copyright dates 2019-02-22 22:16:14 +11:00
renderers [client] egl: properly wait for a new frame on restart 2020-08-11 14:45:08 +10:00
src [client] gracefully restart if the host application restarts 2020-08-11 14:30:44 +10:00
CMakeLists.txt [client] moved spice into a seperate repository 2020-01-31 21:39:57 +11:00
DEBUGGING.md [doc] Fix formatting 2018-05-23 08:46:03 +10:00
README.md [doc] readme updated with PsExec information 2020-08-09 20:11:19 +10:00

Looking Glass Client

This is the Looking Glass client application that is designed to work in tandem with the Looking Glass Host application


Building the Application

Build Dependencies

  • binutils-dev
  • cmake
  • fonts-freefont-ttf
  • libsdl2-dev
  • libsdl2-ttf-dev
  • libspice-protocol-dev
  • libfontconfig1-dev
  • libx11-dev
  • nettle-dev

Debian (and maybe Ubuntu)

apt-get install binutils-dev cmake fonts-freefont-ttf libsdl2-dev libsdl2-ttf-dev libspice-protocol-dev libfontconfig1-dev libx11-dev nettle-dev

Building

mkdir build
cd build
cmake ../
make

Should this all go well you should be left with the file looking-glass-client


Usage Tips

High priority capture using DXGI and Secure Desktop (UAC) capture support

By default Windows gives priority to the foreground application for any GPU work which causes issues with capture if the foreground application is consuming 100% of the available GPU resources. The looking glass host application is able to increase the kernel GPU thread to realtime priority which fixes this, but in order to do so it must run as the SYSTEM user account. To do this, please use PsExec from SysInternals (Microsoft), for example:

PsExec64.exe -s -i -d looking-glass-host.exe

This will also enable the host application to capture the secure desktop which includes things like the lock screen and UAC prompts.

A future update (likely Beta 3) will include a service launcher for the Looking Glass host which will remove the need for PsExec.

Key Bindings

By default Looking Glass uses the Scroll Lock key as the escape key for commands as well as the input capture mode toggle, this can be changed using the -m switch if you desire a different key. Below are a list of current key bindings:

Command Description
ScrLk Toggle cursor screen capture
ScrLk+F Full Screen toggle
ScrLk+I Spice keyboard & mouse enable toggle
ScrLk+N Toggle night vision mode (EGL renderer only!)
ScrLk+Q Quit
ScrLk+Insert Increase mouse sensitivity (in capture mode only)
ScrLk+Del Decrease mouse sensitivity (in capture mode only)
ScrLk+F1 Send Ctrl+Alt+F1 to the guest
ScrLk+F2 Send Ctrl+Alt+F2 to the guest
ScrLk+F3 Send Ctrl+Alt+F3 to the guest
ScrLk+F4 Send Ctrl+Alt+F4 to the guest
ScrLk+F5 Send Ctrl+Alt+F5 to the guest
ScrLk+F6 Send Ctrl+Alt+F6 to the guest
ScrLk+F7 Send Ctrl+Alt+F7 to the guest
ScrLk+F8 Send Ctrl+Alt+F8 to the guest
ScrLk+F9 Send Ctrl+Alt+F9 to the guest
ScrLk+F10 Send Ctrl+Alt+F10 to the guest
ScrLk+F11 Send Ctrl+Alt+F11 to the guest
ScrLk+F12 Send Ctrl+Alt+F12 to the guest

Setting options via command line arguments

The syntax is simple: module:name=value, for example:

./looking-glass-client win:fullScreen=yes egl:nvGain=1

Setting options via configuration files

By default the application will look for and load the config files in the following locations

  • /etc/looking-glass-client.ini
  • ~/.looking-glass-client.ini

The format of this file is the commonly known INI format, for example:

[win]
fullScreen=yes

[egl]
nvGain=1

Command line arguments will override any options loaded from the config files.

Supported options

|-------------------------------------------------------------------------------------------------------------------------|
| Long                   | Short | Value                  | Description                                                   |
|-------------------------------------------------------------------------------------------------------------------------|
| app:configFile         | -C    | NULL                   | A file to read additional configuration from                  |
| app:shmFile            | -f    | /dev/shm/looking-glass | The path to the shared memory file                            |
| app:shmSize            | -L    | 0                      | Specify the size in MB of the shared memory file (0 = detect) |
| app:renderer           | -g    | auto                   | Specify the renderer to use                                   |
| app:license            | -l    | no                     | Show the license for this application and then terminate      |
| app:cursorPollInterval |       | 1000                   | How often to check for a cursor update in microseconds        |
| app:framePollInterval  |       | 1000                   | How often to check for a frame update in microseconds         |
|-------------------------------------------------------------------------------------------------------------------------|

|-------------------------------------------------------------------------------------------------------------|
| Long                    | Short | Value                  | Description                                      |
|-------------------------------------------------------------------------------------------------------------|
| win:title               |       | Looking Glass (client) | The window title                                 |
| win:position            |       | center                 | Initial window position at startup               |
| win:size                |       | 1024x768               | Initial window size at startup                   |
| win:autoResize          | -a    | no                     | Auto resize the window to the guest              |
| win:allowResize         | -n    | yes                    | Aallow the window to be manually resized         |
| win:keepAspect          | -r    | yes                    | Maintain the correct aspect ratio                |
| win:borderless          | -d    | no                     | Borderless mode                                  |
| win:fullScreen          | -F    | no                     | Launch in fullscreen borderless mode             |
| win:maximize            | -T    | no                     | Launch window maximized                          |
| win:minimizeOnFocusLoss |       | yes                    | Minimize window on focus loss                    |
| win:fpsLimit            | -K    | 200                    | Frame rate limit (0 = disable - not recommended) |
| win:showFPS             | -k    | no                     | Enable the FPS & UPS display                     |
| win:ignoreQuit          | -Q    | no                     | Ignore requests to quit (ie: Alt+F4)             |
| win:noScreensaver       | -S    | no                     | Prevent the screensaver from starting            |
| win:alerts              | -q    | yes                    | Show on screen alert messages                    |
|-------------------------------------------------------------------------------------------------------------|

|---------------------------------------------------------------------------------------------------------------------------------------|
| Long               | Short | Value           | Description                                                                            |
|---------------------------------------------------------------------------------------------------------------------------------------|
| input:grabKeyboard | -G    | yes             | Grab the keyboard in capture mode                                                      |
| input:escapeKey    | -m    | 71 = ScrollLock | Specify the escape key, see https://wiki.libsdl.org/SDLScancodeLookup for valid values |
| input:hideCursor   | -M    | yes             | Hide the local mouse cursor                                                            |
| input:mouseSens    |       | 0               | Initial mouse sensitivity when in capture mode (-9 to 9)                               |
|---------------------------------------------------------------------------------------------------------------------------------------|

|------------------------------------------------------------------------------------------------------------------|
| Long                   | Short | Value     | Description                                                         |
|------------------------------------------------------------------------------------------------------------------|
| spice:enable           | -s    | yes       | Enable the built in SPICE client for input and/or clipboard support |
| spice:host             | -c    | 127.0.0.1 | The SPICE server host or UNIX socket                                |
| spice:port             | -p    | 5900      | The SPICE server port (0 = unix socket)                             |
| spice:input            |       | yes       | Use SPICE to send keyboard and mouse input events to the guest      |
| spice:clipboard        |       | yes       | Use SPICE to syncronize the clipboard contents with the guest       |
| spice:clipboardToVM    |       | yes       | Allow the clipboard to be syncronized TO the VM                     |
| spice:clipboardToLocal |       | yes       | Allow the clipboard to be syncronized FROM the VM                   |
| spice:scaleCursor      | -j    | yes       | Scale cursor input position to screen size when up/down scaled      |
|------------------------------------------------------------------------------------------------------------------|

|--------------------------------------------------------------------------|
| Long          | Short | Value | Description                              |
|--------------------------------------------------------------------------|
| egl:vsync     |       | no    | Enable vsync                             |
| egl:nvGainMax |       | 1     | The maximum night vision gain            |
| egl:nvGain    |       | 0     | The initial night vision gain at startup |
|--------------------------------------------------------------------------|

|------------------------------------------------------------------------------------|
| Long                 | Short | Value | Description                                 |
|------------------------------------------------------------------------------------|
| opengl:mipmap        |       | yes   | Enable mipmapping                           |
| opengl:vsync         |       | yes   | Enable vsync                                |
| opengl:preventBuffer |       | yes   | Prevent the driver from buffering frames    |
| opengl:amdPinnedMem  |       | yes   | Use GL_AMD_pinned_memory if it is available |
|------------------------------------------------------------------------------------|