12

Recently, I switched from Ubuntu to Arch Linux. I've installed X11 as my Window System and KDE as my Desktop Environment. I've separate partition for /home, /var, / and /boot and they all mount at boot time. When I run startx, the following message gets displayed.

xauth:timeout in locking authority file /home/hello/.Xauthority

Accidently, I've deleted that file. So, I copied it from /root. I've changed it's authority using code below:

# chown hello:users ~/.Xauthority

Even after this, I'm unable to run startx unless I use root account.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Habi
  • 463
  • 3
  • 8
  • 19

3 Answers3

12

First a clarification, X is not a window manager, it is a windowing system.

Now, the ~/.Xauthority file is simply where the identification credentials for the current user's Xsession are stored, it is the file read when the system needs to determine if you have the right to use the current X session.

You should never copy an existing one from another account, the file should always belong to the user running X and is created automatically when you start a new X session. So, just delete the one you have, and then run startx again, everything should work as normal:

$ rm ~/.Xauthority; startx
terdon
  • 234,489
  • 66
  • 447
  • 667
  • Tredon, even after removing .Xauthority file. I am unable to starx. It keeps on displaying that same error. – Habi Nov 20 '13 at 13:51
  • @Habi you need to make sure there are no running X sessions, then remove the file, then run `startx` again. – terdon Nov 20 '13 at 13:57
  • Now, X runs but displays another message Call to Inusertemp failed(temporary directories full?). Check your installation. – Habi Nov 20 '13 at 13:57
  • @Habi ah, good, that's progress :). Please post another question for this since it is a completely different problem. In the new question, show us the output of `df -h` and also make sure this problem is still there after restarting. – terdon Nov 20 '13 at 14:01
5

I think an issue is that people login as root, then switch users using su -l username, which creates/spawns a subprocess under root owned by "username". X will use the .Xauthority of the top process (in this case root), which "username" does not have permission to use.

The error will be shown:

Cannot open virtual console 1 (Permission denied).

To solve this, just run login instead of su to start a new shell as a top process.

Jonathan Komar
  • 5,974
  • 7
  • 33
  • 52
0

I encountered this on a Lenovo IdeaPad with two graphic cards, one from Intel the other from Nvidia.

The error resulting from startx included this line:

addscreen/screeninit failed for driver 0 kde plasma

This was the solution:

  1. Change /etc/mkinitcpio.conf by adding MODULES=(nouveau)
  2. sudo mkinitcpio -p linux
  3. reboot
Matthias Braun
  • 7,797
  • 7
  • 45
  • 54