Start xfce inside Xvfb in headless jail and show it via VNC

Hello, i am trying to get Xorg working wiht xfce in a headless jail, the idea is to connect to a VNC server for displaying xfce.
I have installed the following software: pkg install xorg xorg-vfbserver xfce x11vnc
Enabled dbus, im not sure if it is mandatory:
Code:
sysrc dbus_enable="YES"
service dbus start

With my regular user I generate a VNC password:
Code:
su axon -l
x11vnc -storepasswd
I write a xinitrc file:
Code:
vi .xinitrc
export LANG=es_ES.UTF-8
export LC_ALL=es_ES.UTF-8


setxkbmap es
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session startxfce4
Then I start Xvfb server in a console:
Code:
Xvfb :0
And in another console try to start xfce:
Code:
startx
But it seems to crash:
Code:
xauth:  file /home/axon/.serverauth.82409 does not exist

/usr/local/bin/X: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Bad file descriptor
xinit: server error
The next step would be start the VNC server when startx problem is solved:
x11vnc -usepw -display :0

But if xfce is not able to start, i cant continue, what could be wrong with my configuration?
I think that the steps are correct:
  1. - Start fake xorg server
  2. - Start WM inside fake xorg
  3. - Start VNC server to show WM of the fake xorg

Is it correct?
 
I have progressed some, i installed slim and starting xvfb, slim service and VNC i can connect to Slim output;
Code:
pkg install slim
sysrc slim_enable="YES"
service slim start

Code:
Xvfb :0
x11vnc -usepw -display :0
 
But when i login i get:
slim: get_x11_device: cannot get XFree86_VT
I have checked:
ls -la /usr/local/share/xsessions/
total 18
drwxr-xr-x 2 root wheel 3 May 27 10:46 .
drwxr-xr-x 83 root wheel 83 May 27 13:37 ..
-rw-r--r-- 1 root wheel 6832 Apr 26 12:27 xfce.desktop

Which seems ok to me.
 
I have checked slim configuration:
grep login_cmd /usr/local/etc/slim.conf|grep -v '#'
login_cmd exec /bin/sh - ~/.xinitrc %session
It seems it executes my .xinitrc file and %session:
grep Exec /usr/local/share/xsessions/xfce.desktop
Exec=startxfce4
Only to be sure that .xinitrc is executed i modify it in that way:
cat .xinitrc
date > /tmp/debug
Then i start xvfb in one console:

Start Slim in another console:
service slim start

Start VNC in another console:
x11vnc -usepw -display :0

I login vía VNC that shows Slim login, but debug file is not created:
ls -la /tmp/debug
ls: /tmp/debug: No such file or directory
It seems that .xinitrc file is not executed after all.
Any idea?
 
Back
Top