Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Cuando inicias una instancia de Deep Learning VM Image, se inicializa una sesión de JupyterLab.
Para configurar la redirección de puertos SSH, completa los siguientes pasos y, luego, accede a tu sesión de JupyterLab a través de un navegador local:
Problema: Intentas conectarte al socket TCP incorrecto.
Solución:
En algunos clientes de Linux, el localhost apunta a la dirección de bucle invertido de IPv6 (::1). Verifica esto mediante ping -c 1 localhost. Si este comando muestra la dirección IPv6, usa -L 8080:127.0.0.1:8080 (en lugar de -L 8080:localhost:8080) en el comando gcloud compute ssh.
Asegúrate de conectarte a http://localhost:8080 (en lugar de https://localhost:8080) en tu cliente local.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (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,["# Connect to JupyterLab\n\nWhen you start a Deep Learning VM Images instance, a JupyterLab session is\ninitialized.\n\nTo set up\n[SSH port forwarding](/solutions/connecting-securely#port-forwarding-over-ssh),\ncomplete the following steps, and then access your JupyterLab session through a\nlocal browser:\n\n1. Run the following command by using the [Google Cloud CLI](/sdk/gcloud) in\n your preferred terminal or in\n [Cloud Shell](https://console.cloud.google.com?cloudshell=true):\n\n ```bash\n gcloud compute ssh \\\n --project PROJECT_ID \\\n --zone ZONE \\\n INSTANCE_NAME \\\n -- -L 8080:localhost:8080\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: your [Google Cloud project ID](/resource-manager/docs/creating-managing-projects#identifying_projects)\n - \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the [zone](/compute/docs/regions-zones) where your instance is located\n - \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e: the name of your instance\n\n| **Note:** If using Cloud Shell to run the command, add a `-4` to the SSH flags to use IPv4 to connect. Example: `-- -4 -L `\u003cvar translate=\"no\"\u003eLOCAL_PORT\u003c/var\u003e`:localhost:`\u003cvar translate=\"no\"\u003eREMOTE_PORT\u003c/var\u003e\n\n1. Access your JupyterLab session through a local browser:\n\n - If you ran the command on your local machine, visit\n `https://localhost:8080` to access JupyterLab.\n\n - If you ran the command using\n [Cloud Shell](https://console.cloud.google.com?cloudshell=true),\n access JupyterLab through the\n Web\n Preview on port 8080.\n\nTroubleshooting\n---------------\n\n**Symptom** : When [using SSH port forwarding\nto connect to JupyterLab](/deep-learning-vm/docs/jupyter),\nyou are unable to connect to the instance.\n\n**Problem**: You are trying to connect to the wrong TCP socket.\n\n**Solution**:\n\n- On some Linux clients, the localhost resolves to\n the IPv6 loopback address (`::1`).\n Check this by using `ping -c 1 localhost`. If this command returns\n the IPv6 address, use `-L 8080:127.0.0.1:8080`\n (rather than `-L 8080:localhost:8080`) in the\n `gcloud compute ssh` command.\n\n- Ensure that you connect to `http://localhost:8080`\n (instead of `https://localhost:8080`) on your local client."]]