Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Windows
Para transferir arquivos para instâncias de máquina virtual (VM) do Compute Engine, opções
diferentes estão disponíveis, dependendo do sistema operacional
da estação de trabalho e da instância de destino.
Como transferir arquivos por meio do Cloud Storage
Os buckets do Cloud Storage podem ser usados como um ponto
de transferência entre você e suas VMs. É possível usar um navegador da Web, a CLI do Google Cloud ou uma linguagem de programação para transferir arquivos entre o Cloud Storage e as VMs do Compute Engine.
Diferentes tipos de credenciais podem ser usados para a etapa de upload e de download conforme suas necessidades:
Opcional: exclua os arquivos que não são mais necessários
para evitar cobranças indesejadas no armazenamento.
Se você precisar transferir arquivos na outra direção, reverta o processo. Verifique se a
conta que está fazendo upload do arquivo tem acesso de gravação no bucket.
Transferir arquivos com o Google Cloud CLI
A Google Cloud CLI fornece um utilitário de transferência de arquivos Secure Copy Protocol (SCP) por meio de uma conexão SSH estabelecida.
Para transferir arquivos usando SCP, faça o seguinte:
Ative o SSH na sua VM do Windows, se ainda não estiver
ativado.
LOCAL_FILE_PATH: o caminho do arquivo na sua máquina
VM_NAME: o nome da VM
REMOTE_DIR: um diretório na máquina remota
Também é possível copiar arquivos e diretórios da máquina remota. No exemplo
a seguir, copiamos de maneira recursiva um diretório da origem para o destino:
Como transferir arquivos por meio do cliente RDP do Windows
Muitos clientes de RDP da Microsoft
oferecem suporte à conexão do armazenamento local com uma VM remota do Windows, mas isso
não é aceito por todos os clientes.
Siga as instruções relativas ao sistema operacional do dispositivo do qual ou para qual
os arquivos estão sendo transferidos:
Windows
Transfira arquivos pelo app Conexão de Área de Trabalho Remota (%systemroot%/system32/mstsc.exe) integrado fazendo o seguinte:
Abra o aplicativo Conexão de Área de Trabalho Remota.
Abra Mostrar opções.
Clique na guia Recursos locais.
Em Dispositivos e recursos locais, clique em Mais.
Marque a caixa de seleção Drives ou escolha o drive que você quer.
Conecte-se e faça login na VM normalmente.
Abra o Explorador de Arquivos na máquina remota e veja o drive montado.
Use este drive para transferências de arquivos enquanto estiver conectado.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-03 UTC."],[[["\u003cp\u003eCloud Storage, the Google Cloud CLI, and the Windows RDP client are the main methods for transferring files to Compute Engine Windows VM instances, with the availability depending on the workstation's OS.\u003c/p\u003e\n"],["\u003cp\u003eCloud Storage can serve as an intermediary for file transfers between your computer and a VM, and it requires setting up a bucket with the correct IAM permissions for uploading and downloading files.\u003c/p\u003e\n"],["\u003cp\u003eThe Google Cloud CLI facilitates file transfers via SCP over an SSH connection, allowing you to copy files to and from your VM using \u003ccode\u003egcloud compute scp\u003c/code\u003e command, and is only supported for VMs running Windows Server 2019 or later.\u003c/p\u003e\n"],["\u003cp\u003eThe Windows RDP client supports mounting local storage to a remote Windows VM for file transfer, through the Remote Desktop Connection app, macOS RDP client or the Android app, and steps vary slightly depending on the client.\u003c/p\u003e\n"]]],[],null,["Windows\n\n*** ** * ** ***\n\nTo transfer files to Compute Engine virtual machine (VM) instances, different\noptions are available depending on your workstation OS and the target instance\nOS.\n\n| Transfer from | To Windows instances |\n|----------------------------|-----------------------------------------------------------------------------------------------|\n| Linux | - [Cloud Storage](#gcstransfer) - [Google Cloud CLI](#transfergcloud) |\n| Windows, macOS, or Android | - [Cloud Storage](#gcstransfer) - [Google Cloud CLI](#transfergcloud) - [RDP Client](#winrdp) |\n\nTransferring files through Cloud Storage\n\n\n[Cloud Storage](/storage) buckets can be used as a transfer\npoint between you and your VMs. You can use a web browser, the Google Cloud CLI, or a\nprogramming language to transfer files between Cloud Storage and Compute Engine VMs.\n\n\nDifferent credential types can be used for the upload and download step to best suit your needs:\n\n- [Accessing data on a user's behalf](/storage/docs/user-accounts) is best for single use operations, or resources that you are primarily responsible for.\n- Consider [service account credentials](/compute/docs/access/create-enable-service-accounts-for-instances#using) for scaled deployments and shared resource scenarios.\n\n\u003cbr /\u003e\n\n\nTo use Cloud Storage to transfer files between a computer and a VM, do the following:\n\n1. [Create a Cloud Storage bucket](/storage/docs/creating-buckets) if you don't have an existing bucket to use for file transfers.\n2. [Use IAM permissions](/storage/docs/access-control/using-iam-permissions) to modify the access to the bucket:\n - Accounts uploading file(s) to the bucket should have the **Storage Object Admin** granted.\n - Accounts downloading file(s) should have the **Storage Object Viewer** role granted.\n3. Log in to the source device and [upload the files](/storage/docs/uploading-objects) to the bucket.\n4. Log in to the destination device and [download the\n files](/storage/docs/downloading-objects) from the bucket completing the file transfer.\n5. Optional: [Delete files](/storage/docs/deleting-objects) that you no longer need to prevent any unwanted storage charges.\n\n\u003cbr /\u003e\n\n\nIf you need to transfer files in the other direction, you can reverse the process. Ensure that the\naccount uploading the file has write access to the bucket.\n\nTransfer files using the Google Cloud CLI\n\n\n| **Note:** Transferring files using the Google Cloud CLI is only supported on VMs running Windows Server 2019 and later.\n\n\u003cbr /\u003e\n\n\nGoogle Cloud CLI provides a Secure Copy Protocol (SCP) file transfer utility over an established\nSSH connection.\n\n\nTo transfer files using SCP, do the following:\n\n1. [Enable SSH](/compute/docs/connect/windows-ssh) on your Windows VM if it's not already enabled.\n2. [Review your firewall rules](/vpc/docs/using-firewalls#listing-firewall-rules-vpc) and confirm that SSH connections in on port `22` are permitted; if not [create a SSH firewall rule](/vpc/docs/using-firewalls#common-use-cases-allow-ssh).\n3. Ensure [gcloud CLI is installed](/sdk/docs/install) on the source device containing the files to be transferred.\n4. Use the [gcloud compute scp](/sdk/gcloud/reference/compute/scp) command to transfer the files to the destination machine.\n\n\u003cbr /\u003e\n\nThe following example copies a file from your workstation to the home directory of the VM: \n\n```\ngcloud compute scp LOCAL_FILE_PATH VM_NAME:REMOTE_DIR\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eLOCAL_FILE_PATH\u003c/var\u003e: the path to the file on your machine\n- \u003cvar translate=\"no\"\u003eVM_NAME\u003c/var\u003e: the name of your VM\n- \u003cvar translate=\"no\"\u003eREMOTE_DIR\u003c/var\u003e: a directory on the remote machine\n\nYou can also copy files and directories in reverse from the remote machine. The\nfollowing example recursively copies a directory from the source to the destination: \n\n```\ngcloud compute scp --recurse VM_NAME:REMOTE_DIR LOCAL_FILE_PATH\n```\n\nFor more information, see the\n[`gcloud compute scp` reference documentation](/sdk/gcloud/reference/compute/scp).\n\nTransferring files through the Windows RDP client\n\nMany first party [Microsoft RDP Clients](https://docs.microsoft.com/windows-server/remote/remote-desktop-services/clients/remote-desktop-clients)\nsupport connecting local storage to a remote Windows VM; however\nthis is not supported on all clients.\n\nFollow the instructions for the operating system of the device you're\ntransferring files to or from: \n\nWindows\n\nTransfer files through the built-in Remote Desktop Connection app\n(`%systemroot%/system32/mstsc.exe`) by doing the following:\n\n1. Open the **Remote Desktop Connection** application.\n2. Expand **Show Options**.\n3. Click the **Local Resources** tab.\n4. Under **Local devices and resources** , click **More**.\n5. Select the **Drives** checkbox, or pick your chosen drive.\n6. Connect and login to the VM as you would normally.\n7. Open **File Explorer** on the remote machine and see your drive mounted.\n8. Use this drive for file transfers while you are connected.\n\nmacOS\n\nTransfer files through the [Remote Desktop Microsoft RDP Client for macOS](https://apps.apple.com/app/microsoft-remote-desktop/id1295203466)\nby doing the following:\n\n1. Click the **+** icon in the top left.\n2. Select **Add PC**.\n3. Under the **Folders** tab, enable **Redirect folders**.\n4. Press **+** icon in the bottom left.\n5. Choose a folder that you would like redirected.\n6. Connect and login to the VM as you would normally.\n7. Open **File Explorer** on the remote machine and see your folder mounted.\n8. Use this drive for file transfers while you are connected.\n\nAndroid\n\nTransfer files through the [Remote Desktop](https://play.google.com/store/apps/details?id=com.microsoft.rdc.androidx)\napp from Microsoft.\n\n1. Press the **+** icon in the top right.\n2. Select **Add PC**.\n3. Under **Device \\& Audio Redirection** , enable **Storage**.\n4. Connect and login to the VM as you would normally.\n5. Open **File Explorer** on the remote machine and see your storage mounted.\n6. Use this drive for file transfers while you are connected.\n\nWhat's next\n\n- [Connect to your VMs](/compute/docs/instances/connecting-to-windows) to use the files that you transferred."]]