This commit is contained in:
岳松
2016-10-18 16:00:26 +08:00
parent 2ebf4e8d9b
commit a722ed0af5
2 changed files with 11 additions and 9 deletions

12
vnc.sh
View File

@@ -1,6 +1,10 @@
#!/bin/bash
# Remove VNC lock (if process already killed)
rm /tmp/.X1-lock /tmp/.X11-unix/X1
# Run VNC server with tail in the foreground
vncserver :1 -geometry 1280x800 -depth 24 && tail -F /root/.vnc/*.log
##change vnc password
echo "change vnc password!"
(echo $VNC_PW && echo $VNC_PW) | vncpasswd
##start vncserver
vncserver -kill :1 && rm -rfv /tmp/.X* ; echo "remove old vnc locks to be a reattachable container"
vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION
sleep 1