wiki/virt/vm/display.md

127 lines
2.4 KiB
Markdown
Raw Normal View History

2022-07-31 09:22:08 +00:00
---
title: Display
description: How to access a virtual machine's display
published: true
2022-08-24 23:13:52 +00:00
date: 2022-08-24T23:13:49.450Z
2022-07-31 09:22:08 +00:00
tags:
editor: markdown
dateCreated: 2022-07-31T09:22:05.854Z
---
# Display
2022-08-24 23:13:52 +00:00
A virtual display can be attached to a virtual machine, letting a user see the content of it. It is a must-have for non-headless scenario.
2022-07-31 09:22:08 +00:00
## Summary
2022-08-24 23:13:52 +00:00
> *[Official ressource](https://libvirt.org/formatdomain.html#graphical-framebuffers) for `libvirt`-compatible displays, including various XML examples*
>
{.is-info}
2022-08-01 10:20:02 +00:00
* *to-be done. Add table here*.
2022-07-31 09:22:08 +00:00
## Specific displays
### VNC
* *to-be done*
### Spice
* *to-be done*
### SDL
The Simple DirectMedia Layer is a local-only low-latency display.
2022-08-12 23:47:43 +00:00
> *SDL is currently only avalable with virtual machines created using the QEMU/KVM **User Session** mode*
{.is-info}
> *As of now, this method is not compatible with Wayland* {.is-info}
> *Mouse grab does not currently work in SDL*
2022-07-31 09:22:08 +00:00
{.is-warning}
2022-08-12 23:55:28 +00:00
* The display resolution of your guest display should not exceed that of your physical screen.
2022-08-12 23:47:43 +00:00
#### SELinux configuration
2022-08-12 23:55:28 +00:00
By default, SELinux will block access to X Windows Server for the virtualization stack. An exception has to be set.
2022-08-12 23:47:43 +00:00
* Set new rule
```
sudo setsebool -P virt_use_xserver 1
```
* Do some magic trick
```
sudo ausearch -c 'qemu-system-x86' --raw | audit2allow -M my-qemusystemx86
k
```
* And another one
```
sudo semodule -X 300 -i my-qemusystemx86.pp
```
2022-08-12 23:57:17 +00:00
#### XML SDL example
2022-08-12 23:47:43 +00:00
* Example of an XML SDL configuration, with OpenGL enabled. This example requires a 3D-capable graphic card to be attached to the guest computer, such as ``virtio-gpu`` or ``vfio-pci``.
2022-07-31 09:22:08 +00:00
```
<graphics type="sdl" display=":0.0">
<gl enable="yes"/>
</graphics>
```
2022-08-12 23:55:28 +00:00
2022-08-12 23:56:11 +00:00
> *You can identify your display using the following command: `echo $DISPLAY`*
{.is-info}
2022-08-12 23:55:28 +00:00
2022-08-24 23:13:52 +00:00
### D-Bus
> The D-Bus display is only available since version 7.4.0 of *libvirt*
{.is-warning}
[D-Bus](https://www.freedesktop.org/wiki/Software/dbus/) is a Desktop-oriented middleware that can be used to create a display for a virtual machine.
Export and enable a video backend, add OpenGL support and peer-to-peer connection :
```
<graphics type='dbus'/>
<p2p value="on"/>
<gl enable="yes"/>
</graphics>
```
Export and enable an audio backend :
<graphics type='dbus' ...>
<audio id='1'>
</graphics>
2022-07-31 09:22:08 +00:00
### Xephyr
* *to-be done*
### WebRTC
* *to-be done*
### Looking Glass
* *to-be done*
2022-08-12 23:47:43 +00:00
### virtio-wayland
2022-07-31 09:22:08 +00:00
* *to-be done*
### egl-headless
* *to-be done*