Sign inSign up

lcasuol/vnc-server

By lcasuol

•Updated over 5 years ago

A Docker image for remote connections to our teaching image

Image
0

3.5K

lcasuol/vnc-server repository overview

⁠docker-vncserver-teaching

Inspired by https://stackoverflow.com/questions/46508679/dockerize-user-sessions⁠

⁠Installation

Tested on Ubuntu 18.04

⁠install docker (if not done yet)

⁠dockershell script

curl https://raw.githubusercontent.com/LCAS/docker-vncserver-teaching/main/dockershell?token=AAIZQPE7SHSSPFDNUD6ERN3ABAUNS | sudo tee /usr/local/bin/dockershell
sudo chmod +x /usr/local/bin/dockershell

⁠Installation as a user to log in

sudo useradd --create-home --shell /usr/local/bin/dockershell remote 
echo "remote:PASSWORD" | sudo chpasswd
sudo usermod -aG docker remote

# restart docker
sudo snap disable docker
sudo snap enable docker

change PASSWORD to a suitable password, and replace remote with another user name as needed.

⁠permanent service using docker-compose

  1. create a directory for persistent volume binding of the remote user's home dir: sudo mkdir /srv/remote_user
  2. change ownership of that director to the internal user id (1000): sudo chown 1000:1000 /srv/remote_user

⁠Usage

⁠Run standalone

⁠Use the container as your current user

Simply invoke dockershell for any user who can execute the docker command. The home directory will be available inside the container and you will be the same user as on the host system.

⁠run as a user with a local login

Simple as docker-user-session.sh USERNAME, where USERNAME is a user id known on the host machine. Home directories etc are mounted, and VNC session is by default started at port 6xxxx, where xxxx is the UID of the chosen user. You can automate ngrok start up for this port, by adding an ngrok password, e.g. docker-user-session.sh -n SECRET USERNAME.

⁠Use the container as an isolated user
  • create the volume directory with correct permission, e.g.: sudo install -d -o 2000:2000 /srv/lcas_docker_user (you may substitute )
  • run as docker run --rm -it -p 61111:6080 -v /srv/lcas_docker_user:/home/lcas lcasuol/vnc-server:latest

⁠Connect VNC

Direct your browser to http://IP:61111⁠ (or another port you have configured).

⁠Install some ROS systems

⁠Install RASberry

These steps show how to install the RASberry system if needed

  1. mkdir -p ~/rasberry_ws/src && cd ~/rasberry_ws && catkin build && cd ~/rasberry_ws/src
  2. git clone --recurse-submodules --shallow-submodules --depth 1 https://github.com/LCAS/RASberry.git
  3. rosdep update && apt-get update && rosdep install --from-paths ~/rasberry_ws/src -i -y
  4. catkin build && pip install -U tmule

⁠Ngrok

you can expose the port via ngrok, e.g., like

ngrok1 -subdomain coltrane-marchanheide -proto=https -httpauth marchanheide:PASSWORD -log=stdout -log-level WARNING 61002

Tag summary

Content type

Image

Digest

Size

1.3 GB

Last updated

over 5 years ago

docker pull lcasuol/vnc-server