Solved Virtualbox and Libreoffice do not work anymore

Upgraded my system after a couple of months and discovered this:

Code:
[16:15][fmc000@tu45b-freebsd ~]$ libreoffice                             
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

[16:15][fmc000@tu45b-freebsd ~]$ virtualbox                               
Qt WARNING: Could not find the Qt platform plugin "xcb" in ""
Qt FATAL: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

zsh: abort      virtualbox
[16:15][fmc000@tu45b-freebsd ~]$

Anyone else? KDE running under X11.
 
I saw it but my laptop has only one GPU so I'm not sure that the proposed solution applies to my problem. Anyways, I'll try tomorrow and report back.

Edit: indeed it doesn't work.
 
OK, progress. If I create a /usr/local/lib/virtualbox/qt6.conf with just:

Code:
[2:54][fmc000@tu45b-freebsd ~]$ cat /usr/local/lib/virtualbox/qt6.conf         
[Paths]
Prefix = /usr/local/lib/qt6/
[2:55][fmc000@tu45b-freebsd ~]$

I get:

Code:
[2:54][fmc000@tu45b-freebsd ~]$ virtualbox
Qt WARNING: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
Qt FATAL: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: vkkhrdisplay, wayland, xcb, offscreen, vnc, minimal, wayland-egl.

zsh: abort      virtualbox
[2:54][fmc000@tu45b-freebsd ~]$

so I guess we have a problem with some libs. However, even if I "create them" nothing changes:

Code:
[2:58][fmc000@tu45b-freebsd /usr/local/lib]$ ls -l *xcb*curs*

-rw-r--r--  1 root wheel 29094 Jun 28 03:06 libxcb-cursor.a
lrwxr-xr-x  1 root wheel    22 Jun 28 03:06 libxcb-cursor.so -> libxcb-cursor.so.0.0.0
lrwxr-xr-x  1 root wheel    22 Jun 28 03:06 libxcb-cursor.so.0 -> libxcb-cursor.so.0.0.0
-rwxr-xr-x  1 root wheel 20040 Jun 28 03:06 libxcb-cursor.so.0.0.0
lrwxr-xr-x  1 root wheel    22 Sep 29 02:37 libxcb-cursor0.so -> libxcb-cursor.so.0.0.0
lrwxr-xr-x  1 root wheel    22 Sep 29 02:45 libxcb-cursor0.so.0 -> libxcb-cursor.so.0.0.0
lrwxr-xr-x  1 root wheel    22 Sep 29 02:37 libxcb-cursor0.so.0.0.0 -> libxcb-cursor.so.0.0.0
[2:58][fmc000@tu45b-freebsd /usr/local/lib]$
 
cannot reproduce your problem on my system that uses 14.3 quarterly packages, but can you do a

truss -s1000 -f -o/tmp/foo libreoffice

and have a look into /tmp/foo for more clues, maybe it finds a broken plugin library in your home.

also try executing libreoffice from a different user id that has a clean $HOME environment just to rule out any local misconfiguration.
 
PR 289895

Ok I believe I found the issue. Launching directly the VM ( virtualboxvm VM-NAME) I was able to start and the VM works just fine.

Help - About says:

Code:
VirtualBox Graphical User Interface Version 7.2.0 r170228
© 2004-2025 Oracle and/or its affiliates (Qt6.9.1 on xcb)
Copyright © 2025 Oracle and/or its affiliates.

So (IMHO) basically Virtualbox must be recompiled against Qt6.9.2, which is the version present in latest.
 
So (IMHO) basically Virtualbox must be recompiled against Qt6.9.2, which is the version present in latest.
2025Q3 has just been branched off, so everything in 'latest' yesterday will now be in the new quarterly.
 
Problem on LibreOffice (qt.qpa.plugin error) smells like what happened when Qt5 was the default. Do you have anything Qt-related libraries under /usr/local/lib/compat/pkg/ (including subdirectories)?

If so, try moving them into different directory which shared objects (libraries) are NOT AT ALL looked for and see it helps or not.

Quite a long story, but see discussions in PR 268652 for details.
 
Ok I believe I found the issue. Launching directly the VM ( virtualboxvm VM-NAME) I was able to start and the VM works just fine.

I'm not familiar with virtualbox, how do you start it usually?

I did an experiment and tried to run a qt application from a userid that was not allowed to use the current display (both ${DISPLAY} env variable missing and not allowed via xhost):

# lldb keepassxc
(lldb) target create "keepassxc"
Current executable set to '/usr/local/bin/keepassxc' (x86_64).
(lldb) r
Process 19893 launched: '/usr/local/bin/keepassxc' (x86_64)
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: bsdfb, minimal, offscreen, vnc, xcb.

Process 19893 stopped
* thread #1, name = 'keepassxc', stop reason = signal SIGABRT
frame #0: 0x00000b37d6ed601a libc.so.7`__sys_thr_kill at thr_kill.S:4
1 /* @generated by libc/sys/Makefile.inc */
2 #include "compat.h"
3 #include "SYS.h"
-> 4 RSYSCALL(thr_kill)
5 .section .note.GNU-stack,"",%progbits
(lldb) bt
* thread #1, name = 'keepassxc', stop reason = signal SIGABRT
* frame #0: 0x00000b37d6ed601a libc.so.7`__sys_thr_kill at thr_kill.S:4
frame #1: 0x00000b37d6e4ea64 libc.so.7`__raise(s=6) at raise.c:50:10
frame #2: 0x00000b37d6f02a59 libc.so.7`abort at abort.c:64:8
frame #3: 0x00000b37d4c6f4dc libQt5Core.so.5`QMessageLogger::fatal(char const*, ...) const + 206
frame #4: 0x00000b37d11dbef7 libQt5Gui.so.5`QGuiApplicationPrivate::createPlatformIntegration() + 6695
frame #5: 0x00000b37d11dbf20 libQt5Gui.so.5`QGuiApplicationPrivate::createEventDispatcher() + 32
frame #6: 0x00000b37d4e2b3f5 libQt5Core.so.5`QCoreApplicationPrivate::init() + 1381
frame #7: 0x00000b37d11d655a libQt5Gui.so.5`QGuiApplicationPrivate::init() + 42
frame #8: 0x00000b37cfe94c2e libQt5Widgets.so.5`QApplicationPrivate::init() + 14
frame #9: 0x00000b2fa92e930f keepassxc`___lldb_unnamed_symbol7487 + 47
frame #10: 0x00000b2fa92417ed keepassxc`___lldb_unnamed_symbol5266 + 1325
frame #11: 0x00000b37d6e22e34 libc.so.7`__libc_start1(argc=1, argv=0x00000b37c99113a0, env=0x00000b37c99113b0, cleanup=<unavailable>, mainX=(keepassxc`___lldb_unnamed_symbol5266)) at libc_start1.c:157:7
frame #12: 0x00000b2fa924123d keepassxc`_start + 45

so when you start virtualbox the usual way, will it end up executing code as a different user?
maybe that xcb specific error is a red herring and simply means that the qt initialization has failed for probably an unrelated reason.

fmc000 I wish you a speedy and full recovery. hoping you feel good as new really soon
 
2025Q3 is the current quarterly and I cannot see 2025Q4 yet both on official cgit and official github readonly mirror.
Right, miscounted. Still, a new quarterly should get here soon.
 
Problem on LibreOffice (qt.qpa.plugin error) smells like what happened when Qt5 was the default. Do you have anything Qt-related libraries under /usr/local/lib/compat/pkg/ (including subdirectories)?

If so, try moving them into different directory which shared objects (libraries) are NOT AT ALL looked for and see it helps or not.

Quite a long story, but see discussions in PR 268652 for details.
Awesome suggestion!

I had more than a hundred libQt6* files there, I moved to a temp directory and now both Libreoffice and Virtualbox start just fine. So my question is: there are a ton of other files there, for example 105 libKF6* and some other libs. What should I do with those? And, more important, why are they kept there if they are useless at best and harmful sometimes?
 
Awesome suggestion!

I had more than a hundred libQt6* files there, I moved to a temp directory and now both Libreoffice and Virtualbox start just fine. So my question is: there are a ton of other files there, for example 105 libKF6* and some other libs. What should I do with those? And, more important, why are they kept there if they are useless at best and harmful sometimes?
If trying to move everything remaining into somewhere like in this time and still everything works fine, you don't need to restore anything.
If some stops working correctly, seek for what's missed and restore them only.

The directory historically exists for backing up old libraries by ports-mgmt/portupgrade, if I recall correctly, when even ports-mgmt category still NOT YET existed.

At the era, all (at least almost all) ports installed their libraries direct under /usr/local/lib/, and /usr/local/lib/compat/pkg/ was looked for only when the specific libraries are NOT found, thus, both already-rebuilt consumers use latest one and anything not yet used backup (only when library file name is changed like foo.so.x.y to foo.so.x.y+1).

This allowed sane on-the-fly upgrades (almost) without hurting anything needed. It was just like a dream, as, as far as I know, portupgrade was the exactly first tool to manage upgrading ports.

And as time passes by, now a plenty of ports / pkgs started installing their own libraries into their own subdirectories under /usr/local/lib, and things become confusing. Not all (almost all!) subdirectories are looked for AFTER /usr/local/lib/compat/pkg/, thus, sometimes it hurts.
 
I'm marking the thread as SOLVED and I confirm that after getting rid of all that crud the Virtualbox about page now reads:

Code:
VirtualBox Graphical User Interface Version 7.2.0 r170228
© 2004-2025 Oracle and/or its affiliates (Qt6.9.2 on xcb)
Copyright © 2025 Oracle and/or its affiliates.

whilst Libreoffice's now reads:

Code:
Version: 25.8.1.1 (X86_64) / LibreOffice Community
Build ID: 580(Build:1)
CPU threads: 8; OS: FreeBSD 14.3; UI render: default; VCL: qt6 (cairo+xcb)
Locale: en-US (C.UTF-8); UI: en-US
Calc: threaded
 
Back
Top