ubuntu16にvnc4serverをインストールし、外部のvncクライアントで接続できるようにしました。
その上で、マシン起動時に、vncの端末上で自動的にシェルスクリプトを実行したいのですが出来ません。
何卒、お力添え下さい。
現在できている事
- Ubuntu16を Google Cloud Engineのインスタンスとして起動
- 「1」の起動時にcron(@reboot)でvncserverを起動($ vncserver :1)
やりたい事
- 上記「2」で起動したvncserver内(のターミナル)でシェルスクリプトを自動的に実行したい
試してみた事
- ~/.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 & cd /path/to/the/script && /bin/sh ./the_script.sh
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/12/17 05:32