2

I installed tight server in raspbian, after that when i executed command

sudo /etc/init.d/tightvncserver start

its showing error

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
A VNC server is already running as :1
Starting vncserver for pi 

the second last line says, its already running as :1.

I tried to connect with vnc but my pc says

Error message in osx

While trying to set LC_ALL using ,

export LC_ALL=en_US.UTF-8

I face following error

-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory

Kindly help me to solve the problem.

  • I think the problem here has nothing to do with locale, it has to do with trying to use Apple Screen Sharing. Apparently it is possible, but it is complicated. The recommendation from RPi is to use realvnc. See instructions here: raspberrypi.org/documentation/remote-access/vnc/mac.md – ThomasW Mar 1 '15 at 12:58
  • Yes, I just confirmed. I followed @goldilocks suggestions and I'm no longer getting the locale warnings, but I still have the vncserver problem. – ThomasW Mar 6 '15 at 15:34
2

Solving the locale error may not solve the vncserver problem, but you should solve it first in any case.

First, make sure you have locale files installed properly. There should be a /usr/share/i18n/locales directory with a long list of files in including en_US. You don't have to use that as your locale, but I'm going to in this example. If the directory doesn't exist or the file isn't there, run apt-get install locales. If it is supposedly already installed, apt-get --reinstall install locales.

Next,

sudo dpkg-reconfigure locales

You get a menu of which ones to do. Choose, e.g., en_US.UTF-8. You can choose more than one. You'll also get to choose the default.

Log in again and things should be fixed.


[This is from an earlier version of the answer that didn't use dpkg-reconfigure locales.]

Once/if that directory [/usr/share/i18n/locales] is okay you need to look at /etc/locale.gen. If it does not exist, create it containing one line:

en_US.UTF-8 UTF-8

If it does exist, look for that line. It's probably there with a # in front of it. Remove that. If it is not there, add the line. Now run locale-gen.

Now the locales are hopefully straightened out, before you run vnc:

export LC_ALL=en_US.UTF-8

And then try from the same command line. If that then works, create a file in /etc/profile.d called mine.sh (or "anything-you-want".sh) with the line above in it. This will then apply to all subsequent logins. You could put it in ~/.profile, but it should be global anyway.

  • It gives me an error saying , "-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory " – HarshIT Jan 5 '14 at 15:58
  • Okay, I've added a few paragraphs at the beginning above. – goldilocks Jan 6 '14 at 11:53
  • I'm still seeing the -bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) error message after following these instructions. – ThomasW Mar 1 '15 at 12:52
  • @ThomasW I've edited this to include dpkg-reconfigure locales, which just fixed the same problem after an upgrade to jessie and my previous more manual method did not work. – goldilocks Mar 6 '15 at 15:18
  • Do you recommend adding export LC_ALL=en_US.UTF-8 to someplace like the .bashrc file? – ThomasW Mar 6 '15 at 15:30
0

I know is too late for answer :)

From the error (as you already mentioned) vncserver is already running as :1)

You should use the port(5901) with IP Address.

(if you are using vncviewer, issue the following command)

$vncviewer <ip_address>:5901

Even when you are using other tools try using <ip_address>:port

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.