Problem with EGL egl failed to create dri2 screen

Hello,

I have created a VM to create a Fedora desktop using the commands describe here How to create instances - Incus documentation

Then I have install it using the web ui of incus.

Now I want to access my VM using RDP, but when I’m starting krdp server it does an error: « egl failed to create dri2 screen »

I’m probably missing something with virtio or virgl but I don’t know what

which desktop environment do you use, x11 or wayland?

I’m running a debian container with headless x11 without trouble. I used to run a alpine container with headless wlroots wayland using WLR_BACKENDS=headless and WLR_LIBINPUT_NO_DEVICES=1.

do you only have one gpu in you pc and passthrough the gpu to the vm without config pci passthrough?

If not, can you try vnc?

or can you create vm using: incus create images:fedora/43 (name) --vm?

I’m creating it with an empty VM and attaching an ISO, it is not a container.

I have no GPU passthrough for the VM. Maybe I should use VirGL

I have install Incus on Debian Trixie using Zabbly repo and when I tried to add `gl=on` I get this error qemu-system-x86_64: OpenGL support was not enabled in this build of QEMU

Please give me more details. I can’t help you by guessing. You only said you created a fedora VM by using ISO without GPU passthrough. And I guess you use kde.

cat /run/incus/(vm name)/qemu.conf

incus config show (vm name)

And all relate steps in VM.

Yes no problem and you guess right I use KDE

# Machine
[machine]
usb = "off"
type = "q35"
graphics = "off"
accel = "kvm"

[global]
driver = "ICH9-LPC"
property = "disable_s3"
value = "1"

[global]
value = "0"
driver = "ICH9-LPC"
property = "disable_s4"

[boot-opts]
strict = "on"

# Memory
[memory]
slots = "8"
size = "8192M"
maxmem = "62122M"

# CPU
[smp-opts]
maxcpus = "18"
cpus = "1"

[object "mem0"]
qom-type = "memory-backend-memfd"
size = "8192M"
share = "on"

[numa]
type = "node"
nodeid = "0"
memdev = "mem0"

# Firmware (read only)
[drive]
unit = "0"
readonly = "on"
file = "/opt/incus/share/qemu/OVMF_CODE.4MB.fd"
if = "pflash"
format = "raw"

# Firmware settings (writable)
[drive]
file = "/dev/fd/4"
if = "pflash"
format = "raw"
unit = "1"

# Qemu control
[chardev "monitor"]
wait = "off"
path = "/run/incus/desktop/qemu.monitor"
backend = "socket"
server = "on"

[mon]
mode = "control"
chardev = "monitor"

# Console
[chardev "console"]
backend = "ringbuf"
size = "1048576"

# VM core info driver
[device "qemu_vmcoreinfo"]
driver = "vmcoreinfo"

[device "qemu_pcie0"]
driver = "pcie-root-port"
bus = "pcie.0"
addr = "1.0"
chassis = "0"
multifunction = "on"

# Balloon driver
[device "qemu_balloon"]
driver = "virtio-balloon-pci"
bus = "qemu_pcie0"
addr = "00.0"
multifunction = "on"

# Random number generator
[object "qemu_rng"]
qom-type = "rng-random"
filename = "/dev/urandom"

[device "dev-qemu_rng"]
bus = "qemu_pcie0"
addr = "00.1"
rng = "qemu_rng"
driver = "virtio-rng-pci"

# Input
[device "qemu_keyboard"]
driver = "virtio-keyboard-pci"
bus = "qemu_pcie0"
addr = "00.2"

# Input
[device "qemu_tablet"]
driver = "virtio-tablet-pci"
bus = "qemu_pcie0"
addr = "00.3"

# Vsock
[device "qemu_vsock"]
vhostfd = "3"
driver = "vhost-vsock-pci"
bus = "qemu_pcie0"
addr = "00.4"
guest-cid = "3348623858"

# Virtual serial bus
[device "dev-qemu_serial"]
bus = "qemu_pcie0"
addr = "00.5"
driver = "virtio-serial-pci"

# Serial identifier
[chardev "qemu_serial-chardev"]
backend = "ringbuf"
size = "16B"

[device "qemu_serial"]
driver = "virtserialport"
name = "org.linuxcontainers.incus"
bus = "dev-qemu_serial.0"
chardev = "qemu_serial-chardev"

[device "qemu_serial_legacy"]
driver = "virtserialport"
name = "org.linuxcontainers.lxd"
bus = "dev-qemu_serial.0"

# Spice agent
[chardev "qemu_spice-chardev"]
backend = "spicevmc"
name = "vdagent"

[device "qemu_spice"]
name = "com.redhat.spice.0"
chardev = "qemu_spice-chardev"
bus = "dev-qemu_serial.0"
driver = "virtserialport"

# Spice folder
[chardev "qemu_spicedir-chardev"]
backend = "spiceport"
name = "org.spice-space.webdav.0"

[device "qemu_spicedir"]
driver = "virtserialport"
name = "org.spice-space.webdav.0"
chardev = "qemu_spicedir-chardev"
bus = "dev-qemu_serial.0"

# USB controller
[device "qemu_usb"]
driver = "qemu-xhci"
bus = "qemu_pcie0"
addr = "00.6"
p2 = "8"
p3 = "8"

[chardev "qemu_spice-usb-chardev1"]
backend = "spicevmc"
name = "usbredir"

[device "qemu_spice-usb1"]
driver = "usb-redir"
chardev = "qemu_spice-usb-chardev1"

[chardev "qemu_spice-usb-chardev2"]
backend = "spicevmc"
name = "usbredir"

[device "qemu_spice-usb2"]
chardev = "qemu_spice-usb-chardev2"
driver = "usb-redir"

[chardev "qemu_spice-usb-chardev3"]
name = "usbredir"
backend = "spicevmc"

[device "qemu_spice-usb3"]
driver = "usb-redir"
chardev = "qemu_spice-usb-chardev3"

# Sound device
[audiodev "qemu_spice-audiodev"]
driver = "spice"

[device "qemu_spice-audio"]
driver = "virtio-sound-pci"
bus = "qemu_pcie0"
addr = "00.7"
audiodev = "qemu_spice-audiodev"

[device "qemu_pcie1"]
chassis = "1"
driver = "pcie-root-port"
bus = "pcie.0"
addr = "1.1"

# SCSI controller
[device "qemu_scsi"]
driver = "virtio-scsi-pci"
bus = "qemu_pcie1"
addr = "00.0"

[device "qemu_pcie2"]
bus = "pcie.0"
addr = "1.2"
chassis = "2"
driver = "pcie-root-port"

# Shared config drive (9p)
[fsdev "qemu_config"]
path = "/var/lib/incus/devices/desktop/config.mount"
fsdriver = "local"
security_model = "none"
readonly = "on"

[device "dev-qemu_config-drive-9p"]
mount_tag = "config"
fsdev = "qemu_config"
driver = "virtio-9p-pci"
bus = "qemu_pcie2"
addr = "00.0"
multifunction = "on"

# Shared agent drive (9p)
[fsdev "qemu_agent"]
security_model = "none"
readonly = "on"
path = "/opt/incus/agent/"
fsdriver = "local"

[device "dev-qemu_agent-drive-9p"]
fsdev = "qemu_agent"
driver = "virtio-9p-pci"
bus = "qemu_pcie2"
addr = "00.1"
mount_tag = "agent"

[device "qemu_pcie3"]
driver = "pcie-root-port"
bus = "pcie.0"
addr = "1.3"
chassis = "3"

# GPU
[device "qemu_gpu"]
driver = "virtio-vga"
bus = "qemu_pcie3"
addr = "00.0"

[device "qemu_pcie4"]
driver = "pcie-root-port"
bus = "pcie.0"
addr = "1.4"
chassis = "4"

# VM Generation ID
[device "vmgenid0"]
driver = "vmgenid"
guid = "a3f6430b-21db-44ed-8a20-26080b629f78"

[device "qemu_pcie5"]
driver = "pcie-root-port"
bus = "pcie.0"
addr = "1.5"
chassis = "5"

[device "qemu_pcie6"]
driver = "pcie-root-port"
bus = "pcie.0"
addr = "1.6"
chassis = "6"

[device "qemu_pcie7"]
driver = "pcie-root-port"
bus = "pcie.0"
addr = "1.7"
chassis = "7"

[device "qemu_pcie8"]
bus = "pcie.0"
addr = "2.0"
chassis = "8"
multifunction = "on"
driver = "pcie-root-port"

[device "qemu_pcie9"]
addr = "2.1"
chassis = "9"
driver = "pcie-root-port"
bus = "pcie.0"

[device "qemu_pcie10"]
chassis = "10"
driver = "pcie-root-port"
bus = "pcie.0"
addr = "2.2"

[device "qemu_pcie11"]
driver = "pcie-root-port"
bus = "pcie.0"
addr = "2.3"
chassis = "11"

[device "qemu_pcie12"]
chassis = "12"
driver = "pcie-root-port"
bus = "pcie.0"
addr = "2.4"

And

architecture: x86_64
config:
  boot.autorestart: "true"
  boot.autostart: "true"
  limits.cpu: "4"
  limits.memory: 8GiB
  volatile.cloud-init.instance-id: 8ae05749-945c-4493-9d8d-48fe0f3e1f91
  volatile.eth0.host_name: tap4d5dcdbf
  volatile.eth0.hwaddr: 10:66:6a:5a:de:2a
  volatile.eth0.last_state.ip_addresses: 10.100.1.13,fd12:3456:7890:1:1266:6aff:fe5a:de2a
  volatile.last_state.power: RUNNING
  volatile.last_state.ready: "false"
  volatile.uuid: a3f6430b-21db-44ed-8a20-26080b629f78
  volatile.uuid.generation: a3f6430b-21db-44ed-8a20-26080b629f78
  volatile.vm.definition: pc-q35-10.1
  volatile.vm.rtc_adjustment: "-1"
  volatile.vm.rtc_offset: "1"
  volatile.vsock_id: "3348623858"
devices:
  data:
    pool: data
    source: data
    type: disk
  iso-volume:
    boot.priority: "10"
    pool: data
    source: fedora-kinoite-43
    type: disk
ephemeral: false
profiles:
- default
stateful: false
description: Desktop PC

(iso is detached once installed)

After Fedora is up and running, I go in the settings of KDE, section “Remote Desktop” to enable the RDP server.
Then look to journalctl -f /usr/bin/krdpserver and see the message.

Also if I run eglinfo -B I get the same message.

After 2 hours trying, I gave up. I tried to install kde in a fedora vm, but can’t start kde. Then I installed kde in a debian vm, but can’t start krdp. I know why you install fedora from ISO now. Due to I can’t reproduce your environment, I can only give you some points to try. I feel sorry about not being able to help you anymore.

First, gl=on is impossible:

Second, you can try this drivers for test:

For example:

name: qemu
description: qemu driver
devices: {}
config:
  raw.qemu.conf: |-
    [device "qemu_gpu"]
    driver = "qxl-vga"

Third, you can try vnc.

Fourth, use another desktop environment.

Fifth, use container. It’s very easy to use gpu. Just change gid to container’s video gid and change gpu’s pci address.

name: hwac
description: hardware acceleration
devices:
  mygpu:
    gid: '44'
    gputype: physical
    pci: '0000:00:02.0'
    type: gpu

Thank you for your reply

Is it possible to install a full DE in a non privileged LXC ?

I already use the gpu for some LXC but no passthrough

Maybe I will look to SR-IOV to split my GPU and do passthrough

Yes, I’m running mate desktop in a unprivileged LXC.

When we say gpu passthrough to linux container means add the hwac profile to the lxc, doesn’t means real gpu passthrough, because we haven’t make a term for it. Same gpu can be shared by multiple containers.

Do you have a config to share for your mate desktop please

Nothing fancy. I create a container with hwac profile. And I just install mate-desktop-environment and tigervnc-standalone-server.

And auto start vnc use systemd.

[Unit]
Description=Start TigerVNC server at startup
After=syslog.target network.target

[Service]
Type=simple
User=(username)
Group=(username)
WorkingDirectory=/home/(username)

PIDFile=/home/(username)/.vnc/%H:590%i.pid
ExecStartPre=-/bin/sh -c "/usr/bin/vncserver -kill :%i > /dev/null 2>&1"
ExecStart=/usr/bin/vncserver -fg -depth 24 -geometry 1920x1080 -localhost no :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

Oh,I forgot tigervnc config.

~/.vnc/xstartup

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
mate-session

Thank you