Launch Xorg in a non-interactive console

Hi,

I create this thread for the question I asked in this one.

I usually start X at boot time in this way:
Code:
#minute hour    mday    month   wday    who     command
@reboot                                 Emrion  startx

But since Xorg 1.20 this doesn't work anymore. It took me time to find any relevant log on my machine but, actually as kpedersen said, it's because now X doesn't want to be launched from a non-interactive console.

I finally found that cron tried to email me the problem and since there is no MTA configured, the log ended in my home directory in dead.letter.
/usr/local/bin/X: Only console users are allowed to run the X server
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error

I well noticed that there is another means to automatically run X: make the system to autolog a user and startx at login. But I find that less simple and elegant that the cron stuff.

I searched for days a solution but didn't find anything (except one trick from linux for linux); not even the list of options of xinit or startx...

Is anyone can point me in the right direction?
 
In Linux Xorg server honors /etc/X11/Xwrapper.config, so, the following line in that file lets it to be launched from any environment, even through SSH:
Code:
allowed_users = anybody
I'm not sure it's supported in FreeBSD ― just a thought, you can also try /usr/local/etc/X11/Xwrapper.config.
 
I found wblock@ has a nice way that worked good for me when creating a OpenBox Kiosk.
 
Thanks to both of you.
In Linux Xorg server honors /etc/X11/Xwrapper.config, so, the following line in that file lets it to be launched from any environment, even through SSH:
Code:
allowed_users = anybody
I'm not sure it's supported in FreeBSD ― just a thought, you can also try /usr/local/etc/X11/Xwrapper.config.
This is the linux thing I mentionned. I didn't even try because, as far as I know (but I may be wrong), there is no X wrapper anymore in FreeBSD. See x11/wrapper.

I found wblock@ has a nice way that worked good for me when creating a OpenBox Kiosk.
And that is the means I was alluding to automatically run X. If I don't find another method, I'll try this.

I'd like to find an option on startx command line for example or something like that.
 
You might also want to consider a (simple-ish) display manager like SLIM? That has auto login I believe.

I know the OpenBSD guys put an auto login facility into XDM (because they have outlawed the use of startx).
I would really love to see the upstream XDM get an auto login. I wonder how likely that would be.
 
You might also want to consider a (simple-ish) display manager like SLIM? That has auto login I believe.

I know the OpenBSD guys put an auto login facility into XDM (because they have outlawed the use of startx).
I would really love to see the upstream XDM get an auto login. I wonder how likely that would be.
Yes. I recall long time ago, I was using GhostBSD and I activated the autologin feature on the advise of people from the forum. This may be an interresting alternative even if it needs to install an additional software.

To be clear in my goal, I ain't working on this subject because I'm too lazy to type my user name and its password. The point is that I use this desktop machine to test how I'll configure my router when I'll upgrade it. It's a FreeBSD box which do have X automatically launched at startup. This box must be 100% operational in case of power outage (well, after the said power outage) and, of course, even if I'm not there to type something in.

I ever tried to use x11vnc for another purpose but I don't see the point here. Maybe I'm missing something?
 
Emrion you should pay more attention when peoples quotes you. I've already given you the solution. You can ignore ssh-agent if you have a desktop environment which has a service/programs autostart.
 
So what is the solution to this situation? Before I would always go
Code:
startx & exit
Now it actively blocks me from doing that, even if I delay the exit command. It actually creates a loophole in the security, because you can just switch to the virtual console, kill Xorg and get full control of the system, even with a lock screen up.
 
Never mind then...

Startx seems to be on the way out. Even OpenBSD "outlawed" it.

Replaced with XDM and everything is good. Thanks to vermaden for the nice minimalist theme.
 
Hello,

I just "upgraded" to xorg-server 1.20.7 on one of my boxes and am running into:

Code:
Only console users are allowed to run the X server
when I ssh into the box and run startx.

I have tried to implement the solution from W. Block in this thread, but I'm not sure I did it correctly because it makes no difference.

I appreciate any help offered.
Thanks,
sprock
 
I ssh from box A to box B and runs startx on box B. I have box A as a synergy server and box B as a client. I can use one keyboard & mouse for both boxes. Less clutter on my desk.
 
I have now tried both slim and XDM. For the latter I tried starting is (as per the handbook) in /etc/ttys and by using the script in /usr/local/etc/rc.d. No matter which display manager I use, the screen is blank. I can see that xorg and xdm or xorg and slim are running using top.
Is there some further configuration to be done?
 
After some more testing I discovered that I could start X-windows even from a console after the change to 1.20.7. After some more testing I had to install x11-drivers/xf86-video-scfb to get X-windows to run. I can now startx from the console but neither XDM nor slim will start.
 
I had to install x11-drivers/xf86-video-scfb to get X-windows to run
Well, the scfb is not a solution. Instead, I believe, you should use the vt option, from Xorg():
Code:
vtXX    XX specifies the Virtual Terminal device number which Xorg will
               use.  Without this option, Xorg will pick the first available
               Virtual Terminal that it can locate.
Usually it's supposed to be 9 or 10. For example, I'm able to start another instance of X through ssh by running:
Code:
% X vt10 :1
 
I tried drm-kmod with hw.syscons.disable=1 as described here: https://wiki.freebsd.org/Graphics.
That just slowly painted the console grey and I could not log in - had to crash the machine (an old iMac, booting using UEFI). That is when I dumped drm-kmod & installed scfb. It works, and I have now set up slim as login manager. Unfortunately that means I need a keyboard plugged in so I can log in, just the situation I want to avoid and which was previously solved by running startx after ssh into the box. My .xinitrc then started synergy so I could use the keyboard on the box from which I ran ssh. The 'upgraded' xorg-server has screwed that up. I have been attempting to get synergy to start from an rc script, to no avail.

Thank you for the suggestion. Unfortunately...

patchperthite rmason X vt10 :1 X:
Only console users are allowed to run the X server

Drat.
 
Indeed, that works OK. However, I decided to use SDDM as that allows synergy to be available before login.

Thanks.
 
In Linux Xorg server honors /etc/X11/Xwrapper.config, so, the following line in that file lets it to be launched from any environment, even through SSH:
Code:
allowed_users = anybody
I'm not sure it's supported in FreeBSD ― just a thought, you can also try /usr/local/etc/X11/Xwrapper.config.
It's work for me. Thanks.

# touch /usr/local/etc/X11/Xwrapper.config

Add this to Xwrapper.config
allowed_users = anybody

Go back to XDM login.

The OS version is FreeBSD 13 release.

But I have a question, Why Xorg limits user to login from console?
 
Back
Top