Does IAP Desktop support .rdp files, or anything similar?
If you frequently use Remote Desktop, then you might be used to creating .rdp
files for the servers you
connect to most often. An .rdp
file contains the necessary details to establish a Remote Desktop connection,
and also allows you to set preferences affecting the screen resolution, audio settings, shared devices, and
other settings.
IAP Desktop
does not support .rdp
files, and that’s for good reason: To create an IAP TCP forwarding tunnel, IAP Desktop
needs the project ID, zone, and the instance name of a VM. An .rdp
file only contains a computer name or IP
address (in the full address
field) – and unfortunately, that’s not enough:
- Computer names are often equivalent to instance names, but they do not have to be.
- Instance names are unique within a project, but not across projects. So it’s not possible to derive the project ID from the instance name alone.
IP addresses are not much more helpful either: A private IP address is not unique across projects, and you cannot easily determine a project ID from a public IP address either.
URL shortcuts
There is another way to open IAP Desktop and connect to a server in a single click however: By creating a URL shortcut.
If you enable the browser integration
feature, IAP Desktop registers the iap-rdp:
protocol scheme in the Windows registry.
Custom protocol schemes are not only recognized by all major browsers, but also by Windows
itself: As a result, you can use an iap-rdp:
URL pretty much anywhere Windows allows you
to put a http:
url – and that includes shortcut files.
Suppose you have a project my-project
and a VM named my-vm
running in zone us-central1-a
,
then you can create a shortcut file and point it to the URL iap-rdp:///my-project/us-central1-a/my-vm
:
You can encode additional preferences by adding query parameters. For example, the following URL causes IAP Desktopto pre-populate the user and domain fields, and to connect to port 13389 instead of 3389:
iap-rdp:///my-project/us-central1-a/my-vm?User=bob&Domain=corp&RdpPort=13389
Note however that IAP Desktop does not let you embed passwords in URLs.
If you double-click the shortcut file, IAP Desktop opens and immediately connects to the VM
instance – just like double-clicking an .rdp
file would launch the Microsoft Remote Desktop client.
For further details about the url format and supported parameters, see Browser Integration in the IAP Desktop docs.