Skip to content

Latest commit

 

History

History
110 lines (69 loc) · 4.18 KB

changing-the-machine-type-for-your-codespace.md

File metadata and controls

110 lines (69 loc) · 4.18 KB
title shortTitle intro versions redirect_from topics type
Changing the machine type for your codespace
Change the machine type
You can change the type of machine that's running your codespace, so that you're using resources appropriate for the work you're doing.
fpt ghec
*
*
/codespaces/developing-in-codespaces/changing-the-machine-type-for-your-codespace
Codespaces
how_to

About machine types

{% data reusables.codespaces.codespaces-machine-types %} You can choose an alternative machine type either when you create a codespace or at any time after you've created a codespace.

For information on choosing a machine type when you create a codespace, see "AUTOTITLE."

{% data reusables.codespaces.machine-types-for-unpublished-codespaces %} For more information, see "AUTOTITLE."

Changing the machine type

{% note %}

Note: {% data reusables.codespaces.codespaces-machine-type-availability %}

{% endnote %}

{% webui %}

{% data reusables.codespaces.your-codespaces-procedure-step %}

The number of cores, memory, storage capacity, and currently used storage are displayed for each codespace. Some details are omitted if you are using a narrow browser window.

Screenshot of a list of three codespaces on the https://github.com/codespaces page."

{% data reusables.codespaces.ellipsis-settings %}

  1. Click Change machine type.

    Screenshot of the dropdown menu for a codespace. The "Change machine type" option is highlighted.

  2. If multiple machine types are available for your codespace, choose the type of machine you want to use.

    Screenshot of a dialog showing two available machine types: 2-core and 4-core.

  3. Click Update codespace.

{% endwebui %}

{% vscode %}

{% data reusables.codespaces.changing-machine-type-in-vscode %}

{% endvscode %}

{% cli %}

{% data reusables.codespaces.using-github-cli %}

You can use the gh codespace edit --machine MACHINE-TYPE-NAME {% data variables.product.prodname_cli %} command to change the machine type of a codespace. To use this command, you'll first need to find out the available machine types for your codespace.

  1. To view your list of codespaces, in a terminal, enter the following command.

    gh codespace list
  2. Optionally, to find the current machine type for a codespace, enter the following command.

    gh api /user/codespaces/CODESPACE-NAME

    Replace CODESPACE-NAME with the permanent name of the codespace, for example literate-space-parakeet-w5vg5ww5p793g7g9. The permanent names are listed under the NAME column in the list returned by gh codespace list.

    If you're prompted to request the codespace scope, follow the instructions in the terminal.

    Details for the current machine are listed under the machine field.

  3. To find the available machine types for a codespace, enter the following command.

    gh api /user/codespaces/CODESPACE-NAME/machines

    Replace CODESPACE-NAME with the permanent name of the codespace, for example literate-space-parakeet-w5vg5ww5p793g7g9.

  4. To change the machine type for a codespace, enter the following command.

    gh codespace edit --machine MACHINE-TYPE-NAME

    Replace MACHINE-TYPE-NAME with the name of an available machine type for your codespace, for example standardLinux32gb.

  5. Using the arrow keys, navigate to the codespace you want to change, then press Enter.

{% endcli %}

{% data reusables.codespaces.about-changing-storage-size %}

{% cli %}

Further reading

{% endcli %}