.. _installing: Installation ############ .. _libvirt: libvirt/QEMU Configuration: --------------------------- This article assumes you already have a fully functional libvirt domain with PCI passthrough working. If you use virt-manager, this guide also applies to you, since virt-manager uses libvirt as its back-end. .. _libvirt_ivshmem: IVSHMEM ^^^^^^^ Configuration ~~~~~~~~~~~~~ Add the following to your libvirt machine configuration inside the 'devices' section by running ``virsh edit `` where ```` is the name of your virtual machine. .. code:: xml 32 .. note:: If you are using QEMU directly without libvirt the following arguments are required instead. Add the following to the commands to your QEMU command line, adjusting the ``bus`` parameter to suit your particular configuration: .. code:: bash -device ivshmem-plain,memdev=ivshmem,bus=pcie.0 \ -object memory-backend-file,id=ivshmem,share=on,mem-path=/dev/shm/looking-glass,size=32M The memory size (show as 32 in the example above) may need to be adjusted as per the :ref:`Determining Memory ` section. .. _libvirt_determining_memory: Determining Memory ~~~~~~~~~~~~~~~~~~ You will need to adjust the memory size to be suitable for your desired maximum resolution, with the following formula: ``width x height x 4 x 2 = total bytes`` ``total bytes / 1024 / 1024 = total megabytes + 10`` For example, for a resolution of 1920x1080 (1080p): ``1920 x 1080 x 4 x 2 = 16,588,800 bytes`` ``16,588,800 / 1024 / 1024 = 15.82 MB + 10 = 25.82 MB`` You must round this value up to the nearest power of two, which for the provided example is 32MB. .. note:: Increasing this value beyond what you need does not yield any performance improvements, it simply will block access to that RAM making it unusable by your system. .. _libvirt_shmfile_permissions: Permissions ~~~~~~~~~~~ The shared memory file used by IVSHMEM is found in ``/dev/shm/looking-glass``. By default, it is owned by QEMU, and does not give read/write permissions to your user, which are required for Looking Glass to run properly. You can use `systemd-tmpfiles` to create the file before running your VM, granting the necessary permissions which allow Looking Glass to use the file properly. Create a new file ``/etc/tmpfiles.d/10-looking-glass.conf``, and populate it with the following:: #Type Path Mode UID GID Age Argument f /dev/shm/looking-glass 0660 user kvm - Change ``UID`` to the user name you will run Looking Glass with, usually your own. .. _libvirt_spice_server: Keyboard/Mouse/Display/Sound ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Looking Glass makes use of the SPICE protocol to provide keyboard and mouse input, sound input and output, and display fallback. .. note:: The default configuration that libvirt uses is not optimal and must be adjusted. Failure to perform these changes will cause input issues along with failure to support 5 button mice. If you would like to use Spice to give you keyboard and mouse input along with clipboard sync support, make sure you have a ```` device, then: - Find your ``