rasp87
Posts: 94
Joined: Thu Jun 27, 2013 7:02 am

problem connecting to a VNC server

Mon Aug 11, 2014 8:24 am

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.

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: problem connecting to a VNC server

Thu Aug 14, 2014 1:34 pm

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.
Unix engineer since 1989

rasp87
Posts: 94
Joined: Thu Jun 27, 2013 7:02 am

Re: problem connecting to a VNC server

Sat Aug 16, 2014 7:44 am

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).

DirkS
Posts: 10362
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: problem connecting to a VNC server

Sat Aug 16, 2014 1:33 pm

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

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: problem connecting to a VNC server

Mon Aug 18, 2014 11:11 am

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.
Unix engineer since 1989

Return to “Advanced users”