1

I primarily use my Pi2 as a low powered server and access it via SSH. However, periodically I will use VNC to access the device's desktop remotely. Historically, it has worked perfectly, but I have not logged on for a couple of months, and now I have an issue. Here is my script to start the VNC server:

/usr/bin/vncserver :0 -geometry 1920x1080 -depth 16 -dpi 96

It runs perfectly. However, when I execute this as the user "pi", I end up at a blank desktop with nothing on it but the trash can. But, if I enter the following:

sudo /usr/bin/vncserver :0 -geometry 1920x1080 -depth 16 -dpi 96

Everything works as expected which brings me to my question. My script has worked flawlessly for months and now it doesn't. It feels like there could be a permission issue here, but I have no idea where to start.

Is there something that I need to do to enable the Pi user to have a desktop? I prefer not to run VNC as root for security reasons. (I also followed the instructions here and starting it with:

 su - pi -c "/usr/bin/vncserver :0 -geometry 1920x1080 -depth 16 -dpi 96" 

results in the same problem.)

Thank you in advance for any feedback

  • That link is old, and many have haad problems with it (even under Wheezy). If you are running Jessie and want VNC to run at startup this should be started with a systemd service. See:- raspberrypi.stackexchange.com/a/39374/8697 The lack of Desktop may have nothing to do with VNC. Log on with a display and keyboard to see if the problem lies elsewhere. – Milliways May 20 '16 at 3:59
  • I have no problem logging in as the "pi" user on the desktop using a local display and a keyboard and mouse. – Jay L May 20 '16 at 16:36
0

I did find a solution to this although I am not entirely sure why it stopped working as expected. All that said, the solution was to use raspi-config to configure the desktop to run on boot. I have never done this in the past, but for whatever reason that seems to work and allows me to access an X session as the Pi user.

Perhaps someone more knowledgeable than I can clarify why this is required?

0

I'm not sure how I did it, but after git configuration git user took ownership of .config folder in pi home directory. So setting the folder ownership to pi user fixed the problem for me.

If the folder owner is not pi (or root), log in as pi user and try to run:

sudo chown -R pi:pi ~/.config/

It worked, but I was little bit impulsive. Maybe the recursion argument -R was overkill, so you can try it firstly without it.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.