Solved VirtualBox with FreeBSD guest black screen - possible solution

Problem is:
VBoxClient --vmsvga invoked by VBoxClient-all called from .../autostart/vboxclient.desktop

move vboxclient.desktop from /usr/local/etc/xdg/autostart/ and /usr/local/share/autostart
and add
VBoxClient --clipboard , VBoxClient --draganddrop and VBoxClient --seamless to ~/.xinitrc (before exec line)

My VBox was 6.1.22, efi boot, VBoxSVGA 256 VRAM, FreeBSD 13-RELEASE, pkg latest, 1600x1200 vt console and X/Plasma/KDE worked fine with emulators/virtualbox-ose-additions-legacy (of course, services started from /etc/rc.conf)

Now, after emulators/virtualbox-ose pkg update to 6.1.26, I upgraded VirtualBox and FreeBSD guest pkgs (I also removed additions-legacy and installed additions 6.1.26)

Well, I got black screen after startx, so I ssh into FreeBSD guest, and everything seems fine, all processes are working but screen is black.

I tried to switch to cons and back (ctrl+alt+F1/F9) and it worked! I got my KDE desktop :)

So I checked what's running and VBoxClient had all options activated. That's because .../autostart/vboxclient.desktop runs Exec=/usr/local/bin/VBoxClient-all

OK, so I moved vboxclient.desktop file and everything started fine, but no clipboard and no drag and drop - so I tested from ~/.xinitrc option by option and VBoxClient --vmsvga was causing black screen.

VBoxClient-all includes --vmsvga, that's why with autostart/vboxclient.desktop there is a problem.

Now I'm having in ~/.xinitrc:

#xrandr -s 1600x1200 --dpi 100
xmodmap ~/.xmodmap
/usr/local/bin/VBoxClient --clipboard
/usr/local/bin/VBoxClient --draganddrop
/usr/local/bin/VBoxClient --seamless
exec ck-launch-session /usr/local/bin/startplasma-x11

and everything works fine :)

If Plasma screen is in lowres after first start fix resolution in KDE Display Setting and after next start it will be okay.

I hope this will help people who have black screen problem with FreeBSD guest on VirtualBox.
Last edited: