Executing xrandr command results in «Can't open display» message

FreeBSD 13.2 is installed as guest OS in Virtual box 6.1.36 (the host OS is Lubuntu 20.04).

My goal is to get LXQt running on FreeBSD. I followed the steps listed in chapters 5 and 23.4 of the FreeBSD handbook. So far, I have successfully installed Xorg and packages virtualbox-ose-additions and xf86-video-vesa. Also, in accordance with the handbook instructions I created file /usr/local/etc/X11/xord.conf.d/20-vboxvideo.conf. Here is its content:
Code:
Section "Device"
    Identifier "Card0"
    Driver     "vboxvideo"
    VendorName "InnoTek Systemberatung GmbH"
    BoardName "VirtualBox Graphics Adapter"
EndSection
Section "InputDevice"
    Identifier "Mouse0"
    Driver "vboxmouse"
EndSection

However, should I execute xrandr, it'd give me Can't open display. I tried to replace vboxvideo in the file above with vesa, but it did not have any effect.
 
You don't need 20-vboxvideo.conf either.
You have to select VBoxVGA or VBoxSVGA as graphic adapter in your VM settings.
 
You can only run this from inside a working X session.
Yes, you are right. It does work as expected if execute it in Xterm.

But then I don't get the whole picture. I have VB guest additions installed, the config file points to the proper driver. So, why the screen resolution does not automatically change after I resize the guest machine window (at least, this is how it works with Linux guests)?
 
So, why the screen resolution does not automatically change after I resize the guest machine window (at least, this is how it works with Linux guests)?
Run VBoxClient --display in your user session (add it to your ~/.xinitrc for example)
 
You could also try VBoxClient-all (there's a bunch of arguments for VBoxClient and the *-all just loads them all). Make sure you're running this from within a working X session.

Double check if vboxguest.ko is actually loaded. The packages in the repositories are still being built for 13.1, and those kernel modules might fail to load on 13.2.
 
You could also try VBoxClient-all (there's a bunch of arguments for VBoxClient and the *-all just loads them all). Make sure you're running this from within a working X session.

Double check if vboxguest.ko is actually loaded. The packages in the repositories are still being built for 13.1, and those kernel modules might fail to load on 13.2.
1) If I execute VBoxClient-all in Xterm, all I got is the message notify-send: not found.
2) If I execute VBoxClient --display in Xterm, it gives me this message: VBoxClient: VbglR3InitUser failed: VERR_FILE_NOT_FOUND. After I close the message, the screen resolution does change as expected, though (it takes all the area of the guest OS window).
1682442583816.png

3) If I execute VBoxClient --clipboard in Xterm, it has no any effect, no exchange of data between host and guest.
4) I am not sure I know how to check loaded modules on FreeBSD, but I tried command kldstat -v | grep vbox and received exactly naught.

I have an impression that something prevents guest additions from working normally. I can see two mouse cursors when mouse is captured by the guest OS. They move in sync but the mismatch of their positions is about three or four centimeters of screen...
 
This means that vboxguest.ko isn't loaded. It's not a problem of difference between 13.1 and 13.2-RELEASE because it works well for me and I'm on 13.2-RELEASE. Have you did:
sysrc vboxguest_enable="YES"
sysrc vboxservice_enable="YES"


Or modify /etc/rc.conf accordling?

If yes, try:
service vboxguest start
service vboxservice start
 
Back
Top