login error in Ubuntu 16.04 with X authority problem

I've Installed Android Studio and wpscan metasploit and LAMP Stack server on my system.

The next day when I've tried to login to my system I got that black loop page and backed to my login page.

I've searched the net and followed the instruction of:

  1. Check the `~/.Xauthority ownership and mode.
  2. Change the ownership and mode of home directory.
  3. Add a new user and try to login with that user
  4. Run this command dpkg-reconfigure lightdm
  5. Install another desktop environment like xfce4
  6. Check /etc/fstab directory for mounting all of my partitions

After every step I run startx few step ahead I've got this message

xauth: timeout in locking authority file /root/.android/avd//.Xauthority
Cannot open log file "/root/.android/avd//.local/share/xorg/xorg.1.log"

On my login page I got this message pop up:

Failed to create file'/root/.android/avd/.cache/xfce4-notify-theme.rcUYZQJY':Permission denied 

Before all of this I had deleted the /root/.android/avdand also my android studio program.

I still don't know to how to fix this problem!

1 Answer

The XAuth error you're getting is because you don't have permissions to write to that file despite it being in your /home directory.

While logged in, change the ownership of the .Xauthority file from root to you username:

sudo chown $USER:$USER ~/.Xauthority

Then it will be accessible when you want to log in. The file is overwritten every time you attempt to start X-Windows.

Also, do:

sudo apt-get install --reinstall xorg 

If your configuration files get messed up or the permissions are wrong, this will reconfigure and reset them for you in X-Windows.

Purge and reinstall Android Studio, make sure you install it to your /home directory and not root /, it has no business being there. The reason why you can't do the other stuff you want is that, since it's installed as root, you have to execute everything else as root in order to interact with your application. That's a recipe for disaster.

When you install it to the /home directory, you won't need to use sudo to get at the file, to start it.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like