You are not logged in.

#1 2014-08-04 21:08:31

drautb
Member
Registered: 2014-08-04
Posts: 13

[SOLVED] Unable to startx as user

Hey all,

I just installed Arch for the first time this weekend, and I'm trying to get to where I can run X reliably. Here's where I'm at:

When I login as root, and run startx, it works as expected. It launches xterm with three little windows, my mouse works, everything seems fine.
The output is: http://pastie.org/private/0ej2tfss5p0tdjtaqdzhhq
And /var/log/Xorg.0.log: http://pastie.org/private/wrulq3tbf9kmnshtrotsg

When I login as my user and then run it, it doesn't work. The screen flickers, and then X crashes before I see anything. Redirecting the output to a file isn't working, and hoarks my terminal, so here's the only output line that looks interesting:

xf86EnableIOPorts: failed to set IOPL for I/O (Operation not permitted)

And ~/.local/share/xorg/Xorg.0.log: http://pastie.org/private/0aacsqquwojcruobulrsow

It seems like a permissions issue, but I don't want to just start messing around without understanding a bit better. Also, I am able to adjust the backlight manually with calls to setpci. Trying to run xrandr with any parameters just yields 'Can't open display'. (Regardless of user)

/etc/X11/xorg.conf: http://pastie.org/private/bmwjdjsm20hccyp8asixsa

I'm on a Lenovo IdeaPad that I picked up at a garage sale, it was running Windows XP just fine previously. Output of lspci -k: http://pastie.org/private/blqm5eannk0wyie84wyma

I've run pacman -Syu today, everything is up to date. I installed the intel video driver, as recommended in the wiki. I've tried a few different things that I've found in similar posts, but nothing has worked. I haven't been able to find anyone else with the exact same problem.

I tried to do as much as I knew how on my own, and I'm feeling stuck now. Has anyone seen this before?

Last edited by drautb (2014-08-06 03:04:06)

Offline

#2 2014-08-04 22:52:13

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

Have you tried without /etc/X11/xorg.conf ?


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#3 2014-08-04 22:58:58

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,226
Website

Re: [SOLVED] Unable to startx as user

Welcome to the forums - great first post by the way (logs, and relevant info presented).

I second rebootl's recommendation.  Xorg.conf files are generally not needed in arch, and they can as often cause problems as they would solve them.  There are some cases where they are helpful or even needed, but always try to start clean and only add what you absolutely need.

As an additional workaround, this is almost certainly not due to the recent change in Xorg being run as a non-root user now, but that change might provide both a workaround and a way of getting another data point given that running startx as root works.  If you follow `man Xorg.wrap` it may avoid the issue as the Xserver will run as root (but you'll be logged in as a regular user).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2014-08-04 23:41:00

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

Thanks, Trilby and rebootl, that's one piece of info that I forgot to mention. Intially, I wasn't using an xorg.conf file. The same error occurred, only it was using acpi0_backlight instead of intel_backlight. I thought that was the problem, and that if it tried to use intel_backlight, it would succeed. I grabbed the example xorg.conf, and then specified the intel_backlight, hoping it would fix it. Obviously, it didn't.

I'll try again without xorg.conf, just to double check. If that doesn't change anything, I'll look into the Xorg.wrap suggestion and report the results. Thanks for the help!

Offline

#5 2014-08-05 01:48:33

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

Ok, removing xorg.conf didn't change anything, so I tried running Xorg.wrap. It still fails, but now the error is this:

xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory)

Full output: http://pastie.org/private/xclmwmr4petbohyfmekmtq#96

I'm still googling that error, trying to understand why that would happen. If you recognize it though, I'll take any pointers. Thanks!

Offline

#6 2014-08-05 04:41:34

basica
Member
From: Australia
Registered: 2012-10-31
Posts: 217

Re: [SOLVED] Unable to startx as user

Are you using a custom kernel? I've had a look online regarding your error and it can be caused by hardening kernel security. Another thing to check is the permissions of xorg to see if setuid is working. Another thing to try is using a DM and seeing if that works as that would also indicate a permission issue. From my look at the forums, running chmod u+s on /usr/bin/xorg seems to do the trick for both errors you've pointed out (which resolves the setuid issue). Before changing the permissions though, run a ls -l on the file to show us the current permissions.

Last edited by basica (2014-08-05 04:43:00)

Offline

#7 2014-08-05 11:24:07

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

You said you tried "running" Xorg.wrap but did you also set up /etc/X11/Xwrapper.config? Look at "man Xorg.wrap".


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#8 2014-08-05 12:09:39

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

You said you tried "running" Xorg.wrap but did you also set up /etc/X11/Xwrapper.config? Look at "man Xorg.wrap".

The man page said that the wrapper file could be used to override options, but not that it was required, so I didn't set one up initially. When you asked about it, I tried setting one up that just specifies 'anybody' for the 'allowed_users' key. The error remained.

Are you using a custom kernel?

I shouldn't be...I just used the latest .iso and installed the base system, plus the video driver, X, etc.

Another thing to try is using a DM and seeing if that works as that would also indicate a permission issue.

I wasn't planning on installing a DM, but I'll try it and see if it works and then post a report.

From my look at the forums, running chmod u+s on /usr/bin/xorg seems to do the trick for both errors you've pointed out (which resolves the setuid issue). Before changing the permissions though, run a ls -l on the file to show us the current permissions.

Output of ls -l /usr/bin/X*: https://gist.github.com/drautb/7a76081005e49fec91d6

Then I ran chmod u+s /usr/bin/Xorg. New ls output: https://gist.github.com/drautb/22f70334899d93266655

The error remained, so I tried it again after chmod u+s /usr/bin/Xorg.bin too. https://gist.github.com/drautb/190b2ca26b98e8151a19

The screen goes dark. I tried Ctrl+alt+bkspc, and a couple of other shortcuts, but the screen stays dark. I end up just rebooting.

I noticed another distinction that I hadn't mentioned yet: startx works only if I actually login to the system as root. If I login as my user, and then do sudo startx, I get the blank screen too.

Last edited by drautb (2014-08-05 12:13:30)

Offline

#9 2014-08-05 12:13:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,226
Website

Re: [SOLVED] Unable to startx as user

drautb wrote:

The man page said that the wrapper file could be used to override options, but not that it was required, so I didn't set one up initially. When you asked about it, I tried setting one up that just specifies 'anybody' for the 'allowed_users' key. The error remained.

That's only one of the two entries - and not the important one.  If you are going to configure Xorg.wrap to run X the old way you need to set needs_root_rights = yes.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2014-08-05 12:30:45

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

Ok, thanks for clarifying that. I added needs_root_rights = yes to the config, but the error remained. I tried repeating the steps I followed to change the permissions on the binaries as well, the results were the same.

/etc/X11/Xwrapper.config

Last edited by drautb (2014-08-05 12:38:29)

Offline

#11 2014-08-05 12:48:05

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

As for the chmods you did, I don't think that's how it should be now.

Neither Xorg, nor Xorg.bin should have the suid bit (chmod u+s) set. But instead Xorg.wrap should have it:

# ls -l /usr/bin/Xorg*
-rwxr-xr-x 1 root root     277 Jul 31 13:54 /usr/bin/Xorg
-rwxr-xr-x 1 root root 2245256 Jul 31 13:54 /usr/bin/Xorg.bin
-rwsr-xr-x 1 root root   10504 Jul 31 13:54 /usr/bin/Xorg.wrap

I don't understand why it wasn't set up like this, on your system, in the first place...
Could you try it with these above rights.

Last edited by rebootl (2014-08-05 13:00:52)


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#12 2014-08-05 12:55:12

SiroccoFr
Member
Registered: 2013-11-04
Posts: 3

Re: [SOLVED] Unable to startx as user

I had about the same issue.
I solved this issue just by installing xf86-video-modesetting

Offline

#13 2014-08-05 13:31:18

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

rebootl wrote:

I don't understand why it wasn't set up like this, on your system, in the first place...

It may have been, one of the posts I found before posting here was this one, which also suggests changing the permissions on Xorg.  I probably changed it when I found that, and then reset all three to 755 when it didn't work.

Setting the rights the way you specified yields a blank screen, it looks like it's still a permissions issue?/var/log/Xorg.0.log

SiroccoFr wrote:

I had about the same issue.
I solved this issue just by installing xf86-video-modesetting

I didn't have this package installed, however installing it doesn't appear to change anything. I still get the dark blank screen when I use Xorg.wrap, and startx still fails with the /dev/tty0 error.

Offline

#14 2014-08-05 13:57:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,226
Website

Re: [SOLVED] Unable to startx as user

drautb wrote:

one of the posts I found before posting here was this one

Oh Jesus ... Good work on searching for previous relevant threads - but always check the date.  That was over 6 years ago none of that is relevant now and reading it I suspect that was a foolish idea back then too, but it's hard to say, maybe that was reasonable at the time.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#15 2014-08-05 14:27:45

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

At the risk of repeating myself, have you tried without /etc/X11/xorg.conf this time ?

Edit: (Not sure if this wording can be taken as, but no offense meant.)

Last edited by rebootl (2014-08-05 14:39:38)


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#16 2014-08-05 14:48:20

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

rebootl wrote:

At the risk of repeating myself, have you tried without /etc/X11/xorg.conf this time ?
Edit: (Not sure if this wording can be taken as, but no offense meant.)

None perceived, none taken. smile I hadn't tried it without xorg.conf yet. Just now I tried it, and the result was almost the same. With xorg.conf, the screen goes totally black. It looks like the display turns off, but I can't get it back on. Without xorg.conf, the display stays on, but it's still black, with a single underscore in the upper-left corner. (Not blinking, just static.)

Offline

#17 2014-08-05 15:12:48

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

Please post a log of this try as well.

But I start running out of ideas... btw. thanks to basica for the hint towards permissions.


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#18 2014-08-05 15:20:25

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

No xorg.conf, chmod u+s on /usr/bin/Xorg.wrap, ran Xorg.wrap on terminal. Black screen with single underscore in upper-left corner.

/var/log/Xorg.0.log

Thanks for everyone's help so far!

Last edited by drautb (2014-08-05 15:20:45)

Offline

#19 2014-08-05 18:35:13

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

Ok, it's really guessing and I fear it won't help but I think you didn't try this config without the xf86-video-modesetting driver. Or then this config with only the xf86-video-modesetting, without xf86-video-intel. In case you try it i'd use 'pacman -Rns ...' to remove the respective one.

Do you have failed units 'systemctl --failed' ?

Maybe the output of 'loginctl' and 'systemctl status'. I can't really do much with them, exept comparing to mine, but maybe someone can...


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#20 2014-08-05 19:23:23

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

Ok, I tried again with just xf86-video-modesetting installed, (no xf86-video-intel) and then again with just xf86-video-intel. (No xf86-video-modesetting) It didn't seem to change anything, the critical error is still the same.

systemctl --failed didn't list anything.

systemctl status

loginctl

Do you think this is the kind of thing that might get fixed by a clean install? Or does it smell more like a driver/hardware issue? (Or something else?)

Offline

#21 2014-08-05 19:55:22

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

Above you said you "ran Xorg.wrap" what does that mean exactly? If you did not try to run 'startx' without arguments.

Other than that the ..ctl outputs look fine to me...

Do you think this is the kind of thing that might get fixed by a clean install?

To me, not necessarily, but it's hard to tell.


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#22 2014-08-05 20:00:49

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

I did this:

# Xorg.wrap

Since you're asking that question...I'm guessing I'm doing it wrong. *blush*

Should I still be using startx, and the wrap happens implicitly based on my Xwrapper.config?

Offline

#23 2014-08-05 20:13:03

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

Should I still be using startx, and the wrap happens implicitly based on my Xwrapper.config?

Yes. Xorg.wrap will be called automatically by Xorg (which is just a shell script now) which will be called by startx LOL smile, but I don't know if that solves the problem here.

Please try with 'startx' without arguments.

Edit: Forgot to mention Xorg.wrap will then finally call - Xorg.bin. And of course there's a symlink in between from X to Xorg, so yeah, it's extremely ridiculous big_smile.

Last edited by rebootl (2014-08-05 20:25:19)


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

#24 2014-08-05 20:25:05

drautb
Member
Registered: 2014-08-04
Posts: 13

Re: [SOLVED] Unable to startx as user

LOL is right, sorry about that. smile I just tried startx with and without my xorg.conf file. The errors have gone away, but X still terminates prematurely...I'm not sure why.

Xorg.0.log (No xorg.conf)

Xorg.0.log (With xorg.conf)

Here's the shell output when I ran startx with xorg.conf: https://gist.github.com/drautb/d0f736ee259a232f0717

It's pretty much the same without xorg.conf, the config file line disappears. Sorry again for the Xorg.wrap confusion, thanks for being patient with me. smile

Offline

#25 2014-08-05 20:45:58

rebootl
Member
Registered: 2012-01-10
Posts: 431
Website

Re: [SOLVED] Unable to startx as user

That looks quite good, I think we're almost there...

Do you have a ~/.xinitrc ? If yes what's in there ?
https://wiki.archlinux.org/index.php/Startx


Personal website: reboot.li
GitHub: github.com/rebootl

Offline

Board footer

Powered by FluxBB