vnc4server
リモート側のデスクトップは、xfce4 で表示させる。
root@moco:~# apt-get install xfce4 xfce4-goodies tightvncserver
root@moco:~# vnc4server -geometry 1024x768 -depth 24
You will require a password to access your desktops.
Password:
Verify:
Password too long - only the first 8 characters will be used //8文字以内
New 'moco:1 (root)' desktop is moco:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/moco:1.log
root@moco:~# vi .vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
xrdb $HOME/.Xresources
startxfce4 &
root@moco:~# chmod +x ~/.vnc/xstartup
root@moco:~# vi /etc/init.d/vncserver
#!/bin/bash
PATH="$PATH:/usr/bin/"
export USER="user"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost"
. /lib/lsb/init-functions
root@moco:~# chmod +x /etc/init.d/vncserver
root@moco:~# service vncserver start
root@moco:~# vncserver
New 'X' desktop is moco:2
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/moco:2.log
-------------
vnc 起動番号2になっている。
この状態で、リモートからVNC 192.168.10.13:2 アクセスで、xfce4デスクトップが開く。
root@moco:~# vncserver -kill :1
Killing Xtightvnc process ID 1660
root@moco:~# vncserver -kill :2
Killing Xtightvnc process ID 2001
*************************************
VNC自動起動設定
root@moco:~# update-rc.d vncserver defaults
update-rc.d: warning: /etc/init.d/vncserver missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
System start/stop links for /etc/init.d/vncserver already exist.
https://wiki.debian.org/LSBInitScripts
Add a block like this in the init.d script:
### BEGIN INIT INFO # Provides: scriptname # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start daemon at boot time # Description: Enable service provided by daemon. ### END INIT INFO
root@moco:~# vi /etc/init.d/vncserver
#!/bin/bash
PATH="$PATH:/usr/bin/"
export USER="user"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY} -localhost"
. /lib/lsb/init-functions
### BEGIN INIT INFO
# Provides: scriptname
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
root@moco:~# update-rc.d vncserver defaults
System start/stop links for /etc/init.d/vncserver already exist.
root@moco:~# vncserver
New 'X' desktop is moco:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/moco:1.log
---- リモートからVNC 192.168.10.13:1 アクセスで、xfce4デスクトップが開く
サーバー側のデスクトップは、elementary
root@moco:~# reboot
Broadcast message from moco@moco
(/dev/pts/2) at 18:19 ...
The system is going down for reboot NOW!
***************************
自動起動設定が有効にならない。
コマンド起動 ・・・これで我慢
root@moco:~# vncserver
New 'X' desktop is moco:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/moco:1.log
VNC 192.168.10.13:1 アクセス OK