I want to run qemu on Debian Buster, and have therefore installed the qemu-system-x86_64 package.

The issue is that when I run:

qemu-system-x86_64 \
    -m 128M \
    -cpu kvm64,+smep,+smap \
    -kernel vmlinuz \
    -initrd initramfs.cpio.gz \
    -hdb flag.txt \
    -snapshot \
    -nographic \
    -monitor /dev/null \
    -no-reboot \
    -append "console=ttyS0 kaslr kpti=1 quiet panic=1" \

I get the following error:

qemu-system-x86_64: symbol lookup error: /lib/x86_64-linux-gnu/libvirglrenderer.so.0: undefined symbol: drmPrimeHandleToFD

How can I fix this error?

According to apt, I've the latest version of libvirglrenderer0 and there are no versions available in debian-backports.


qemu-system-x86/stable,stable,now 1:3.1+dfsg-8+deb10u8 amd64 [installed]
libvirglrenderer0/stable,now 0.7.0-2 amd64 [installed]


uname -a
Linux debian-parallels 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux


$ nm -D  /lib/x86_64-linux-gnu/libvirglrenderer.so.0 | grep drm
                 U drmPrimeHandleToFD
$ ldd  /lib/x86_64-linux-gnu/libvirglrenderer.so.0
    linux-vdso.so.1 (0x00007ffedad5f000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0d0bed8000)
    libgbm.so.1 => /lib/x86_64-linux-gnu/libgbm.so.1 (0x00007f0d0bcd3000)
    libepoxy.so.0 => /lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007f0d0bba1000)
    libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f0d0ba60000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0d0ba3f000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0d0b87e000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f0d0c0ee000)
    libPrlDRI.so.1 => /lib/x86_64-linux-gnu/libPrlDRI.so.1 (0x00007f0d0b581000)
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0d0b3fd000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0d0b3e3000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0d0b3de000)
    libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f0d0b3b4000)
    libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f0d0b1ae000)
    libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f0d0afa8000)
    libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f0d0af8e000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f0d0af84000)

Update 1:

Before and after installing Parallels Tools:

enter image description here

  • The symbol is provided by libdrm.so.2, from the libdrm2 package; what version of that do you have? May 28 at 15:32
  • Why would you want to delete it? I don’t get the error you have, which is how I was able to figure out where the symbol comes from — nm -D could find it. You have the same versions of the libraries as I do, which suggests that some other library is being loaded instead. What does ldd /lib/x86_64-linux-gnu/libvirglrenderer.so.0 say? May 29 at 8:28
  • Yes, many packages depend on libdrm2 and would be uninstalled along with it. for file in /usr/lib/x86_64-linux-gnu/*.so*; do if nm -D "$file" | grep -q drmPrimeHandleToFD; then echo "$file"; nm -D "$file" | grep drmPrimeHandleToFD; fi; done shows all libraries requiring or declaring drmPrimeHandleToFD (look for T for the declarations). Do you know where libPrlDRI.so.1 comes from? The Debian libvirglrenderer.so.0 doesn’t require it. May 29 at 9:05

The sign that something is amiss is the

libPrlDRI.so.1 => /lib/x86_64-linux-gnu/libPrlDRI.so.1 (0x00007f0d0b581000)

line in ldd’s output: there’s no such library in Debian, so a library requiring it can’t come from a Debian package.

If libvirglrenderer.so.0 library isn’t the version provided by Debian,

sudo apt install --reinstall libvirglrenderer0

would fix that; but apparently that’s not the issue here.

libPrlDRI.so.1 comes from Parallel Tools; that ships a number of replacement libraries: libEGL.so.1, libgbm.so.1, and libGL.so.1, along with two Parallels-specific libraries, libPrlDRI.so.1 and libPrlWl.so.1. The guilty party here is probably libgbm.so.1: QEMU requires that library, and if it loads Parallels’ version (either through LD_LIBRARY_PATH, or updated ld.so configuration), it ends up loading libPrlDRI.so.1 instead of libdrm.so.2.

To fix that, you should be able to override the override:

LD_PRELOAD=/lib/x86_64-linux-gnu/libdrm.so.2 qemu-system-x86_64 ...
  • It seems the PrlDRI library comes from Parallels, perhaps something else is happening here (guest integration of some sort). May 29 at 9:22
  • It seems that /lib/x86_64-linux-gnu/libPrlDRI.so.1 is associated with Parallels, the VM engine running my Debian installation
    – Shuzheng
    May 29 at 9:37
  • I just tried to curl -XGET http://deb.debian.org/debian/pool/main/v/virglrenderer/libvirglrenderer0_0.7.0-2_amd64.deb -O to get the Debian version of libvirglrenderer0, and ldd still shows libPrlDRI.so.1 as a dependency, so your hypothesis that libvirglrenderer.so.0is not the version provided by Debian is incorrect. Do you know how libPrlDRI.so.1 can take precedence over libdrm.so.2?
    – Shuzheng
    May 31 at 8:53
  • libPrlDRI.so.1 only takes precedence over libdrm.so.2 after Parallels Tools is installed into the guest
    – Shuzheng
    May 31 at 8:59
  • See the update. May 31 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.