Connect to a runtime in Colab Enterprise

This page shows you how to connect to a runtime in Colab Enterprise.

To run code in your notebook, you must connect to a runtime. Aruntimeis a compute resource that runs your code.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enable permission.Learn how to grant roles.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Vertex AI, Dataform, and Compute Engine APIs.

    Roles required to enable APIs

    To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enable permission.Learn how to grant roles.

    Enable the APIs

Connect by using different methods

This page shows you how to connect to a runtime by using the following methods:

Use the default runtime

This section describes how to connect to the default runtime.

Required roles

To get the permissions that you need to connect to the default runtime in a Colab Enterprise notebook, ask your administrator to grant you the Colab Enterprise User (roles/aiplatform.colabEnterpriseUser) IAM role on the project. For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

One or more of the required roles includes thedataform.repositories.list permission. Users who are granted thedataform.repositories.list permission or theCode Creator (roles/dataform.codeCreator) role in a project can list the names of code assets in that project by using the Dataform API or the Dataform command-line interface (CLI). Non-administrators using BigQuery Studio can only see code assets that they created or that were shared with them.

Connect to the default runtime

When you run code in a notebook for the first time,Colab Enterpriseautomatically connects to the default runtime unless youspecify a different one.

To connect to the default runtime without running code, do the following:

  1. In the Google Cloud console, go to the Colab EnterpriseMy notebooks page.

    Go to My notebooks

  2. In theRegion menu, select the region that contains your notebook.

  3. Click the notebook that you want to open. If you haven't created a notebook yet,create a notebook.

  4. In your notebook, clickConnect.

  5. If this is your first time connecting to a runtime with end-user credentials enabled, aSign in dialog appears.

    The default runtime has end-user credentials enabled by default. To use a runtime that doesn't have access to your user credentials,create a runtime template without end-user credentials enabled.

    To grant Colab Enterprise access to your user credentials, complete the following steps:

    1. In theSign in dialog, click your user account.

    2. SelectSee, edit, configure, and delete your Google Cloud data... to grant Colab Enterprise access to your user credentials.

      The checkbox is next to a statement      that says, "See, edit, configure, and delete your Google Cloud data and see the      email address for your Google Account."
    3. ClickContinue.

Colab Enterprise connects to the default runtime. If the default runtime isn't running, Colab Enterprise starts the default runtime, and then connects to it.

Connect to an existing runtime

This section describes how to connect to an existing runtime by usingtheConnect to Vertex AI runtime dialog.

Required roles

To get the permissions that you need to connect to an existing runtime in a Colab Enterprise notebook, ask your administrator to grant you the Colab Enterprise User (roles/aiplatform.colabEnterpriseUser) IAM role on the project. For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

One or more of the required roles includes thedataform.repositories.list permission. Users who are granted thedataform.repositories.list permission or theCode Creator (roles/dataform.codeCreator) role in a project can list the names of code assets in that project by using the Dataform API or the Dataform command-line interface (CLI). Non-administrators using BigQuery Studio can only see code assets that they created or that were shared with them.

Connect to the existing runtime

To connect to an existing runtime:
  1. In the Google Cloud console, go to the Colab EnterpriseMy notebooks page.

    Go to My notebooks

  2. In theRegion menu, select the region that contains your notebook.

  3. Click the notebook that you want to open. If you haven't created a notebook yet,create a notebook.

  4. In your notebook, click theAdditional connection options expander arrow, and then selectConnect to a runtime.

    TheConnect to Vertex AI runtime dialog opens.

  5. ForSelect a runtime, selectConnect to an existing runtime.

  6. ForSelect an existing runtime option, select the runtime that you want to connect to. If there aren't any runtimes in the list,create a runtime orconnect to the default runtime.

  7. ClickConnect.

  8. If your runtime has end-user credentials enabled, and this is your first time connecting to a runtime with end-user credentials enabled, aSign in dialog appears.

    To use a runtime that doesn't have access to your user credentials,create a runtime template without end-user credentials enabled.

    To grant Colab Enterprise access to your user credentials, complete the following steps:

    1. In theSign in dialog, click your user account.

    2. SelectSee, edit, configure, and delete your Google Cloud data... to grant Colab Enterprise access to your user credentials.

      The checkbox is next to a statement      that says, "See, edit, configure, and delete your Google Cloud data and see the      email address for your Google Account."
    3. ClickContinue.

Colab Enterprise connects to the runtime. If the runtime isn't running, Colab Enterprise starts the runtime, and then connects to it.

Create a runtime

This section describes how to create a runtime and connect to it by usingtheConnect to Vertex AI runtime dialog. Alternatively, you cancreatea runtime from theRuntimes tab.

Required roles

To get the permissions that you need to create a runtime in Colab Enterprise, ask your administrator to grant you the Colab Enterprise Admin (roles/aiplatform.colabEnterpriseAdmin) IAM role on the project. For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

One or more of the required roles includes thedataform.repositories.list permission. Users who are granted thedataform.repositories.list permission or theCode Creator (roles/dataform.codeCreator) role in a project can list the names of code assets in that project by using the Dataform API or the Dataform command-line interface (CLI). Non-administrators using BigQuery Studio can only see code assets that they created or that were shared with them.

Create a runtime and connect to it

To create a runtime and connect to it by usingtheConnect to Vertex AI runtime dialog:
  1. In the Google Cloud console, go to the Colab EnterpriseMy notebooks page.

    Go to My notebooks

  2. In theRegion menu, select the region that contains your notebook.

  3. Click the notebook that you want to open. If you haven't created a notebook yet,create a notebook.

  4. In your notebook, click theAdditional connection options expander arrow, and then selectConnect to a runtime.

    TheConnect to Vertex AI runtime dialog opens.

  5. ForSelect a runtime, selectCreate new runtime.

  6. In theRuntime template menu, select a runtime template. If there aren't any runtime templates listed,create a runtime template.

  7. In theRuntime name field, enter a name for your runtime.

  8. ClickConnect.

  9. If the runtime template that you selected has end-user credentials enabled, and this is your first time connecting to a runtime with end-user credentials enabled, aSign in dialog appears.

    To use a runtime that doesn't have access to your user credentials,create a runtime template without end-user credentials enabled.

    To grant Colab Enterprise access to your user credentials, complete the following steps:

    1. In theSign in dialog, click your user account.

    2. SelectSee, edit, configure, and delete your Google Cloud data... to grant Colab Enterprise access to your user credentials.

      The checkbox is next to a statement      that says, "See, edit, configure, and delete your Google Cloud data and see the      email address for your Google Account."
    3. ClickContinue.

Colab Enterprise starts the default runtime, and then connects to it.

Runtime management

By default, when you create a runtime, you automatically have therequired permissions todelete (aiplatform.googleapis.com/notebookRuntimes.delete) andstart (aiplatform.googleapis.com/notebookRuntimes.start) that runtime.

To learn how to manage your runtime, including how to delete, start, ordisconnect from the runtime, seeManage runtimes.

Troubleshoot

This section shows you how to resolve issues with connecting to runtimesin Colab Enterprise.

Unable to connect to a runtime

This issue occurs due to several reasons. The most common causes are:

Browser blocks third party cookies

The browser that you are using is blocking a third party cookie that Colab Enterprise uses to establish an HTTPS connection with the runtime.

To resolve this issue, configure your browser's settings to allow theDATALAB_TUNNEL_TOKEN third party cookie from the domain*.aiplatform-notebook.googleusercontent.com.

Network blocks outbound traffic to notebook domains

Your network's firewall rules block outbound traffic to*.aiplatform-notebook.cloud.google.com or*aiplatform.googleapis.com.

To resolve this issue, configure your network's firewall rules to allow outbound traffic to*.aiplatform-notebook.cloud.google.com and*aiplatform.googleapis.com.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-09 UTC.