View previous topic :: View next topic |
Author |
Message |
carmine65 Junior Member
Joined: 18 Jun 2011 Posts: 19
|
Posted: Sat Jul 16, 2011 4:58 pm Post subject: VNC Server to start at boot |
|
|
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 |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Sat Jul 16, 2011 7:06 pm Post subject: |
|
|
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 |
|
carmine65 Junior Member
Joined: 18 Jun 2011 Posts: 19
|
Posted: Sun Jul 17, 2011 11:01 am Post subject: |
|
|
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 |
|
Riothamus Junior Member
Joined: 03 Jul 2013 Posts: 1
|
Posted: Wed Jul 03, 2013 10:13 pm Post subject: |
|
|
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 |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Wed Jul 03, 2013 11:27 pm Post subject: |
|
|
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 |
|
|