6

I've now run into two instances where I've received errors because the ~/.Xauthority file is required but is missing from my user folder. I have read that the .Xauthority file has been deprecated, and the function has moved to:

/var/run/gdm/auth-for-<USER>-<RANDOM_CHARACTERS>/database`

I have attempted the solution provided in How do I create the .Xauthority file?. Which suggests I make a symbolic link from $XAUTHORITY to ~/.Xauthority upon startup. But this method has has not worked for me. I've also tried running that command and variations of it in the terminal, but without success. I am running, in vmware workstation 8, a minimal install of ubuntu server 11.10 64bit with xfce4 on top.

The error, "Unable to copy the user's Xauthorization file", I've received twice now. First when attempting to open a root terminal from the Thunar context menu, using the 'custom action' feature, with the commandgksu "xfce4-terminal -default-working-directory=%f". Then again, when attempting to install truecrypt, which gives me the error a few steps into the installation process.

Is there another way to go about this? And, more fundamentally, why do applications still rely on this file if it has been deprecated? Since they do, why isn't a link provided by default until the software catches up? I understand things are not always so tidy, and also that I may be missing something important and basic, so please forgive my impudence.

2 Answers2

3

The location of the X cookie file is indicated by the XAUTHORITY environment variable. ~/.Xauthority is the default location of the X cookie file, when the variable is not present in the environment. If an application looks for ~/.Xauthority when XAUTHORITY is present, it's buggy. ln -s "$XAUTHORITY" ~/.Xauthority should work, though¹. If it doesn't work, tell us what happens: copy-paste the error message; or if you get no error message, tell us the output of ls -l "$XAUTHORITY" ~/.Xauthority.

Note that when you are running commands as root through sudo, the XAUTHORITY variable is removed from the environment. You should avoid running commands as root. For example, don't run gksu "xfce4-terminal" to run a terminal emulator as root. If you really want to run a shell as root, open an ordinary terminal, and run sudo -s inside it.

¹ Unless your home directory is shared (typically over NFS) between several Linux machines.

-2

I had the same error message when trying to launch GUI apps with gksu.

I just figured out that you can log out, then select Ubuntu on Xorg session. It will be good then.

I could open GUI programs with gksu after doing that.

I Hope this will fix your problem.