Problem: You are trying to connect to the wrong TCP socket.
Solution:
On some Linux clients, the localhost resolves to
the IPv6 loopback address (::1).
Check this by using ping -c 1 localhost. If this command returns
the IPv6 address, use -L 8080:127.0.0.1:8080
(rather than -L 8080:localhost:8080) in the
gcloud compute ssh command.
Ensure that you connect to http://localhost:8080
(instead of https://localhost:8080) on your local client.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eA JupyterLab session is initialized when you start a Deep Learning VM Images instance.\u003c/p\u003e\n"],["\u003cp\u003eYou can set up SSH port forwarding to access your JupyterLab session through a local browser using the \u003ccode\u003egcloud compute ssh\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud compute ssh\u003c/code\u003e command requires you to specify your project ID, zone, and instance name.\u003c/p\u003e\n"],["\u003cp\u003eIf using Cloud Shell, you might need to add a \u003ccode\u003e-4\u003c/code\u003e flag to the SSH command to connect via IPv4.\u003c/p\u003e\n"],["\u003cp\u003eIf you encounter connection issues, ensure you are using the correct localhost IP address (127.0.0.1 instead of ::1) and protocol (http instead of https).\u003c/p\u003e\n"]]],[],null,[]]