mn9206986 commited on
Commit
34d8a6f
·
verified ·
1 Parent(s): be5a348

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +10 -44
start.sh CHANGED
@@ -1,49 +1,15 @@
1
  #!/bin/bash
 
 
2
 
3
- #Variables
4
- vncfile="/root/.vnc/passwd"
5
 
6
- if [ -z "$VNC_PASS" ]; then
7
- vncpass="123456"
8
- else
9
- vncpass=$VNC_PASS
10
- fi
11
 
12
- if [ -z "$GEOMETRY" ]; then
13
- geometry="1440x900"
14
- else
15
- geometry=$GEOMETRY
16
- fi
17
 
18
- #echo $vncpass | vncpasswd -f > ~/.vnc/passwd
19
- #chmod 0600 /root/.vnc/passwd
20
-
21
- echo -e "$vncpass\n$vncpass\n\n" | vncpasswd
22
-
23
- # initialize vnc
24
- /usr/bin/vncserver
25
- /usr/bin/vncserver -kill :1
26
- rm /tmp/.X11-unix/X*
27
- rm /tmp/.X*-lock
28
-
29
-
30
- # add xstartup
31
- if [ -z "$PROGRAM" ]; then
32
- echo "lxpanel &" >> ~/.vnc/xstartup
33
- fi
34
-
35
- if [ "$PROGRAM" == "firefox" ]; then
36
- echo "firefox $URL &" >> ~/.vnc/xstartup
37
- fi
38
-
39
- if [ "$PROGRAM" == "chrome" ]; then
40
- echo "google-chrome --no-sandbox $URL &" >> ~/.vnc/xstartup
41
- fi
42
-
43
- #run vncserver in background
44
- /usr/bin/vncserver :1 -geometry $geometry&
45
-
46
- cp /opt/noVNC/vnc_lite.html /opt/noVNC/index.html
47
-
48
- #run novnc
49
- /opt/noVNC/utils/novnc_proxy --vnc localhost:5901
 
1
  #!/bin/bash
2
+ # Start Xvfb for virtual display
3
+ Xvfb $DISPLAY -screen 0 1280x1024x16 &
4
 
5
+ # Start Fluxbox as a minimal window manager
6
+ fluxbox &
7
 
8
+ # Start x11vnc to provide VNC server
9
+ x11vnc -display $DISPLAY -nopw -forever -shared &
 
 
 
10
 
11
+ # Start noVNC to provide web access
12
+ /usr/share/novnc/utils/launch.sh --vnc localhost:$VNC_PORT --listen $NOVNC_PORT &
 
 
 
13
 
14
+ # Start Google Chrome
15
+ google-chrome --no-sandbox --disable-gpu --disable-dev-shm-usage --display=$DISPLAY