Connect Google Colab via Remote Desktop | Updated To v2
Yesterday, I tried to connect Google Colab via Remote Desktop and after many attempts, I succeeded. I want to thank this google article, which helped me in doing so.
Warning: Don’t use it for Cryptocurrency Mining. Which is against the policy of Google Colab, and you will get banned from Google Colaboratory.
Before We Start
Google Colab is mostly used to perform heavy tasks like Training TensorFlow Model, Data analysis, Machine Learning and Deep Learning. You can get an Instance with 12GB RAM and GPU for free upto 12 hours. You can use it to perform heavy tasks, and access google drive to store your data.
Now Let’s Begin
Update: New Script One Click RDP. It can make Colab Instance ready for Remote Connection in only one click. No need to follow the procedure. No NGROK Required @ Same Notebook.
I used Google Remote Desktop and Ngrok Tunnel for RDP in Google Colab Instance. You can use my notebook for connecting Google Colab via Remote Desktop.
- Open the Notebook in Google Colab.
- Create user account using appropriate code block.*
*Don’t use username:
- Paste the Chrome Remote Desktop Authentication Code in RDP code block and run it. (This will complete setup in only few minutes)
- Optional: Mount Google Drive for Persistent Data.
- First, create a user account and add a password:
Use useradd and adduser commands for user account creation and passwd command to change the account’s password.
- Create and Run the Ngrok Tunnel:
Use the colab_ssh library for creating Ngrok Tunnel.
- Configure Instance:
Install Chrome Remote Desktop Headless, Desktop Environment and other required tools like browser, terminal.
- SSH the Colab Instance.
- Visit Chrome Remote Desktop and start the process:
Open a browser and go to http://remotedesktop.google.com/headless.
- Don’t Download any file; proceed directly and click to authenticate button.
- When you get a command, copy and paste it to the SSH terminal and complete the process by setting up a pin.
Now you can see the newly available Colab Instance in Remote Devices present at Chrome Remote desktop. As shown in the image:
I have done more similar things with Google Colab, Which you can get from my Repository Colab Hacks.