Local Runtime
- Install Docker.
- Start a google colab runtime.
# regular
docker run -p 127.0.0.1:9000:8080 us-docker.pkg.dev/colab-images/public/runtime
# nvidia gpu
paru -S nvidia-container-toolkit # on linux
sudo systemctl restart docker # on linux
docker run --gpus=all -p 127.0.0.1:9000:8080 us-docker.pkg.dev/colab-images/public/runtime
- (optional) Add name and mount local files.
--name <container-name>
-v <local-path>:<container-path>
# example
docker run --gpus=all -p 127.0.0.1:9000:8080 --name colab-runtime -v $HOME/Projects:/projects us-docker.pkg.dev/colab-images/public/runtime
start container with
docker start <container-name> in the future- Copy link from runtime output.
# example
http://127.0.0.1:9000/?token=chonktoken
Open in Google Colab Website
- Open https://colab.research.google.com/.
- Click
Connect to a local machineand enter copied link.
If using firefox, enable insecure websocket preference
- Open about:config in firefox.
- Set
network.websocket.allowInsecureFromHTTPStotrue.
Open in VS Code
- Install required extensions.
- Python
- Pylance
- Python Debugger
- Jupyter Notebook Renderers
- Open command palette
ctrl + shift + p. - Search for
Notebook: Select Notebook kernal. - Click
Select Another Kernal->Existing Jupyter Server. - Paste copied link, press
Enterto confirm. - Select
python3 (ipykernal).