Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Connection problems using Windows VM on GCP

When working in the VM, it often freezes and then display a 'Reconnecting' dialogue box with the message "The connection has been lost. Attempting to reconnect to your session.. Connection attempt: 1 of 5."

This is the process I am following:

  1. Create VM instance under Compute Engine > VM Instance > Create instance
  2. Under the Boot Disk options I select 'Windows Server' as the Operating System and 'Windows Server 2022 Datacenter' as the Version
  3. In Command Prompt (using a Windows 11 Laptop) I enter this type of command following these instructions `gcloud compute start-iap-tunnel my-instance 3389 --local-host-port=localhost:3333 --zone=ZONE`
  4. I then access the VM using Remote Desktop Connection by specifying localhost: 3333 as the Computer (I can access and use the VM fine, except for the connection issues)

The reason I am accessing a Windows VM is so that I can use RStudio. An alternative solution would be to find a way of using RStudio without a Windows VM. I have come across products like RStudio Workbench Standard for GCP, RStudio Server for GCP, and RStudio Connect for GCP and I don't understand what the different products are for. Any advice would be appreciated!

Thanks!

1 1 807
1 REPLY 1

Hi @mark_chia ,

Could you please check whether the "
The connection has been lost. Attempting to reconnect to your session" problem exists when you use IAP Desktop[1] to connect to your VM?

[1] https://cloud.google.com/compute/docs/instances/connecting-to-windows#iap-desktop - After you get to the page, scroll past the decision-flow chart to the section that has the instructions to connect by using IAP Desktop.