Page 1 of 1

problem connecting to a VNC server

Posted: Mon Aug 11, 2014 8:24 am
by rasp87
I'm trying to connect to my pi through windows with tight vnc serrver according to this:
http://elinux.org/RPi_VNC_Server

After installing and creating vncboot in /etc/init.d, I get this when the pi tries to boot:

...
[....] Starting vnc server
/etc/init.d/vncboot: 23: /etc/init.d/vncboot: /usr/bin/vncserver :0 not found
...

The server is not starting and it seems that it can't find the file. I have don this job before successfully but now I'm really confused with it.

Update: It seems that there is a problem with spaces when you copy/paste vncboot contents from above link. After retyping the space before "-geometry", now I get this:

/etc/init.d/vncboot: 24: /etc/init.d/vncboot: : not found

I don't understand this problem. However, I can connect to pi with vnc app installed on windows PC. The error exists, though.

Re: problem connecting to a VNC server

Posted: Thu Aug 14, 2014 1:34 pm
by cpc464
Hi rasp87

I am not sure how you have copied that script onto your Pi (with direct copy paste, or ftp through Windows or other method), but it contains invisible control characters that are messing you up. By retyping the space you removed one such character.

On the pi, do a "cat -v" on the file and any control chars will be displayed.

With the first error, the shell was taking the "/usr/bin/vncserver :0" all as one word, instead of a word and a separate argument. It could not find a command called "/usr/bin/vncserver<space>:0" and so failed.

Also if you did a past/save in Windows, do a "dos2unix" on the file to convert it to unix text format.

Re: problem connecting to a VNC server

Posted: Sat Aug 16, 2014 7:44 am
by rasp87
cpc464 wrote:it contains invisible control characters that are messing you up. By retyping the space you removed one such character.
On the pi, do a "cat -v" on the file and any control chars will be displayed.
Hi cpc464! Thank you very much! The problem was 3 non-breaking space characters that were messing my vncboot file up! I found them by "cat -v" that you mentioned. So, does this command turn all characters to visible? Is that his job? By the way, when I opened my file in nano, I saw that the file was effected by that command in nano either (I was seeing the non-breaking space chars in nano).

Re: problem connecting to a VNC server

Posted: Sat Aug 16, 2014 1:33 pm
by DirkS
I found them by "cat -v" that you mentioned. So, does this command turn all characters to visible? Is that his job?
You can see options with 'man cat'

Code: Select all

-v, --show-nonprinting
	      use ^ and M- notation, except for LFD and TAB

Re: problem connecting to a VNC server

Posted: Mon Aug 18, 2014 11:11 am
by cpc464
Sure, cat -v shows non printing characters, which makes it useful in this situation.

Sometimes editors like nano and vi also show them, and sometimes not. Not sure how you picked up these invisible characters (I copy/pasted the script and could not reproduce it), but can be a real pain when they get into a script.