[[PageOutline]] * [http://vezihgth.blogspot.com/2010/08/tightvnc-for-windows-httpvezihgth.html blog: TightVNC派生版のTurboVNCは最高だ!!] = vncserver = * [http://www.realvnc.com/products/free/4.1/man/vncserver.html vncserver(1) manual page] * [http://www.realvnc.com/products/free/4.1/man/Xvnc.html Xvnc(1) manual page] * [http://www.realvnc.com/products/free/4.1/man/vncpasswd.html vncpasswd(1) manual page] > The password must be at least six characters long, and only the first eight characters are significant. Note that the stored password is not encrypted securely * [https://www.realvnc.com/products/open/4.0/man/vncconfig.html vncconfig(1) manual page] * [http://d.hatena.ne.jp/hidepon_mory/20080422/1208862370 VNCサーバーの設定 - ひでっぷの技術メモ] * [http://www.server-world.info/query?os=Debian_6.0&p=x&f=2 Debian GNU/Linux 6.0 Squeeze - デスクトップ環境 - VNCサーバーインストール : Server World] * [http://www32.atwiki.jp/parepan/pages/113.html @鯖味噌缶 - vncserver] * [http://net-3.blogspot.jp/2012/09/vnc-vncconfig.html net3: VNC 間のクリップボード反映は vncconfig & で対応] * -nolisten * $ /usr/bin/Xvnc4 --help {{{ -nolisten string don't listen on protocol }}} * [http://www.realvnc.com/pipermail/vnc-list/2002-November/035410.html Xvnc opening port on 6001 as X server ?] > Xvnc does not start an X server, it IS an X server. == xstartup == * gnomeを自動で立ち上げる * コンソールのgnomeセッション(実機のtty)とは別に立ち上がる * ~/.vnc/xstartup {{{#!diff --- .vnc/xstartup.orig 2012-05-03 23:29:55.919559288 +0900 +++ .vnc/xstartup 2012-05-04 09:30:21.273329658 +0900 @@ -7,6 +7,7 @@ [ -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 & +# vncconfig -iconic & +# x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & +# x-window-manager & +exec gnome-session & }}} * デフォルトのxstartupは/usr/bin/vnc4server(perl script)から生成される * Ubuntu 12.04では、次のようにする必要がある * gnome-session --session=gnome-classic * [http://coddswallop.wordpress.com/2012/05/09/ubuntu-12-04-precise-pangolin-complete-vnc-server-setup/ Ubuntu 12.04 Precise Pangolin – Complete VNC Server Setup | Coddswallop] * $ vncserver :1 -geometry 800x600 -depth 24 -localhost -nolisten tcp[[br]][[Image(vnc-800x600.png,33%)]] * Log Outすると……[[br]][[Image(vnc-gnome-logout.png,33%)]] * gnomeからログアウトしても自動で再起動するようにする {{{#!sh #!/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 & PIDFILE="$HOME/.vnc/*${DISPLAY}.pid" while : do [ -r $PIDFILE ] || break PID=`cat $PIDFILE` ps $PID > /dev/null 2>&1 || break gnome-session done }}} * 単純にwhile true gnome-sessionだと、vncserver -killしたあとでwait無しの無限ループに入って暴走する * ログアウトしてもgnome-screensaverなどのプロセスが残るが、vncserver -kill後に「gnome-screensaver: Fatal IO error 11 (Resource temporarily unavailable) on X server :1.0.」などで死ぬ * こちらも、Ubuntu 12.04では、次のようにする必要がある * gnome-session --session=gnome-classic === 12.10 and later === * gnome-panelの実行が、gnome-sessionとは別に必要になった * [http://ubuntuforums.org/showthread.php?t=2077657 (ubuntu) 12.10 and vncserver missing menu] * ~/.vnc/xstartup {{{#!sh #!/bin/sh [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey gnome-session --session=gnome-classic & gnome-panel & }}} === 12.04 with lxde === {{{#!sh #!/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 & PIDFILE="$HOME/.vnc/*${DISPLAY}.pid" vncconfig -nowin & while : do [ -r $PIDFILE ] || break PID=`cat $PIDFILE` ps $PID > /dev/null 2>&1 || break lxsession -s LXDE done }}} == Arch Linux with LXDE == * 必要なパッケージ * archja:LXDE * [archja:VNC tigervnc] * => {{{pacaur -S lxde xorg-server-utils xorg-xinit otf-ipaexfont tigervnc}}} * aur:otf-ipaexfont * {{{~/.vnc/xstart}}} {{{#!sh #!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey /usr/bin/startlxde }}} * デフォルトの{{{xstart}}}は{{{exec /etc/X11/xinit/xinitrc}}}によりxclock, xtermなど不要なものを起動するうえ、twmを起動しようとするので修正が必要 * {{{vncserver :0 -geometry 800x600 -depth 24 -nolisten tcp}}}[[br]][[Image(arch-vnc-lxde.png,33%)]] = x11vnc = * 「caught XIO error」というエラーとともに勝手にログアウト(Xのセッションからも)することがあるが、詳細不明 * => #57 * see [./x11vnc] for x11vnc --help * [http://www.karlrunge.com/x11vnc/ x11vnc: a VNC server for real X displays] * [http://alromero.posterous.com/using-x11vnc-instead-of-vino-tightvncserver-o Using X11vnc instead of vino, tightvncserver or vnc4server - alromero's posterous] * [http://z.cs.utexas.edu/users/habals/blog/index.php/archives/22 Jungwoo's Blog » Blog Archive » x11vnc over SSH on Ubuntu Linux] * [http://rdt17.blogspot.com/2007/09/ubuntu704-x11vnc.html チラシの裏にでも書いてろ な!: Ubuntu7.04 にx11vncをインストールする] * ~/.x11vncrc {{{ display :0 # This will do in most single user machine rfbauth .vnc/passwd # password file rfbport 5900 # Use this default port forever # Without this x11vnc will die after serving one connection. localhost # Only accept local connections. This makes your x11vnc secure along with SSH. }}} * x11vnc -storepasswd で作られるパスワードファイルは先頭8文字しか見ない模様 * -rw------- 1 mitty mitty 8 Feb 17 00:04 .vnc/passwd * ~~ssh 越しにx11vnc serverの起動には成功せず(原理的に出来ない?)~~ * sudo x11vncで起動すればよい * 「alias sudo='sudo -H '」している場合は、以下のようにする {{{ sudo x11vnc -rc ~/.x11vncrc }}} * see also [../ssh#X11Forwardingwithanotheruser] * xfceの Settings -> Session and Startup の Application Autostart に 「/usr/bin/x11vnc」で登録すると良い * ps wwwwaux | grep auth {{{ root 1106 0.0 3.4 119100 17436 tty7 Ss+ Mar06 0:05 /usr/bin/X :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-bcQe9Q/database -nolisten tcp vt7 }}} * Xfce4 の例 * -display :0 -auth guess で自動的に見つけてくれる模様 == vnc with xinetd == * [http://hp.vector.co.jp/authors/VA022911/tec/centos/vnc2.htm 水銀室 VNCをxinetd経由で起動しGDMでログインする -CentOS最短構築支援-] * [http://ubuntuforums.org/showthread.php?t=363236 HOWTO: x11vnc (vnc for display :0) - Ubuntu Forums] > {{{ > server_args = -inetd -o /var/log/x11vnc.log -svc > }}} * -svc はうまく動かない * SSLを強制される( UNIXPW_DISABLE_SSL=1, UNIXPW_DISABLE_LOCALHOST=1をexportしても効かない) * [http://www.karlrunge.com/x11vnc/ssvnc.html ssvnc: SSL/SSH VNC viewer]を用いてlocalhost接続した後、User/Passwordでログインしてもattachされない * Xfceを使っているせい? (Xubuntu) 1. $ sudo aptitude install -R xinetd 1. $ sudo vim /etc/xinetd.d/x11vnc * source:lab/trunk/TipAndDoc/xinetd.d/x11vnc * attachment:x11vnc.log <- /var/log/x11vnc.log * session毎に上書きされる模様(最新の接続情報しか残らない) * この設定では、xinetdとx11vncの両方で、localhost以外からの接続を拒否しているが、それでもxinetdへのセッションそのものは確立するため、iptablesでポートごと塞ぐのがmore better