Jump to content

VNC Server Tutorial


FaNnaTyk
 Share

Recommended Posts

ATENTIE! CAND COPIEZI COMENZILE IN TERMINAL COPIEZI DOAR COMANDA FARA " > "

 

==================================== INCEPUTUL TUTORIALULUI ====================================

> apt-get update; apt-get dist-upgrade -y --force-yes
> apt-get install xubuntu-desktop xfce4 firefox nano -y --force-yes
> apt-get install vnc4server -y --force-yes
> adduser vncuser ( te va intreba de o parola -> pui o parola )
> su - vncuser
> vncpasswd ( pui o parola pana in 6 caractere)
> vncserver
> vncserver -kill :1
> cd ~
> nano .vnc/xstartup
<><><><><><><><><><><><><><><> PUI IN ACEST XSTARTUP CONTENTUL DE MAI JOS <><><><><><><><><><><><><><><>
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
<><><><><><><><><><><><><><><> APESI CTRL+O -> ENTER -> CTRL+X <><><><><><><><><><><><><><><>

> su -
> nano /etc/init.d/vncserver

<><><><><><><><><><><><><><><> PUI IN ACEST VNCSERVER CONTENTUL DE MAI JOS <><><><><><><><><><><><><><><>
#!/bin/bash
### BEGIN INIT INFO
# Provides: tightvncserver
# Required-Start: $syslog
# Required-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
#
### END INIT INFO

unset VNCSERVERARGS
VNCSERVERS=""
[ -f /etc/vncserver/vncservers.conf ] && . /etc/vncserver/vncservers.conf
prog=$"VNC server"
start() {
. /lib/lsb/init-functions
REQ_USER=$2
echo -n $"Starting $prog: "
ulimit -S -c 0 >/dev/null 2>&1
RETVAL=0
for display in ${VNCSERVERS}
do
export USER="${display##*:}"
if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
echo -n "${display} "
unset BASH_ENV ENV
DISP="${display%%:*}"
export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
su ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}"
fi
done
}
stop() {
. /lib/lsb/init-functions
REQ_USER=$2
echo -n $"Shutting down VNCServer: "
for display in ${VNCSERVERS}
do
export USER="${display##*:}"
if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then
echo -n "${display} "
unset BASH_ENV ENV
export USER="${display##*:}"
su ${USER} -c "vncserver -kill :${display%%:*}" >/dev/null 2>&1
fi
done
echo -e "\n"
echo "VNCServer Stopped"
}
case "$1" in
start)
start $@
;;
stop)
stop $@
;;
restart|reload)
stop $@
sleep 3
start $@
;;
condrestart)
if [ -f /var/lock/subsys/vncserver ]; then
stop $@
sleep 3
start $@
fi
;;
status)
status Xvnc
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
<><><><><><><><><><><><><><><> APESI CTRL+O -> ENTER -> CTRL+X <><><><><><><><><><><><><><><>

> chmod +x /etc/init.d/vncserver
> mkdir -p /etc/vncserver
> nano /etc/vncserver/vncservers.conf

<><><><><><><><><><><><><><><> PUI IN FISIERUL VNCSERVER.CONF CONTENTUL DE MAI JOS <><><><><><><><><><><><><><><>
<><><><><><><><><><><><><><><> INLOCUIESTI 1024X768 CU REZOLUTIA TA <><><><><><><><><><><><><><><>
VNCSERVERS="1:vncuser"
VNCSERVERARGS[1]="-geometry 1024x768"
<><><><><><><><><><><><><><><> APESI CTRL+O->ENTER->CTRL+X <><><><><><><><><><><><><><><>

> update-rc.d vncserver defaults 99
> reboot

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.