[blfs-support] startx failes to work

Bruce Dubbs bruce.dubbs at gmail.com
Sat Sep 24 00:34:33 PDT 2016


Thanos Baloukas wrote:
> On 23/09/2016 09:21 μμ, Rob wrote:
>> BLFS-7.10 Systemd
>> We're now in the section of Chapter 24 called
>> Testing Xorg
>> When I tried running
>> startx
>> I got a lot of messages, but it basically said at the end:
>> Fatal server error:
>> (EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
>> I thought adding my normal user to the
>> video
>> group would have fixed that. Was I wrong?
>> Thank you all for the help.
>>
> That possibly happens because Xorg wants to start on tty0
> while you login on another tty. If systemd is compiled with
> pam it sets the XDG_VTNR var to the tty number the login occurs,
> otherwise I think sets tty var to /dev/ttyn
>
> To force Xorg to start on the tty you are on try
>
> startx -- -vt<tty number>
>
> To make that permanent put in ~/.xserverrc
>
> #!/bin/sh
>
> exec /usr/bin/Xorg -nolisten tcp "$@" vt<$XDG_VTNR or ${tty#/dev/tty} or a
> tty number>
>
> and run plain startx

In xinit, we make a change so that Xorg starts up on the first unused 
terminal, usually vt7.  See the seds on that page.

I do not know if systemd modifies the startx script command or not, but I 
doubt it since Xorg is installed after systemd.

I have never had to modify ~/.xserverrc.  That file does not even exist on 
my systems.

Make sure the PATH is set properly so xauth is found.  On debugging 
technique is to edit /opt/xorg/bin/startx.  At the bottom is the line:

xinit "$client" $clientargs -- "$server" $display $serverargs

copy that line and on the first copy add echo to the front to see what it 
is really executing.  It may also be useful to redirect the output of that 
echo to something like /tmp/xinit.debug.  If you followed the BLFS 
instructions, the $display variable should be vt7.

The whole line will probably be something like:

xinit xterm -- /opt/xorg/bin/X vt7

Note that the screen normally comes up black in twm with some xterms.  You 
have to click the mouse sometimes to see the cursor.  Also, make sure you 
run ldconfig so libraries can be found after installation.

   -- Bruce



More information about the blfs-support mailing list