I am trying to run xserver on a read-only raspbian. I get the following errors.

root@ClientX:/var/log# startx
xauth:  error in locking authority file /root/.Xauthority
xauth:  error in locking authority file /root/.Xauthority

Fatal server error:
(EE) Cannot move old log file "/var/log/Xorg.0.log" to "/var/log/Xorg.0.log.old"
Please consult the The X.Org Foundation support 
     at http://wiki.x.org
 for help. 
xinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: server error
xauth:  error in locking authority file /root/.Xauthority

So I tried to solve one problem at a time, but didn't get too far. First, I tried linking the .Xauthority file to /tmp which is mounted on tmpfs and it's writable.

root@ClientX:~# ls -la
total 28
drwx------  3 root root 4096 Oct 27 07:52 .
drwxr-xr-x 21 root root 4096 Jan  1  1970 ..
lrwxrwxrwx  1 root root   16 Oct 27 07:52 .Xauthority -> /tmp/.Xauthority

I tested it by writing to .Xauthority "echo hello > .Xauthority" and it's writable. But still, when root tries to startx, it still complains for not being able to lock .Xauthority.

I also found this in /usr/bin/startx and changed it to point to /tmp, but no luck either.

if [ x"$enable_xauth" = x1 ] ; then
    if [ x"$XAUTHORITY" = x ]; then
        export XAUTHORITY

And I also tried setting the XAUTHORITY variable in /etc/rc.local, in ~/.profile and in /etc/environment but it didn't work either.

And I didn't even get started on the second problem yet

Cannot move old log file "/var/log/Xorg.0.log" to "/var/log/Xorg.0.log.old"

I tried finding the xorg configuration file and see if there's an option to write .Xauthority and log files to another path, so I can put them in /tmp, but I read that xorg.conf doesn't exist any more.

Any suggestions on how to run xserver on a read-only raspbian?

  • The proper way to solve this is to create a writable AUFS overlay residing in RAM, but AFAIK AUFS is not supported by Raspbian. Oct 27 '16 at 11:17
  • how about a workaround?
    – aristosv
    Oct 27 '16 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.