You are not logged in.

#1 2021-10-18 19:10:06

d3m0t3p
Member
Registered: 2021-10-18
Posts: 4

[SOLVED] running virtualbox under Wayland and sway

Hi,

I install arch last week with sway under wayland.

I got everything working smoothly (firefox + dev tools). But i now need to work with VMs using virtualbox.

i installed with sudo pacman -S virtualbox and choosed the second option(virtualbox-host-modules-arch):

$ virtualbox
Qt WARNING: could not connect to display
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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

zsh: abort (core dumped)  virtualbox

i tried reinstalling it as suggested
I followed Wayland#Qt  and installed qt5-wayland and qt6-wayland. i set QT_QPA_PLATFORM=wayland in my .zshrc and sourced it. i tried with QT_QPA_PLATFORM=xcb, still not

$virtualbox gives the same error.
if i run it with   

export QT_QPA_PLATFORM=wayland virtualbox

i have no error on the terminal but using dmesg i see the following line (i don't know if this is the related with the previous command or the one before)

[ 4113.174417] VirtualBox[16013]: segfault at 1500000000 ip 00007fc3b8d8d8fc sp 00007ffe4bff3b00 error 4 in libX11.so.6.4.0[7fc3b8d7e000+8a000]

I tried to reproduce the above line but couldn't.

Because of the first Qt warning, i tried to set the display. it didn't work.
Here is the list of exported environment variable from printenv related to virtualbox,

MOTD_SHOWN=pam
MOZ_ENABLE_WAYLAND=1#why does firefox works, is it related to this ?
SHLVL=2
SWAYSOCK=/run/user/1000/sway-ipc.1000.2599.sock
USER=d3m0t3p
WAYLAND_DISPLAY=wayland-1
XCURSOR_SIZE=24
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SESSION_CLASS=user
XDG_SESSION_ID=1
XDG_SESSION_TYPE=wayland
XDG_VTNR=1
_=/usr/bin/printenv
QT_QPA_PLATFORM=wayland

i tried running telegram-desktop and it runs without any problem


Do you know what might be the problem and how to fix it ?

Thx smile

Last edited by d3m0t3p (2021-10-22 20:50:11)

Offline

#2 2021-10-18 19:19:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: [SOLVED] running virtualbox under Wayland and sway

d3m0t3p wrote:

if i run it with   

export QT_QPA_PLATFORM=wayland virtualbox

i have no error on the terminal but using dmesg i see the following line ...I tried to reproduce the above line but couldn't.

As it didn't replicate, it was not likely from that command.  You said this command produced no error - but did virtual box run as expected?  If so, what's the problem: that is the ideal way to run it.  You should not need XWayland / X11 at all.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2021-10-18 19:25:13

d3m0t3p
Member
Registered: 2021-10-18
Posts: 4

Re: [SOLVED] running virtualbox under Wayland and sway

sorry, it wasn't clear,
i think it's not working : i was expeting to have a GUI pop-up with option to create a new VMs, import a new one, configure an existing one etc. nothing showed up. But as i have no configured vm i don't know if it is the expected behaviour. IMO it didn't work

On other OS the GUI shows up (mac os, ubuntu+X server).

Last edited by d3m0t3p (2021-10-18 19:26:48)

Offline

#4 2021-10-18 20:45:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,556
Website

Re: [SOLVED] running virtualbox under Wayland and sway

Oops!  Yes, as written that command will not run anything, it just exports the variable, I missed the 'export' command there.  This is what you should run (without "export"):

QT_QPA_PLATFORM=wayland virtualbox

EDIT: nevermind - I just tested and confirmed this fails too.  I suspect the problem is the virualbox script removing the relevant environment variable(s).  I had other issues with the script due to it's improper use of /bin/sh as the shebang, but that's unrelated to these issues, even fixing that, I got the same error with the binary apparently not getting the QT_QPA_PLATFORM variable.

EDIT 2: This is a known problem and it looks like wayland users are SOL, but the wiki suggest it *should* work with xcb (i.e., XWayland).

Last edited by Trilby (2021-10-18 20:59:32)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2021-10-19 07:01:40

d3m0t3p
Member
Registered: 2021-10-18
Posts: 4

Re: [SOLVED] running virtualbox under Wayland and sway

Oops, i didn't see the know problem, sorry for my poor reading skills
so i need to :

$pacman -S xorg-xwayland
...

$QT_QPA_PLATFORM=xcb virtualbox

And that should be it ?
i'll try asap. Thank you

Offline

#6 2021-10-22 20:44:33

d3m0t3p
Member
Registered: 2021-10-18
Posts: 4

Re: [SOLVED] running virtualbox under Wayland and sway

Hi,
sorry for the late response, i just tested and it still isn't working :
What i did :

sudo pacman -Syu

and

sudo pacman -S  xorg-xwayland
arch% QT_QPA_PLATFORM=xcb virtualbox
Qt WARNING: could not connect to display wayland-1
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: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

zsh: abort (core dumped)  QT_QPA_PLATFORM=xcb virtualbo

i found that to disable xwayland, i can put xwayland disable in ~/.config/sway/config
Therefore i put xwayland enable.

I think it defaults to wayland and don't use the xwayland because of these environment variables .
XDG_SESSION_TYPE=wayland and WAYLAND_DISPLAY=wayland-1


what could i try to switch to xwayland instead of wayland ?

OK, after a few reboot and a few tweaks, it works. Thanks for everything

Last edited by d3m0t3p (2021-10-22 20:48:30)

Offline

Board footer

Powered by FluxBB