Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Startup Script for VNC-server< Next Oldest | Next Newest >
thoremil Offline





Group: Members
Posts: 3
Joined: July 2006
Posted: July 12 2006,09:54 QUOTE

Hello, I am fairly new to Linux (have had Ubuntu on my laptop for like 6 months), but yesterday I decided to blow the dust off of a old 500MHz computer with 32MB memory.  I have installed DSL and the VNC-server-addon and I have this working with a password in X, but I would like for it to start up with password-verification upon bootup so that I do not have to keep the monitor/mouse/keyboard connected to get VNC up and running.  Therefore, I am kindly asking for how to create a script that will do this.  :)
Back to top
Profile PM 
Zucca Offline





Group: Members
Posts: 524
Joined: Feb. 2006
Posted: July 12 2006,10:18 QUOTE

As I said before (not blaiming you to start new topic):
Quote
In some cases must create a password file by:
Code Sample
vncpasswd <password_file>

Type a password of your choice.

Then for example if you want to run your vnc server grab your current display but have it to ask the password you chosed
Code Sample
x0vncserver -PasswordFile=<password_file>


I hope this helps...


I don't clearly remember how to start VNC server to other display... But adding line
Code Sample
x0vncserver -PasswordFile=<password_file> &
to your .bash_profile will then start automatically your VNC server for display 0.

I'll post later some more. I'm at work right now and my break is almost over.  :p


--------------
Do you have it? - http://dy.fi/mak
Back to top
Profile PM WEB ICQ MSN 
thoremil Offline





Group: Members
Posts: 3
Joined: July 2006
Posted: July 12 2006,15:07 QUOTE

Thank you for your quick reply, but I had already figured out how to get the password to work from your post about that. :)

I have figured out how to create a script now, that's a start.  I created the file startvnc in /etc/init.d/ and made it writable.  Then I started writing in the code:

##This script will start up the vnc-server upon bootup
/usr/local/bin/vnc4x.sh
xvncserver -PasswordFile=tjajaja
/usr/local/bin/vnc4x0.sh
x0vncserver -PasswordFile=tjajaja
x0vncserver -PasswordFile=tjajaja

As this is my first script, I am curious to know if this will work, I do not want to restart the box if this will not work without editing other files in /etc/init.d/ or the code is downright wrong  :laugh:
Back to top
Profile PM 
Zucca Offline





Group: Members
Posts: 524
Joined: Feb. 2006
Posted: July 12 2006,17:28 QUOTE

I'm not sure but I think your script hangs to the second line.
xvncserver will wait there until it has copleted its tasks. Propably as long as you want it to be running...

Basic bash scriptting is quite easy:
Code Sample
xvncserver
anotherprogram
Now. If I was right this script also hangs. This will hang to the first line.
Here's a way to make it run in the background:
Code Sample
xvncserver &
anotherprogram
Adding & will tell script to advance to next task and let preivious task to run 'freely'. You could always do it like this:
Code Sample
xvncserver & anotherprogram


Here's some beginner guidance to bash scripting. And
here's bit information related to this backgound thing...

I hope this helped and didn't confuse you.


--------------
Do you have it? - http://dy.fi/mak
Back to top
Profile PM WEB ICQ MSN 
clivesay Offline





Group: Guests
Posts: 935
Joined: Dec. 2003
Posted: July 12 2006,17:34 QUOTE

HERE's a link to the wiki on an old post about setting up VNC at boot.

Chris
Back to top
Profile PM MSN YIM 
6 replies since July 12 2006,09:54 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: Startup Script for VNC-server

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code