Transfer files to Windows VMs Stay organized with collections Save and categorize content based on your preferences.
To transfer files to Compute Engine virtual machine (VM) instances, differentoptions are available depending on your workstation OS and the target instanceOS.
| Transfer from | To Windows instances |
|---|---|
| Linux | |
| Windows, macOS, or Android |
Transferring files through Cloud Storage
Cloud Storage buckets can be used as a transfer point between you and your VMs. You can use a web browser, the Google Cloud CLI, or a programming language to transfer files between Cloud Storage and Compute Engine VMs.
Different credential types can be used for the upload and download step to best suit your needs:
- Accessing data on a user's behalf is best for single use operations, or resources that you are primarily responsible for.
- Consider service account credentials for scaled deployments and shared resource scenarios.
To use Cloud Storage to transfer files between a computer and a VM, do the following:
- Create a Cloud Storage bucket if you don't have an existing bucket to use for file transfers.
- Use IAM permissions to modify the access to the bucket:
- Accounts uploading file(s) to the bucket should have theStorage Object Admin granted.
- Accounts downloading file(s) should have theStorage Object Viewer role granted.
- Log in to the source device andupload the files to the bucket.
- Log in to the destination device anddownload the files from the bucket completing the file transfer.
- Optional:Delete files that you no longer need to prevent any unwanted storage charges.
If you need to transfer files in the other direction, you can reverse the process. Ensure that the account uploading the file has write access to the bucket.
Transfer files using the Google Cloud CLI
Google Cloud CLI provides a Secure Copy Protocol (SCP) file transfer utility over an established SSH connection.
To transfer files using SCP, do the following:
- Enable SSH on your Windows VM if it's not already enabled.
- Review your firewall rules and confirm that SSH connections in on port
22are permitted; if notcreate a SSH firewall rule. - Ensuregcloud CLI is installed on the source device containing the files to be transferred.
- Use the
gcloud compute scpcommand to transfer the files to the destination machine.
The following example copies a file from your workstation to the home directory of the VM:
gcloud compute scpLOCAL_FILE_PATHVM_NAME:REMOTE_DIR
Replace the following:
LOCAL_FILE_PATH: the path to the file on your machineVM_NAME: the name of your VMREMOTE_DIR: a directory on the remote machine
You can also copy files and directories in reverse from the remote machine. Thefollowing example recursively copies a directory from the source to the destination:
gcloud compute scp --recurseVM_NAME:REMOTE_DIRLOCAL_FILE_PATH
For more information, see thegcloud compute scp reference documentation.
Transferring files through the Windows RDP client
Many first partyMicrosoft RDP Clients support connecting local storage to a remote Windows VM; howeverthis is not supported on all clients.
Follow the instructions for the operating system of the device you'retransferring files to or from:
Windows
Transfer files through the built-in Remote Desktop Connection app(%systemroot%/system32/mstsc.exe) by doing the following:
- Open theRemote Desktop Connection application.
- ExpandShow Options.
- Click theLocal Resources tab.
- UnderLocal devices and resources, clickMore.
- Select theDrives checkbox, or pick your chosen drive.
- Connect and login to the VM as you would normally.
- OpenFile Explorer on the remote machine and see your drive mounted.
- Use this drive for file transfers while you are connected.
macOS
Transfer files through theRemote Desktop Microsoft RDP Client for macOS by doing the following:
- Click the+ icon in the top left.
- SelectAdd PC.
- Under theFolders tab, enableRedirect folders.
- Press+ icon in the bottom left.
- Choose a folder that you would like redirected.
- Connect and login to the VM as you would normally.
- OpenFile Explorer on the remote machine and see your folder mounted.
- Use this drive for file transfers while you are connected.
Android
Transfer files through theRemote Desktopapp from Microsoft.
- Press the+ icon in the top right.
- SelectAdd PC.
- UnderDevice & Audio Redirection, enableStorage.
- Connect and login to the VM as you would normally.
- OpenFile Explorer on the remote machine and see your storage mounted.
- Use this drive for file transfers while you are connected.
What's next
- Connect to your VMs to usethe files that you transferred.
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-15 UTC.