Last active
September 16, 2021 12:08
-
-
Save ancientstraits/404d43d03581468431d97682652be148 to your computer and use it in GitHub Desktop.
Install VNC on gitpod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script easily gives gitpod graphical | |
# capabilities by using tightvncserver and noVNC. | |
# To be lightweight, it also uses awesomeWM as the | |
# graphical environment, but you can change it | |
# by editing this script. | |
# Package management | |
sudo apt update | |
sudo apt install awesome tightvncserver xterm libgl1-mesa-dev xorg-dev xorg | |
# awesomeWM | |
mkdir ~/.config/awesome | |
cp /etc/xdg/awesome/rc.lua ~/.config/awesome/rc.lua | |
# Run vncserver once to setup username and password | |
vncserver | |
vncserver -kill :1 | |
# Change the startup script to start awesomeWM | |
rm -rf ~/.vnc/xstartup | |
cat << EOF > ~/.vnc/xstartup | |
#!/bin/sh | |
awesome & | |
EOF | |
# You can configure vncserver with the -geometry option, | |
# which will change the screen size. | |
# This gives a display with a width of 600 | |
# and a height of 400. | |
vncserver -geometry 600x400 | |
# novnc | |
git clone https://github.com/novnc/novnc ~/.novnc | |
~/.novnc/utils/novnc_proxy --vnc localhost:5901 | |
# Gitpod will notify you that 3 ports are open. | |
# Make the 6080 port public, then open it in a new tab or | |
# the preview by clicking the "Remote Explorer" sidebar | |
# button on the side of Gitpod Code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment