Stay organized with collectionsSave and categorize content based on your preferences.
You can clone a workstation by creating a new workstation with the contents of an existing one. You can only clone a workstation within the same region.
Before you begin
Before you clone a workstation, make sure you have the right permissions to the
source workstation:
You must haveworkstations.workstations.usepermission on the
source workstation.
TheCloud Workstations Service
Agentfor the project where you are creating the new workstation must havecompute.disks.createSnapshotandcompute.snapshots.useReadOnlyon the project containing the
source workstation.
Clone a workstation
To clone a workstation, create a new workstation and specify the source
workstation to copy files from:
Copy a workstation's files to a new workstation with a larger disk
When you clone a workstation, the new workstation retains the size of the source disk. If you need more storage, you can copy a workstation's files to a new workstation with a larger disk:
Create a new destination workstation using a configuration that specifies a
larger persistent disk.
Start both the source workstation and the destination workstation.
Access a terminal on the destination workstation by launching it in the
Google Cloud console or connecting to it using SSH.
WORKSTATION_PORT: the port on the source workstation
to which traffic should be sent (default:22).
LOCAL_PORT(Optional): the localhost port from which
traffic will be sent. Valid port numbers are1024to65535. If you omit
the--local-host-portflag or specify a port of0an unused port is
selected automatically.
When the tunnel is ready it will display the port number:
Listening on port [LOCAL_PORT].
In another terminal on the destination workstation, runscpand specify
the port where the TCP tunnel is listening to copy the files from the source
workstation.
[[["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-09-04 UTC."],[],[],null,["# Clone a workstation\n\nYou can clone a workstation by creating a new workstation with the contents of an existing one. You can only clone a workstation within the same region.\n\nBefore you begin\n----------------\n\nBefore you clone a workstation, make sure you have the right permissions to the\nsource workstation:\n\n1. You must have `workstations.workstations.use` permission on the source workstation.\n2. The [**Cloud Workstations Service\n Agent**](/workstations/docs/service-accounts#workstations-service-agent) for the project where you are creating the new workstation must have `compute.disks.createSnapshot` and `compute.snapshots.useReadOnly` on the project containing the source workstation.\n\nClone a workstation\n-------------------\n\nTo clone a workstation, create a new workstation and specify the source\nworkstation to copy files from: \n\n```\n gcloud workstations create WORKSTATION \\\n --project=PROJECT \\\n --region=REGION \\\n --cluster=CLUSTER_NAME \\\n --config=CONFIG_NAME \\\n --source-workstation=SOURCE_WORKSTATION\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eWORKSTATION\u003c/var\u003e: the ID or fully qualified identifier for the\n new workstation\n\n- \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e: the project that will contain the new\n workstation\n\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the new workstation will\n reside---for example, `us-central1`\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the workstation cluster that\n will contain the new workstation\n\n- \u003cvar translate=\"no\"\u003eCONFIG_NAME\u003c/var\u003e: the name of the workstation configuration\n that will contain the new workstation\n\n- \u003cvar translate=\"no\"\u003eSOURCE_WORKSTATION\u003c/var\u003e: the fully qualified identifier of the\n source workstation from which the new workstation's persistent directories\n will be copied\n\n Your source workstation's identifier might be similar to the following: \n\n ```\n projects/SOURCE_PROJECT/locations/SOURCE_REGION/workstationClusters/SOURCE_CLUSTER/workstationConfigs/SOURCE_CONFIG/workstations/SOURCE_WORKSTATION\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSOURCE_PROJECT\u003c/var\u003e: the project containing the source workstation\n - \u003cvar translate=\"no\"\u003eSOURCE_REGION\u003c/var\u003e: the location where the source workstation resides\n - \u003cvar translate=\"no\"\u003eSOURCE_CLUSTER\u003c/var\u003e: the name of the workstation cluster that contains the source workstation\n - \u003cvar translate=\"no\"\u003eSOURCE_CONFIG\u003c/var\u003e: the name of the workstation configuration that contains the source workstation\n - \u003cvar translate=\"no\"\u003eSOURCE_WORKSTATION\u003c/var\u003e: the ID of the source workstation\n\nFor more information, see [`gcloud workstations\ncreate`](https://cloud.google.com/sdk/gcloud/reference/workstations/create).\n\nFor API reference information, see\n[REST](/workstations/docs/reference/rest/v1/projects.locations.workstationClusters.workstationConfigs.workstations#resource:-workstation),\nand\n[RPC](/workstations/docs/reference/rpc/google.cloud.workstations.v1#workstation).\n\nCopy a workstation's files to a new workstation with a larger disk\n------------------------------------------------------------------\n\nWhen you clone a workstation, the new workstation retains the size of the source disk. If you need more storage, you can copy a workstation's files to a new workstation with a larger disk:\n\n1. Create a new destination workstation using a configuration that specifies a\n larger persistent disk.\n\n2. Start both the source workstation and the destination workstation.\n\n3. Access a terminal on the destination workstation by launching it in the\n Google Cloud console or connecting to it using SSH.\n\n4. From the terminal on the destination workstation, create a TCP tunnel to the\n source workstation using [`gcloud workstations\n start-tcp-tunnel`](https://cloud.google.com/sdk/gcloud/reference/workstations/start-tcp-tunnel).\n\n gcloud workstations start-tcp-tunnel \\\n --project=\u003cvar translate=\"no\"\u003eSOURCE_PROJECT\u003c/var\u003e \\\n --region=\u003cvar translate=\"no\"\u003eSOURCE_REGION\u003c/var\u003e \\\n --cluster=\u003cvar translate=\"no\"\u003eSOURCE_CLUSTER\u003c/var\u003e \\\n --config=\u003cvar translate=\"no\"\u003eSOURCE_CONFIG\u003c/var\u003e \\\n \u003cvar translate=\"no\"\u003eSOURCE_WORKSTATION\u003c/var\u003e \\\n \u003cvar translate=\"no\"\u003eWORKSTATION_PORT\u003c/var\u003e \\\n --local-host-port=:\u003cvar translate=\"no\"\u003eLOCAL_PORT\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eWORKSTATION_PORT\u003c/var\u003e: the port on the source workstation to which traffic should be sent (default: `22`).\n - \u003cvar translate=\"no\"\u003eLOCAL_PORT\u003c/var\u003e (Optional): the localhost port from which traffic will be sent. Valid port numbers are `1024` to `65535`. If you omit the `--local-host-port` flag or specify a port of `0` an unused port is selected automatically.\n\n When the tunnel is ready it will display the port number: \n\n Listening on port [\u003cvar translate=\"no\"\u003eLOCAL_PORT\u003c/var\u003e].\n\n5. In another terminal on the destination workstation, run `scp` and specify\n the port where the TCP tunnel is listening to copy the files from the source\n workstation.\n\n scp -rP \u003cvar translate=\"no\"\u003eLOCAL_PORT\u003c/var\u003e \\\n user@localhost:\u003cvar translate=\"no\"\u003e~/SOURCE_DIRECTORY\u003c/var\u003e \\\n \u003cvar translate=\"no\"\u003e~/DESTINATION_DIRECTORY\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSOURCE_DIRECTORY\u003c/var\u003e: the path to the directory to copy from the source workstation\n - \u003cvar translate=\"no\"\u003eDESTINATION_DIRECTORY\u003c/var\u003e: the path to the destination directory on the new workstation"]]