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. |
|
|
|
how_to |
{% 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."
{% 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.
{% data reusables.codespaces.ellipsis-settings %}
-
Click Change machine type.
-
If multiple machine types are available for your codespace, choose the type of machine you want to use.
-
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.
-
To view your list of codespaces, in a terminal, enter the following command.
gh codespace list
-
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 exampleliterate-space-parakeet-w5vg5ww5p793g7g9
. The permanent names are listed under the NAME column in the list returned bygh 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. -
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 exampleliterate-space-parakeet-w5vg5ww5p793g7g9
. -
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 examplestandardLinux32gb
. -
Using the arrow keys, navigate to the codespace you want to change, then press Enter.
{% endcli %}
{% data reusables.codespaces.about-changing-storage-size %}
{% cli %}
- "AUTOTITLE"
gh codespace edit
in the {% data variables.product.prodname_cli %} manual- "AUTOTITLE"
- "AUTOTITLE"
{% endcli %}