Skip to content

Instantly share code, notes, and snippets.

@ravish0007
Last active August 4, 2023 12:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ravish0007/c9884cdd90e8cc2ffaacacd658cc05d8 to your computer and use it in GitHub Desktop.
Save ravish0007/c9884cdd90e8cc2ffaacacd658cc05d8 to your computer and use it in GitHub Desktop.
google cloud shell novnc setup
#!/bin/bash
if [ -f /usr/bin/chromium ]; then echo "Previous session running..." ; exit 0 ; fi
vnc_password=123456
mkdir ~/.cloudshell
touch ~/.cloudshell/no-apt-get-warning
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -yq install xfce4 xfce4-goodies vnc4server novnc websockify python-numpy chromium
printf "$vnc_password\n$vnc_password\n\n" | vncpasswd
echo "#!/bin/bash" > ~/.vnc/xstartup
echo 'xrdb /data/data/com.termux/files/home/.Xresources' >> ~/.vnc/xstartup
echo "startxfce4 &" >> ~/.vnc/xstartup
# Tweak resolution
vncserver -geometry 1920x1080
echo 'alias chromium="chromium --disable-dev-shm-usage"' > ~/.bashprofile
echo "PS1='\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]$ '" >> ~/.bashprofile
if grep --quiet '. ~/.bashprofile' ~/.bashrc; then
echo ''
else
echo '. ~/.bashprofile' >> ~/.bashrc
fi
sudo websockify -D --web=/usr/share/novnc/ 8080 localhost:5901
@theonlyanson
Copy link

Ths one is coool...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment