I just struggled for 3 days to get this to work but many of the sources that explain it are somehow misleading. Therefore I share that now. I was using windows and used the Windows 10 Subsystem for Linux to operate from there: (instruction on how to activate you can find here https://docs.microsoft.com/en-us/windows/wsl/install-win10)
- I first created a virtual machine on google cloud called colav-vm in the geographic zone us-east4-c
- Start the VM in google cloud
- Opened Ubuntu Linux Terminal:
- Type:
gcloud compute ssh colav-vm --zone=us-east4-c -- -L 8888:locahost:8888 - Enter Password to connect to it
- Install pip: (found it here: https://askubuntu.com/questions/672808/sudo-apt-get-install-python-pip-is-failing)
(In the connected terminal from the VM)
sudo apt-get install software-properties-common
sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install python-pip
- Install jupyter_http_over_ws
sudo -i pip install jupyter_http_over_ws
- Run the jupyter-server still on the connected VM:
jupyter serverextension enable --py jupyter_http_over_ws
jupyter notebook \
--NotebookApp.allow_origin='https://colab.research.google.com' \
--port=8888 \
--NotebookApp.port_retries=0
(this should be also a code cell - but the formatting doesn't let me)
- Then go to the browser on your local computer and type in " http://localhost:8888/ " to open a Jupyter environment if you have it installed - or go to google Colab and connect to runtime on the top right and type it in there and connect (there you need to add the full line including the token like that: http://localhost:8888/?token=bd391421b3ec5c08f35ef28e2eb9d01fab6501e341c82e35)
I hope this saves some people some time.
The original sources are from here: https://research.google.com/colaboratory/local-runtimes.html https://medium.com/@yufengg/how-to-upgrade-colab-with-more-compute-64d53a9b05dc (but somehow it confused me and it didn't work for me at least)