Fórum Ubuntu CZ/SK
Ubuntu pro osobní počítače => Internet a sítě => Téma založeno: Vojtha 18 Června 2009, 16:41:42
-
Ahoj,
mám problém s nastavením vzdálené plochy v ubuntu 9.04. Připojeji se z Windows na Ubuntu, na Windowsech mám TightVNC a na Ubuntu používám již předinstalovaný server (Systém → Volby → Vzdálená pracovní plocha)
Zatím mi funguje přístup jen v případě, pokud jsem na Ubuntu přihlášen, pokud je počítač pouze zapnut a žádný uživatel přihlášen není, vzdálená plocha nefunguje.
Poradíte?
Díky
-
? HEPL Pls
-
nevim jak je to presne reseno v ubuntu, ale vncserver takto funguje ..
pokud se potrebujes vzdalene pripojit je nutne po startu zapnout vncserver pro daneho uzivatele nejakym scriptem ..
ja osobne to resim tak, ze mam skript co mi zapina vncserver a pred tim, nez se tam prihlasim, ho pres ssh zapnu
-
ted sem nasel na netu neco o spousteni v /etc/rc.local, akorat sem nikde nemasel co bych tam mel napsat abych spustil prave server vzdalene plochy ... :(
-
?? tos asi nehledal poradne .. ;)
man vncserver
vncserver --help
.. pustis si poprve vncserver rucne abys nastavil heslo a nechal si vygenerovat ~/.vnc/xconfig a killnes ho,
a potom tam vlozis neco jako ..
------------------------
#!/bin/bash
su <username> -c "vncserver -geometry 1200x900 -depth 16 :99"
------------------------
potom ho budes mit na <hostname:99>
vice viz take `man Xvnc`
-
pardon jsem téměř naprostý začátečník, takže mi to na první pokus samozřejmě nefungovalo :)
Takhle teď vypadá soubor 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.
#!/bin/bash
su Vojtha -c "vncserver -geometry 1200x900 -depth 16 :99"
exit 0
-
.. napsal jsem ti skript kterym to muzes krasne ovladat.
pokud to umnistis do /etc/init.d a importujes mezi sluzby (nevim jak se to v ubuntu dela), tak by to melo normalne
fungovat jako sluzba ..
usage :: /etc/init.d/myvnc (start | stop | status)
#!/bin/bash
#
# vncserver startup script replacement
## base options, feel free to change them
user=zde nutno napsat alespon username
display=:9
dep=16
geo=800x600
otheropts=''
## rest of used options ..
su=`which su 2>/dev/null`
vncsrv=`which vncserver 2>/dev/null`
host=`hostname`
userhome=`grep ^$user\: /etc/passwd | awk -F: '{print $6}'`
uid=`grep ^$user\: /etc/passwd | awk -F: '{print $3}'`
vncpid=$userhome/.vnc/$host$display.pid
## functions
chtest() {
if test -f $vncpid; then
return 0; else
return 1
fi
};
startvnc() {
if test $UID = $uid; then
$vncsrv -depth $dep -geometry $geo $otheropts $display; else
$su $user -c "$vncsrv -depth $dep -geometry $geo $otheropts $display"
fi
};
stopvnc() {
if test $UID = $uid; then
$vncsrv -kill $display; else
$su $user -c "$vncsrv -kill $display"
fi
};
start() {
if chtest; then
echo server already running with pid `cat $vncpid`
exit 1
fi
startvnc
exit $?
};
stop() {
if chtest; then
stopvnc
exit $?
fi
echo server not running
exit 1
};
status() {
if chtest; then
echo server is already running with pid `cat $vncpid`; else
echo server is not running
fi
exit 0
};
## body till here ...
id $user &>/dev/null
if test $? != 0; then
echo bad user set in $0
exit 1
fi
if test -z "$su" || test -z $vncsrv; then
echo cant find su or vncserver, set paths manually
exit 1
fi
case $1 in
start ) start
;;
stop ) stop
;;
status ) status
;;
esac
echo 'actions: start|stop|status'
exit 1
-
díky, zkusim ;)
-
hm nějak mi to nechce je, je to na mě moc složitý, nadějnější byla ta původní jednořádková verze :-) co se vkládala etc/rc.local
-
?
-
neni ti pomoci