Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

On a 14.04 system I was installing VNC server with:

apt-get install vnc4server -y --force-yes

My problem is that each time I run vncserver it is locking my .Xauthority file in Home directory making the next local logon attempt to default unity desktop impossible, it is looping.

The solution is ctrlaltF1, login to the terminal and deleting the .Xauthority file, after that the login is working.

What should I do to solve this issue preventing vncserver somehow to stop locking the .Xauthority file every time?

Many thanks in advance!


share|improve this question
Can you add the exact command line that you're using to run vncserver to your post please –  steeldriver May 24 '14 at 20:36
I was mainly following this guide to set up VNC: namhuy.net/3106/install-vnc-server-ubuntu-14-04.html I am simply running it by typing 'vncserver' to terminal. However the issue might be avoided by creating a dedicated vncuser like the guide is referring to. Currently I am using my own user account for VNC. Thanks! –  user284928 May 24 '14 at 21:29
It should be fine to start it just by typing 'vncserver' from your own account - but never as sudo. Can you describe exactly what's happening to the .Xauthority file? it should just receive an updated magic cookie value for the display on which vncserver starts. –  steeldriver May 24 '14 at 22:06
Problem is solved, thanks for comments. The /home/user/.vnc directory and contents had root owner/group settings hence I had to run vncserver with sudo which changed my .Xauthority files owner/group from user to root which resulted in the login loop issue. Since this is a 14.04 system I have to use xfce4 for VNC. Gnome is a mess for VNC right now it might work but too much fiddling is not worth the time. I had it work once after a while the gnome-panel disapeared without having any modifications in the config files so I stick with xfce4 for now. Thanks again, this thread can be closed. –  user284928 May 25 '14 at 20:26
Nice - you should write that up as an answer and accept it yourself, it may help others with the same issue! –  steeldriver May 25 '14 at 22:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.