Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VirtualBox fails to start due to Qt being unable to load "xcb" platform plugin #24315

Closed
rzetterberg opened this issue Mar 25, 2017 · 7 comments

Comments

@rzetterberg
Copy link
Member

Issue description

Starting VirtualBox fails with the following error:

$ VirtualBox
Qt FATAL: This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: minimal, offscreen, xcb.

Reinstalling the application may fix this problem.
Aborted

Steps to reproduce

I'm using NixOS where this problem occurs in both the unstable and 17.03 channel.

Add this to your configuration.nix:

    virtualisation.virtualbox.host.enable = true;

And run:

sudo nixos-rebuild switch &&
VirtualBox

And you should get the same error.

Technical details

$ nixos-version
17.03beta685.1dbb962 (Gorilla)
$ VirtualBox --help
Oracle VM VirtualBox Manager 5.1.18
$ ldd /nix/store/3picm7ci74x61kc5ppprjiv98nr9yqym-virtualbox-5.1.18/libexec/virtualbox/VirtualBox
        linux-vdso.so.1 (0x00007ffe93da8000)
        libpthread.so.0 => /nix/store/xafk1b80inxf4nvkdpzd8s2gd876ac8i-glibc-multi-2.25/lib/libpthread.so.0 (0x00007f078bbfe000)
        libdl.so.2 => /nix/store/xafk1b80inxf4nvkdpzd8s2gd876ac8i-glibc-multi-2.25/lib/libdl.so.2 (0x00007f078b9fa000)
        libc.so.6 => /nix/store/xafk1b80inxf4nvkdpzd8s2gd876ac8i-glibc-multi-2.25/lib/libc.so.6 (0x00007f078b65b000)
        /nix/store/xafk1b80inxf4nvkdpzd8s2gd876ac8i-glibc-multi-2.25/lib/ld-linux-x86-64.so.2 (0x00007f078be1c000)

What I have tried so far

I tried setting virtualisation.virtualbox.host.enable to false, rebuilding,
rebooting, reseting the value to true, rebuilding and rebooting. That did not
fix the problem.

I tried switching from the unstable channel to the 17.03, updating,
rebuilding and rebooting. That did not fix the problem.

Please let me know if I can provide any more information!

@xvapx
Copy link
Contributor

xvapx commented Mar 25, 2017

look at #24189, I had a similar problem with tribler

@AndersonTorres
Copy link
Member

A similar error is treated here. Maybe it is something Qt-related interligating both:

#24256

@xvapx
Copy link
Contributor

xvapx commented Mar 25, 2017

It would be useful to set QT_DEBUG_PLUGINS to 1 and run the command again.

@rzetterberg
Copy link
Member Author

Thank you, @xvapx and @AndersonTorres

I found a solution to my problem.

I had a similar problem with libEGL a while back that I couldn't solve even though I updated, rebuilt, rebooted, etc. The problem was that there was a linking mismatch between packages installed by nix-env and systemPackages. Running nix-env -u solved that problem.

So, I had a hunch that maybe there is some sort of interference between a nix-env installed package using Qt and the virtualbox system package after the last upgrade. So I removed (nix-env -e $(nix-env -q)) all nix-env packages because I did not use anyone of them. After that starting VirtualBox worked!

However, I had already closed that terminal I ran the command in, so I don't know which packages I had installed :( Sorry for that.

@glaebhoerl
Copy link
Contributor

(for anyone else who finds this via google: see also #24256)

@praduca
Copy link
Contributor

praduca commented Dec 23, 2017

I recently had the same issue, and after doing the tip from @rzetterberg (nix-env -e $(nix-env -q)) on my user and VirtualBox still doesn't worked.
After a week of frustration, i tried again, this time under root, and it came back from the dead :)
This doesn't make much sense to me, because the installation under root shouldn't affect my own user (i think), but anyway, i'm pasting the uninstalled apps so someone can get some intuition on it.

sheetsUninstalled.txt

@DigitAlchemies
Copy link

For those who are still stuck after trying every other option out there in the internet, you can look into exact path from which this notorious libqxcb.so is being searched in, for opening/loading by the Qt App(VirtualBox-5.2.8 is the Qt app in my case), using the strace tool. In my case, since I was building VirtualBox-5.2.8 from its source, it was searching for libqxcb.so in the below location :
"...VirtualBox-5.2.8/out/linux.amd64/release/bin/platforms/"
and not in the default library paths, Qt installation path, etc. So, none of the ldd checks, and other solutions worked. And also setting QT_DEBUG_PLUGINS=1 didn't produce any extra logs either.

Running strace on the the VirtualBox binary I built using Clang/LLVM on Ubuntu 17.10 x86_64:

...VirtualBox-5.2.8$ strace ./out/linux.amd64/release/bin/VirtualBox

.
.
.
access(".../VirtualBox-5.2.8/out/linux.amd64/release/bin/platforms/.", F_OK) = -1 ENOENT (No such file or directory)
write(2, "Qt FATAL: ", 10Qt FATAL: )              = 10
write(2, "This application failed to start"..., 154This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Reinstalling the application may fix this problem.) = 154
.
.
.

That was my hitting-the-nail-on-its-head moment, and I created the symlink from the installed Qt5.10.1's platforms directory mentioned below :
"...Qt5.10.1/Tools/QtCreator/lib/Qt/plugins/platforms/" onto the searched path which is "...VirtualBox-5.2.8/out/linux.amd64/release/bin/". Thus, VirtualBox-5.2.8 built from source on Linux(Ubuntu 17.10 x86_64) using Clang/LLVM, finally launched successfully!

Additional details can be found here in the answer I have written : https://askubuntu.com/a/1017955/194850

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants