Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 16.04 (xenial) -- Xorg.wrap: Only console users are allowed to run the X server #2676

Closed
penntaylor opened this issue Jul 12, 2016 · 10 comments

Comments

@penntaylor
Copy link

name: xenial
encrypted: no
Entering /mnt/stateful_partition/crouton/chroots/xenial...
crouton: version 1-20160712144359~master:e3c0a690
release: xenial
architecture: amd64
xmethod: xorg
targets: gnome-desktop,keyboard,extension,cli-extra
host: version 8172.62.0 (Official Build) stable-channel swanky 
kernel: Linux localhost 3.10.18 #1 SMP Wed Jul 6 18:15:32 PDT 2016 x86_64 x86_64 x86_64 GNU/Linux
freon: yes

Issue Description:

Installed new xenial chroot after modifying crouton's gnome target to refer to package gnome-session-flashback rather than gnome-session-fallback. Installation succeeds, but issuing sudo startgnome yields:

Entering /mnt/stateful_partition/crouton/chroots/xenial...

/usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server
/usr/bin/xinit: giving up
/usr/bin/xinit: unable to connect to X server: Connection refused
/usr/bin/xinit: server error
Unmounting /mnt/stateful_partition/crouton/chroots/xenial...

The problem appears to be a permissions issue involving Xorg.wrapper that I don't quite understand. I can successfully get a gnome desktop going by doing

sudo enter-chroot
sudo gnome-session-wrapper gnome

That's not really a usable situation since it means the root user is logged into the desktop (!!!), but it at least shows that X and gnome are not completely broken.

Changing file execution permissions on Xorg.wrapper does not seem to change the behavior.

I believe this issue is similar to the following issue with the xserver-xorg-video-dummy package: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-dummy/+bug/1589447

@aaronrunkle
Copy link

aaronrunkle commented Jul 24, 2016

I'm seeing a similar issue under kali-rolling while doing a basic install of xiwi. I found the following to change the permissions, but I then get a different logging error afterwards.
http://karuppuswamy.com/wordpress/2010/09/26/how-to-fix-x-user-not-authorized-to-run-the-x-server-aborting/

The new error is:
Fatal server error:
(EE) The '-logfile' option cannot be used with elevated privileges.

@penntaylor
Copy link
Author

I've been successfully using a workaround for this issue for about a week with no problems so far. It's not ideal since it's effectively a return to the old way of running X as root and then running the DE and WM as the user. It does work though, and maybe someone with more knowledge or free time can use this workaround as the starting point for a better solution.

The Workaround

All of the following should happen inside the chroot.

  1. edit /etc/X11/Xwrapper.config to include the line:
    allowed_users=anybody
  2. in /etc/crouton/xserverrc-xorg, comment out the logfile option in this line:
    XARGS="$XARGS" -logfile $logfile"
    like so: (there must be a space before the #)
    XARGS="$XARGS" # -logfile $logfile"
  3. if you want to be able to use xiwi, comment out the logfile portion of the similar XARGS line in /etc/crouton/xserverrc-xiwi
  4. Create the file /home/YOUR_USERNAME/.xinitrc,and put the following in it, making the appropriate substitution for YOUR_USERNAME:
#!/bin/sh

sudo -u YOUR_USERNAME gnome-session
  1. Set execute permissions on that .xinitrc file:
    chmod a+x /home/YOUR_USERNAME/.xinitrc
  2. You should now be able to run gnome from inside the chroot by issuing:
    sudo xinit

Note: Running sudo startgnome from crosh will NOT WORK. You have to do sudo enter-chroot, then once in the chroot, sudo xinit.

@tolman42
Copy link

tolman42 commented Sep 14, 2016

Just so others know, I ran into this problem after installing forensic tools on my chromebook using kali-rolling. Using penntaylor's workaround worked, except, obviously, I put "xfce4" instead of "gnome-session." But activating the desktop still had to be done using "sudo startxfce4 -n chrootname". Trying to activate it using the other commands inside the chroot would just give me a command line inside a window instead of my desktop.

@middleagedman
Copy link

This is still an issue on Jan 28th, 2017

@mikesackett85
Copy link

This happened to me in Kali-Rolling just like toman42 just now, also after installing the full Kali system. In order to get it working I had to do step 1 from pennytaylor's steps, afterwards I was able to exit the chroot and enter the sudo startxfce4 command as normal, Xiwi is working normally again as well.

@dnschneid
Copy link
Owner

#2875, most likely (please reopen if I'm mistaken)

@namp
Copy link

namp commented Jun 7, 2017

The workaround did not work for me

As stated above I can successfully get a gnome desktop going by doing

sudo enter-chroot
sudo gnome-session-wrapper gnome

Any idea how to do something similar for xfce4?

Thanks

@scytale
Copy link

scytale commented Jun 21, 2017

Any idea how to do something similar for xfce4?

Just got the same issue with this chroot setup -r stretch -t xfce -n debian

penntaylor's workaround worked for me :-)

with only a minor comment difference:

sudo vi /etc/crouton/xserverrc-xiwi
XARGS=”-nolisten tcp -config xorg-dummy.conf” # -logfile $logfile”

and with my .xinitrc as
sudo -u YOUR_USERNAME xfce4-session

Happy, happy!! an old Samsung ARM chromebook is reborn with Debian Stretch

Thank you all

@tve
Copy link

tve commented Sep 3, 2017

Is there any fic for this in sight? I installed xenial from scratch and am running into this head-first...

@ncouture
Copy link

@tve

In scratch step #1 described here is sufficient.

It's worth noting that the default value of Xwrapper's allowed_users configuration variable is console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants