vbox XFCE4 does not launch on FreeBSD Virtualbox guest

bugzeo

Member

Reaction score: 20
Messages: 99

I've installed xfce4 with desktop-installer and rebooted, using SLiM. I enter the user and password and nothing happens, it just stays there.
I had installed tools with "pkg install emulators/virtualbox-ose-additions" and add to /etc/rc.conf these:
vboxguest_enable="YES"
vboxservice_enable="YES"

ATajSOT.png


qIlWas6.png
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

I added ". /usr/local/etc/xdg/xfce4/xinitrc" to ~/.xinitrc and dbus_enable="YES" was already set, however SLiM keeps auto-loading on startup. I have to manually hit Host key + F1, then login with user account then startx to enter xfce4. Any idea how to fix it?
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

It's still not working, with the difference that now I see a black bar at the top after the login.

YAxf0v2.png
 

CuatroTorres

Active Member

Reaction score: 79
Messages: 147

Try chmod +x ~/.xinitrc or wait for other answers. Meanwhile check /var/log.
Or try F1 to select desktop session from Slim.
 

Aeterna

Member

Reaction score: 30
Messages: 99

this worked for me:
1) install slim-themes
2) edit slim.conf and change theme to fbsd
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

In any case I find it weird that such configuration has to be on home folder for each user. What happens if I create a new user, it has to be reconfigured each time for each one?
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

Finally performed a fresh install and got it working. Just followed this guide point by point and worked like a charm:
How To Install FreeBSD 13 with XFCE 4 [2021]

Also disabled sendmail on boot:
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

Finally fond where the problem is: it's due to "emulators/virtualbox-ose-additions". After following the steps now I get again the black bar:
Installing FreeBSD with VirtualBox

su
pkg install -y emulators/virtualbox-ose-additions
sysrc vboxguest_enable=yes
sysrc vboxservice_enable=yes


Disabling the vbox services I can enter again XFCE4 (no need to uninstall the additions):
su
sysrc vboxguest_enable=no
sysrc vboxservice_enable=no
 

Emrion

Aspiring Daemon

Reaction score: 248
Messages: 710

If you need the functionalities provided by the virtualbox additions, try to install virtualbox-ose-additions-legacy instead.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,915
Messages: 40,663

I've created /etc/slim.conf to add the line "current_theme fbsd" and no changes.
Remove it, it doesn't belong there. It's /usr/local/etc/slim.conf. And the theme has no influence on the way SLiM works, just how it looks.

For SLiM to work properly you need an ~/.xinitrc like this:
Code:
[ -n "$1" ] && [ -x "$1" ] && exec "$1"
At the login screen press F1 to select the proper window or desktop manager. Then enter your login.

What happens if I create a new user, it has to be reconfigured each time for each one?
You can create a so-called 'skeleton' file in /usr/share/skel. Those files are used to initialize a new home directory.
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

If you need the functionalities provided by the virtualbox additions, try to install virtualbox-ose-additions-legacy instead.
Thank you very much, now shared clipboard works perfectly fine between host and guest!!!! What's remaining is to get guest auto-resize (View --> Auto-resize Guest Display). Any clues on this?

Remove it, it doesn't belong there. It's /usr/local/etc/slim.conf. And the theme has no influence on the way SLiM works, just how it looks.

For SLiM to work properly you need an ~/.xinitrc like this:
Code:
[ -n "$1" ] && [ -x "$1" ] && exec "$1"
At the login screen press F1 to select the proper window or desktop manager. Then enter your login.


You can create a so-called 'skeleton' file in /usr/share/skel. Those files are used to initialize a new home directory.
Unluckily the new .xinitrc it doesn't work. SLiM is not able to enter xfce that way:

JS8ZogX.png
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,915
Messages: 40,663

What's remaining is to get guest auto-resize (View --> Auto-resize Guest Display). Any clues on this?
Make sure x11/xrandr is installed (should be included if you installed the "full" x11/xorg) and run VBoxClient --display (you can add it to ~/.xinitrc for example).

Unluckily the new .xinitrc it doesn't work.
Can you post what you have now?
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

Here are the results of some tests:
If I have this on ~/.xinitrc
Code:
exec startxfce4
Then on XFCE corner menu I have available:
  • Lock Screen
  • Shutdown
  • Log Out...
  • (Reboot is greyed out)

However if I have this:
Code:
exec startxfce4 --with-ck-launch
Then the Shut Down option is also disabled (greyed out), so I have to go to shell and su && poweroff.

Also, if in virtual machine setitngs I set Display --> Screen --> Enable 3D Acceleration, it will always set the graphics controller to VMSVGA, even changing it takes not effect and returns to VMSVGA after hitting OK. In this case guest auto-resize does not work, and xfce loads pretty fast.

However, if I disable 3D Acceleration and change from VMSVGA to either VBoxVGA or VBoxSVGA it stays, and now guest auto-resizes automatically. However xfce loads slower.
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

xrands is already installed:
Code:
# pkg install xrandr
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed

So how should look like ~/.xinitrc, like this?
Code:
VBoxClient --display
exec startxfce4
[ -n "$1" ] && [ -x "$1" ] && exec "$1"
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

Also VBoxClient is already running, having only on ~/.xinitrc the line "exec startxfce4":
Code:
# ps aux | grep -i vboxclient
freebsd     882   2.0  0.1   21172   5688  -  I    14:00   0:00.62 /usr/local/bin/VBoxClient --draganddrop
freebsd     869   0.0  0.1   16816   5060  -  Is   14:00   0:00.01 /usr/local/bin/VBoxClient --clipboard
freebsd     870   0.0  0.1   21076   5840  -  I    14:00   0:00.01 /usr/local/bin/VBoxClient --clipboard
freebsd     875   0.0  0.1   16816   5276  -  Is   14:00   0:00.01 /usr/local/bin/VBoxClient --display
freebsd     877   0.0  0.1   16816   5412  -  S    14:00   0:00.02 /usr/local/bin/VBoxClient --display
freebsd     878   0.0  0.1   16816   5312  -  Is   14:00   0:00.01 /usr/local/bin/VBoxClient --seamless
freebsd     880   0.0  0.1   21044   5580  -  I    14:00   0:00.01 /usr/local/bin/VBoxClient --seamless
freebsd     881   0.0  0.1   16816   5312  -  Is   14:00   0:00.01 /usr/local/bin/VBoxClient --draganddrop
root       999   0.0  0.1   12868   2368  0  S+   14:04   0:00.02 grep -i vboxclient

This thread helped me: Full screen not working in XFCE on a FreeBSD guest OS on VirtualBox

Also, what is the purpose of "--with-ck-launch"?
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,915
Messages: 40,663

So how should look like ~/.xinitrc, like this?
Remove that exec startxfce4 line or put that at the bottom. SLiM passes the chosen window manager or desktop environment as an argument, that's what the [ -n "$1" ] && [ -x "$1" ] && exec "$1" line does. It checks if there's an argument, then checks if that argument is an executable, then starts it.

You'll want to add the exec startxfce4 at the bottom, in case you're not using SLiM (thus no argument is passed), useful when you use startx for example.
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

If I keep the line "[ -n "$1" ] && [ -x "$1" ] && exec "$1"" I get the error on screenshot.
Also, shouldn't I install "emulators/virtualbox-ose-kmod" also?
 
OP
B

bugzeo

Member

Reaction score: 20
Messages: 99

Alright. For now FreeBSD and XFCE4 work fine to do some tests, this is more complicated than I expected and there's still a lot of work to do.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 13,915
Messages: 40,663

For SLiM to work properly you need an ~/.xinitrc like this:
Code:
[ -n "$1" ] && [ -x "$1" ] && exec "$1"
Did some tests and this is actually not correct. The -x test fails because it doesn't receive a full path to the executable, apparently it did at some point because this was directly copied from a working system. Anyway, this should work better:
Code:
[ -n "$1" ] && [ -x "/usr/local/bin/$1" ] && exec "/usr/local/bin/$1"
I am assuming every WM or DE gets started from an executable in /usr/local/bin, but I believe that's a fairly safe assumption.
 
Top