Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
VNC Server to start at boot
View previous topic :: View next topic  
Author Message
carmine65
Junior Member


Joined: 18 Jun 2011
Posts: 19

PostPosted: Sat Jul 16, 2011 4:58 pm    Post subject: VNC Server to start at boot Reply with quote

Hi friends,

just would like to have tightvnc server to start at boot time so I can control SMS screen from another pc of my home LAN.

I put /usr/bin/vncserver in /etc/rc.d/rc.local

vncserver starts at boot but I get the following message:
vncserver: The USER environment variable is not set

(and the server isn't activated).

Tips for fixing that?

btw: if I start vncserver from a Putty terminal everything is OK, I can enter and operate a remote SMS desktop.

greetings!
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Sat Jul 16, 2011 7:06 pm    Post subject: Reply with quote

Setup you password with "vncpassword", and edit
/etc/rc.d/rc.vncservers.conf
with your users like
Code:
VNCSERVERS="10:root"

And use /etc/rc.d/rc.vncservers to start at boot
place an entry in rc.local
Code:
/etc/rc.d/rc.vncservers start


Additionally configuration for sessions in
/etc/tightvncserver.conf

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
carmine65
Junior Member


Joined: 18 Jun 2011
Posts: 19

PostPosted: Sun Jul 17, 2011 11:01 am    Post subject: Reply with quote

gerasimos_h wrote:
Setup you password with "vncpassword", and edit
/etc/rc.d/rc.vncservers.conf
with your users like
Code:
VNCSERVERS="10:root"

And use /etc/rc.d/rc.vncservers to start at boot
place an entry in rc.local
Code:
/etc/rc.d/rc.vncservers start


Additionally configuration for sessions in
/etc/tightvncserver.conf

gerasimos_h


Hi gerasimos_h

that's OK. followed your suggestions and vncserver is active now.
Only addition I did was to assign execution permission to /etc/rc.d/rc.vncservers

Greetings!
Back to top
View user's profile Send private message
Riothamus
Junior Member


Joined: 03 Jul 2013
Posts: 1

PostPosted: Wed Jul 03, 2013 10:13 pm    Post subject: Reply with quote

I'm still getting the error. and I'm not sure why. Here are my files:

Code:

/etc/rc.d/vncservers
=============
#!/bin/sh
# 20130703, ahuston - new file.
# 20130703, ahuston - added VNCSERVERS to fix "vncserver: The USER environment variable is not set" during startup

# set VNCSERVERS
set_vncservers () {
  echo -n "Setting \"VNCSERVERS\": "
  VNCSERVERS="10:root"
  echo "done."
  return 0
}

case "$1" in
  start)
     set_vncservers
     ;;
  *)
     echo "Usage: /etc/rc.d/vncservers {start}"
     exit 1
esac

exit 0

/etc/rc.local
========
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# 20130703, ahuston - added VNCSERVERS to fix "vncserver: The USER environment variable is not set" during startup
/etc/rd.d/vncservers start

exit 0
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Wed Jul 03, 2013 11:27 pm    Post subject: Reply with quote

At first is a typo
Code:
/etc/rd.d/vncservers start

and second you don't need to do that actually...
just type "vncpassword" as root and set your password...
edit /etc/rc.d/rc.vncservers.conf
make executable rc.vncservers
Code:
chmod +x /etc/rc.d/rc.vncservers

and start it with
Code:
/etc/rc.d/rc.vncservers start


gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional