Threlkeld
Posts: 26
Joined: Thu Jun 07, 2012 4:25 pm

suspicious ownership (not root:root)

Fri Jun 15, 2012 11:05 am

After installing SSH and VPN I find that when I set up to run 'locally' (i.e. with a keyboard, mouse and monitor instead of headless) I get the following error on entering startx
: /tmp/.X11-unix has suspicious ownership (not root:root), aborting
(there may well be a lost character at the start because the screen is out of alignment)
and the GUI fails with a message about being unable to connect to X server

I can't see any mention of this error message in the forum (apologies if I've missed it), but it comes up a lot using Google, mostly in Debian bug discussions which are way beyond me.

I don't quite see how the ownership of any file could have changed so that root access isn't possible, or am I misunderstanding the message?
I'm aware that I could easily make matters worse if I start blundering around at random. Anybody offer to guide me?

User avatar
jojopi
Posts: 3085
Joined: Tue Oct 11, 2011 8:38 pm

Re: suspicious ownership (not root:root)

Fri Jun 15, 2012 5:56 pm

Threlkeld wrote:/tmp/.X11-unix has suspicious ownership (not root:root), aborting
Background: /tmp/.X11-unix/ is the directory that contains the special socket files that X clients use to connect to a local display server. There can be multiple X servers running on a machine, and they can be running as different users. To ensure that users can create a new socket file, but cannot delete or rename other users' existing files, the containing directory needs to be owned by root (and world-writeable with the sticky bit set).

If you have rebooted since your first post it is likely that /tmp will have been cleared and startx will now work. Otherwise it is totally safe to try changing to the correct permissions and ownership yourself: "sudo chmod 1777 /tmp/.X11-unix" and "sudo chown root:root /tmp/.X11-unix". At the very least, this should change the error message that startx gives.

(My first guess as to the cause of the problem is that you may have started a VNC server as the first X server in a given boot. VNC servers do not start with root privileges because they do not need direct access to hardware. So if they have to create the .X11-unix directory they will do so with the wrong ownership.)

Threlkeld
Posts: 26
Joined: Thu Jun 07, 2012 4:25 pm

Re: suspicious ownership (not root:root)

Fri Jun 15, 2012 7:13 pm

Grateful thanks, jojopi, that's helped a lot.

I had rebooted, several times, and found that the problem persisted.

Manually resetting the permissions and ownership using the two commands you listed then enables me to run startx successfully. Great!

However, powering down and rebooting recreates the problem. Is this because I'm firing-up the VNC server as part of the boot sequence, I wonder?

Anyway, a bit of fossicking around should enable me to sort out a complete solution. Thanks again! :)

hiveda
Posts: 7
Joined: Sat Jan 21, 2012 2:26 pm

Re: suspicious ownership (not root:root)

Fri Jun 15, 2012 7:44 pm

We had the same issue today and solved it by entering jojopi's cmd's into to vncboot script (see URL for instructions about creating the script and the changed script in CODE)

http://elinux.org/RPi_VNC_Server

Code: Select all

### BEGIN INIT INFO
# Provides:          scriptname
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start VNC Server at boot time
# Description:       Start VNC Server at boot time.
### END INIT INFO

#! /bin/sh
# /etc/init.d/vncboot

USER=root
HOME=/root

export USER HOME

case "$1" in
 start)
   echo "Starting VNC Server"
   #Insert your favoured settings for a VNC session
   sudo mkdir -p /tmp/.X11-unix
        
   sudo chmod 1777 /tmp/.X11-unix
	
   sudo chown root:roo /tmp/.X11-unix 
	
   su pi -c '/usr/bin/vncserver'
	
   ;;

 stop)
   echo "Not stopping VNC Server at the moment, on the todo list"
   ;;

 *)
   echo "Usage: /etc/init.d/vncboot {start|stop}"
   exit 1
   ;;
esac

exit 0

Threlkeld
Posts: 26
Joined: Thu Jun 07, 2012 4:25 pm

Re: suspicious ownership (not root:root)

Fri Jun 15, 2012 9:02 pm

Yes, confirm that sorts out the problem for me as well. Great!
[ small typo:
sudo chown root:roo /tmp/.X11-unix
should of course be
sudo chown root:root /tmp/.X11-unix
]

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: suspicious ownership (not root:root)

Fri Jun 15, 2012 9:48 pm

Bet you roo the day you made that typo...
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Return to “Troubleshooting”