X server isn't properly starting with startx, ends in error

Nigh Knight

New Member
Joined
Feb 20, 2022
Messages
5
Reaction score
1
Credits
50
I use Arch btw

Background

I restarted i3 using it's default restart command mod+shift+r, and suddenly I was existed out of my current session.

Attempts

I decided to run startx, to restart X, nothing. I decide to open use xinit to start the display, using xinit -- :1, nothing. I decided to update my system, nothing. I tried using an older version of xinit, nothing. I decided to reinstall all xorg related packages and remove my configs and reinstall my display driver, that's xf86-video-amdgpu, but still, to no avail, it doesn't start.

Once in while sudo startxmight allow me to start a session, but it would be in root, I wouldn't have my usual config, it would use the default config in /etc/i3/config, also while in i3 I would be able to exist with the default command. I tried to solve config file issue by using i3 -c [absolute path of i3 config] In my xinitrx, but it wouldn't start with sudo startx

If only I could find a way to start i3 using my normal config file I might have access to my desktop and make finding a solution more easier.

Files

Logs / std error


startx | xorg.log

sudo startx | xorg.log

xinit | xorg.log

sudo xinit | xorg.log

i3 error message after killing with pkill

config files

xinitrc

xserverrc
 


Try installing xorg-xauth
 
Is Arch systemd? Do you want X to auto start when you login?

systemctl set-default graphical.target
 
Is Arch systemd? Do you want X to auto start when you login?

systemctl set-default graphical.target
No what I'm attempting to do is solve my problem not being able to start the x server without using sudo. Using sudo causes i3, my window manager, to use the root config.
 
I wasn't able to access all your logs and links. One was a "404-Not Found", one was a "syntax error". The Xorg log files I could see only show one error showing a failure to load the "ati" driver, but that's irrelevant because the amdgpu driver was loaded. I guess then that the logs were of successful root running X but I can't say. The .xinitrc in your link carries a lot of script. I would suggest that you try to get X up as a user with much simpler configs to see if it will run, a sort of "proof of concept" approach. So, I suggest you do this:
1. write .xinitrc like this:
Code:
#!/bin/sh
exec xterm
If you don't have xterm, you can use another xterminal. The point is to see if you can get one program up in X.

2. Boot up to a text prompt and log in as user. The terminal should be "tty1" which you can check with the command: tty.
3. Run xinit telling it specifically what to do:
Code:
xinit /home/<user>/.xinitrc -- /usr/bin/X :0 vt1
where <user> is replaced by the correct username entry. If successful, this will bring up X and give you a single xterm. I noticed in your xinit command in the original post that you were directing X to ":1" which is a second screen whereas ":0" is the first screen which I would have thought is the one you would want to appear.

If the xterm, or xterminal you choose gets up, you can try and start the i3 window manager in that with the command: i3 &, or something like that.

If this doesn't work, you can check the Xorg log file, but it's about all I can offer at this point.
 
Last edited by a moderator:
No what I'm attempting to do is solve my problem not being able to start the x server without using sudo. Using sudo causes i3, my window manager, to use the root config.

Then why not just use the systemd process?
 
I wasn't able to access all your logs and links. One was a "404-Not Found", one was a "syntax error". The Xorg log files I could see only show one error showing a failure to load the "ati" driver, but that's irrelevant because the amdgpu driver was loaded. I guess then that the logs were of successful root running X but I can't say. The .xinitrc in your link carries a lot of script. I would suggest that you try to get X up as a user with much simpler configs to see if it will run, a sort of "proof of concept" approach. So, I suggest you do this:
1. write .xinitrc like this:
Code:
#!/bin/sh
exec xterm
If you don't have xterm, you can use another xterminal. The point is to see if you can get one program up in X.

2. Boot up to a text prompt and log in as user. The terminal should be "tty1" which you can check with the command: tty.
3. Run xinit telling it specifically what to do:
Code:
xinit /home/<user>/.xinitrc -- /usr/bin/X :0 vt1
where <user> is replaced by the correct username entry. If successful, this will bring up X and give you a single xterm. I noticed in your xinit command in the original post that you were directing X to ":1" which is a second screen whereas ":0" is the first screen which I would have thought is the one you would want to appear.

If the xterm, or xterminal you choose gets up, you can try and start the i3 window manager in that with the command: i3 &, or something like that.

If this doesn't work, you can check the Xorg log file, but it's about all I can offer at this point.
Thank you for suggesting this, I can't believe I didn't think of isolating the problem like you suggested. Your suggestion showed two things, one being, my X server was starting properly and that my xinitrc wasn't the problem, two, i3-gaps, my window manager, was the cause of my problems.

But with this new insight comes a new problem: where does the i3-gaps error originate from and why does it happen?
 
Last edited:
Thanks for getting back on the original issue. On the i3-gaps, I cannot help since I have no experience with it. I note that it has a github home which shows that it's had quite a bit of coding happening over the last 6 months. The first thing I'd look at are any error messages in any of the logs, like in /var/log/syslog, or using journalctl, or what appears in the xterminal when trying to start it. Does it have any of its own logs? Perhaps if you can't get it up, and your experience can be reliably reproduced, hopefully with error messages or the like, you could consider submitting a bug.
 
If I remember correctly when I was still running i3wm I used ~/.zshrc to startX and used ~/.xinitrc to i3wm. This is how I usually did it.
1. cp /etc/X11/xinitrc ~/.xinitrc
2. I would then remove the last five lines of ~/.xinitrc which are these
Code:
twm &
xclock -geometry 50x50-1+1 &
xterm -geometry 80x50+494+51 &
xterm -geometry 80x20+494-0 &
exec xterm -geometry 80x66+0+0 -name login
And add this line.
Code:
exec i3
Then in ~/.zshrc I would add the following lines but you can do that in ~/.bashrc as well.
Code:
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
exec startx
fi
 

Staff online

Members online


Top