Ubuntu 15.10 (DeskTopはLXDE)でvncサーバーを起動する&ログイン画面表示時点で自動起動する

16:27 下書き1
元ネタは
http://freefielder.jp/blog/2015/10/ubuntu-vnc-server-on-startup.html
http://ubuntujp.jimdo.com/種類別/lubuntu/

$ sudo apt-get update
$ sudo apt-get dist-upgrade

$ sudo apt-get install vnc4server
$ sudo apt-get install lxde
$ sudo apt-get install ibus-anthy

$ vncserver
初めて vncserver を起動するときはパスワードを聞いてくるので入力
以降、vnc クライアントから接続するときはこのパスワードを使用

$ vncserver -kill :1

xstartup ファイルを編集

$ pwd
/home/worker/.vnc

$ diff -u xstartup.org xstartup

      • xstartup.org 2014-08-21 10:48:54.567463293 +0900
      1. xstartup 2014-08-21 12:08:19.682050631 +0900

@@ -1,12 +1,13 @@
#!/bin/sh

# Uncomment the following two lines for normal desktop:

  • # unset SESSION_MANAGER
  1. unset SESSION_MANAGER

# exec /etc/X11/xinit/xinitrc

  1. /usr/bin/ibus-daemon -d
  2. /usr/bin/startlxde &

+
[ -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 &

vncserver を起動
$ vncserver :1 -geometry 1366x768

  • geometry 1366x768 はデスクトップのサイズです。お好みのサイズでどうぞ

vnc クライアントから接続
$ vinagre VncServerName:1

↑ここまで http://fishrimper.blogspot.jp/2014/08/ubuntu-1404-server-vnc4server-lxde.html

↓ここから http://ubuntujp.jimdo.com/種類別/lubuntu/
/etc/xdg/autostartに以下の一行を追加
@/bin/su - ユーザー名 -c "/usr/bin/vncserver :1 -geometry 1024x768 -depth 16"

        • -

18:52 この方法では有効にならなかった…。やはりサービス化が必要か…
SystemV init からsystemctl に変わったはずなので、 /etc/rc.local をいじる方法は取りたくなかった

        • -

24:10
http://cloud-work.net/server/vnc_vino/
http://www.raspberrypi-spy.co.uk/2014/05/how-to-autostart-apps-in-rasbian-lxde-desktop/
の情報が役に立ちそう

$ /usr/bin/vino-preferences
"Allow other users to view your desktop" にチェックを入れる
"Require the user to enter this password:"にチェックを入れ、テキストボックスにパスワードを入力する

$ gsettings set org.gnome.Vino network-interface wlan0
"wlan0"は、場合によってはeth0などの別インターフェースになるかも

$ sudo vi /etc/xdg/lxsession/LXDE/autostart
→"@/usr/lib/vino/vino-server"を末尾に追加

ちょっとリブートするので待ってて

ダメでした