Skip to content

Instantly share code, notes, and snippets.

@jmewes
Last active June 6, 2021 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmewes/4717e50aca20729ec5a94c7fbe7a45f3 to your computer and use it in GitHub Desktop.
Save jmewes/4717e50aca20729ec5a94c7fbe7a45f3 to your computer and use it in GitHub Desktop.
How to access remove VPN in codeanywhere with browser

On container

# Enable SSH login
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCaBEGFNl48E9S9YBP5ICcGXMvajY4et9S3JGkN65cjS2+Ws0LyFERSV027uJK7vwV9adN2a7fZCtbk7C/70Dsa5/lrf8ZE6N8lFbj/srsv+QPnj/6/MVCDbG+cgW/k0DZ2z2hwCuAZdcKnb3Pvwj02z/LtsxmH8rDruc/UQZTk/9NehiIM9QW38DnVP/IsVq9cmOt4/hT2R9nmo2uRxs/PdVcDoqwatLzO7fXO2BrufpD9M4GrEphHDc3WNe2Pf0vhEmeJQOzAkPquKb9DTe1yGSnsW9X4dpRplbWRWO70MkwAoKqwuhnX2N8Xz7pt3asbIQTV5xVaMmT9ohsTwO1Zafhjb9M0pBipwRPs4/G/CQoojLVhy6IlP+JfyrgvoEcPQQYTvfJ1JJPBM9ySJGOnUMXGtYy8zXj914ZIgoxDaydFEYhCiq23imEg8DJumNWB4mE0GjeE42ELj2dkdL6UhBFp0aRxFM9r0LeL3c6/EvoeZpoarjwiKhVc9bwyMKr1fm/IazZEwAtPOxQmsq2cqO/ybBBwE5JUgEM+nAKaSDI1Z+v5E3BghA3vl57PmgHe/bSQi4TBxFOvcdMl0dmSrLQU4SJSESbU7Tigx+HJE3gEsQxODHVjpC9r9aa1eBYI1zS3qPRtWbJJVW5nNhmJrGX/BiOLxJsuiJ4cLjBNOw== jm@experimental-software.com" >> ~/.ssh/authorized_keys

# Enable Chrome browser to start
sudo apt-get install -y xvfb
sudo apt-get -y install xorg xvfb gtk2-engines-pixbuf
sudo apt-get install x11vnc -y

# Create virtual screen
Xvfb -ac :99 -screen 0 900x600x16 &
export DISPLAY=:99
# Start VNC server
x11vnc -nopw -localhost -display :99  &

# Run app in Chrom
cd hello_flutter/
flutter run -d chrome

On local laptop

Tab 1

# Connect to container
ssh -L 5900:localhost:5900 cabox@host31.codeanyhost.com -p 26394

Tab 2

# Connect to VCN server
git clone git@github.com:novnc/noVNC.git
cd noVNC/
./utils/launch.sh --vnc localhost:5900

Then open the following URL in the browser:

http://laptop-jm:6080/vnc.html?host=laptop-jm&port=6080

References

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