Ubuntu16.04でVNCサーバを起動する
# VNCサーバのインストール sudo apt-get install vnc4server # VNC接続時のパスワードの設定 vncpasswd # Password: # Verify: # VNCサーバの初回起動。これによって設定ファイルが作成される。 vncserver :1 # New 'chie-no-ubuntu:1 (chie8842)' desktop is chie-no-ubuntu:1 # Starting applications specified in /home/chie8842/.vnc/xstartup # Log file is /home/chie8842/.vnc/chie-no-ubuntu:1.log # 起動確認ができたらVNCサーバを停止する vncserver -kill :1
~/.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 & gnome-panel & gnome-settings-daemon & metacity & nautilus &
VNCサーバを起動する
vncserver :1
再起動後もvncserverを起動しておきたい場合は、~/.bashrcもしくは/etc/rc.localのexit 0の前に以下を追記する。 ※/etc/rc.localに記述するときは、vncの設定をrootで行っておくこと。
vncserver :1
参照: