remocolab is a Python module to allow remote access to Google Colaboratory using SSH or TurboVNC. It also install VirtualGL so that you can run OpenGL programs on a Google Colaboratory machine and see the screen on VNC client. It secures TurboVNC connection using SSH port forwarding.
- You can use Google Colaboratory
- That means you need Google acount and a browser that is supported by Google Colaboratory.
- ngrok Tunnel Authtoken
- You need to sign up for ngrok to get it
- SSH client
- (Optional) TurboVNC Viewer if you use it.
- Create a new notebook on Google Colaboratory
- Add a code cell and copy & paste one of following codes to the cell
- SSH only:
!pip install git+https://github.com/demotomohiro/remocolab.git
import remocolab
remocolab.setupSSHD()
- SSH and TurboVNC:
!pip install git+https://github.com/demotomohiro/remocolab.git
import remocolab
remocolab.setupVNC()
- (Optional) If you want to run OpenGL applications or any programs that use GPU, Click "Runtime" -> "Change runtime type" in top menu and change Hardware accelerator to GPU.
- Run that cell
- Then the message that ask you to copy & paste tunnel authtoken of ngrok will appear. Login to ngrok, click Auth on left side menu, click Copy, return to Google Colaboratory, paste it to the text box under the message and push enter key.
- Select your ngrok region. Select the one closest to your location. For example, if you were in Japan, type jp and push enter key.
- remocolab setup ngrok and SSH server. Please wait for it done (about 2 minutes)
- Then, root and colab user password and ssh command to connect the server will appear.
- Copy & paste the ssh command to your terminal and login to the server using displayed colab user password. (Even if you just want to use TurboVNC, you need to login using SSH to make SSH port forwarding)
- If you use TurboVNC:
- Wait for remocolab setup TurboVNC (about 2 minutes)
- When VNC password is displayed, run TurboVNC server, set server address to
localhost:1
and connect - Then, password will be asked. Copy & paste that VNC password to your TurboVNC viewer.
Put the command to run the OpenGL application after vglrun
.
For example, vglrun firefox
runs firefox and you can watch web sites using WebGL with hardware acceleration.