Enable virtual displays on a VM Stay organized with collections Save and categorize content based on your preferences.
This document describes how to enable or disable virtual displays on a virtualmachine (VM) instance.
If an application running on your VM requires a display device, but you don'tneed the performance of a GPU, then configure your VM to use virtual displaydevices. By enabling virtual displays on a VM, you can run virtual displaydevices on the VM, such as remote system management tools, remote desktopsoftware, andscreen capturing.
Before you begin
- If you haven't already, set upauthentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.- Set a default region and zone.
Terraform
To use the Terraform samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.If you're using a local shell, then create local authentication credentials for your user account:
gcloudauthapplication-defaultlogin
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
Required roles
To get the permissions that you need to enable or disable virtual displays on a VM, ask your administrator to grant you theCompute Instance Admin (v1) (roles/compute.instanceAdmin.v1) IAM role on the project. For more information about granting roles, seeManage access to projects, folders, and organizations.
This predefined role contains the permissions required to enable or disable virtual displays on a VM. To see the exact permissions that are required, expand theRequired permissions section:
Required permissions
The following permissions are required to enable or disable virtual displays on a VM:
- To enable or disable virtual displays on an existing VM:
compute.instances.updateDisplayDeviceon the VM - To create a VM with virtual displays enabled:
compute.instances.createon the project- To use a custom image to create the VM:
compute.images.useReadOnlyon the image - To use a snapshot to create the VM:
compute.snapshots.useReadOnlyon the snapshot - To use an instance template to create the VM:
compute.instanceTemplates.useReadOnlyon the instance template - To assign alegacy network to the VM:
compute.networks.useon the project - To specify a static IP address for the VM:
compute.addresses.useon the project - To assign an external IP address to the VM when using a legacy network:
compute.networks.useExternalIpon the project - To specify a subnet for the VM:
compute.subnetworks.useon the project or on the chosen subnet - To assign an external IP address to the VM when using a VPC network:
compute.subnetworks.useExternalIpon the project or on the chosen subnet - To set VM instance metadata for the VM:
compute.instances.setMetadataon the project - To set tags for the VM:
compute.instances.setTagson the VM - To set labels for the VM:
compute.instances.setLabelson the VM - To set a service account for the VM to use:
compute.instances.setServiceAccounton the VM - To create a new disk for the VM:
compute.disks.createon the project - To attach an existing disk in read-only or read-write mode:
compute.disks.useon the disk - To attach an existing disk in read-only mode:
compute.disks.useReadOnlyon the disk
You might also be able to get these permissions withcustom roles or otherpredefined roles.
Pricing
There are no costs associated with enabling or disabling virtual displays on aVM.
Restrictions
For VMs with virtual displays enabled, the following limitations apply:
If your VM is running an x64-based Windows OS image earlier than version
v20190312, then, after enabling virtual displays on your VM, you mustinstall the virtual display driver as described in thisdocument. If your VM is running a later OS image version, then the driver isalready installed on the OS image.You can use a virtual display device on the VM only after the guest OS bootsand initializes the virtual display driver.
You can't use virtual display devices on VMs that run theSandy Bridge CPU platform.
You can't use virtual display devices onT2A Arm VMs.
Enable virtual displays on a VM
To enable virtual displays on a VM, select one of the following methodsdescribed in this document:
If your VM is running an x64-based Windows OS image earlier than versionv20190312, then, after you enable virtual displays on the VM,install the virtual display driver as described in thisdocument.
Create a VM with virtual displays enabled
To create a VM with virtual displays enabled, select one of the followingoptions:
Console
In the Google Cloud console, go to theCreate an instance page.
Specify the properties for the VM, including the name, zone, and machinetype.
In theDisplay device section, select theEnable display devicecheckbox.
To create the VM, clickCreate.
gcloud
To create a VM with virtual displays enabled, use thegcloud compute instances create commandwith the--enable-display-device flag.
gcloud compute instances createVM_NAME \ --enable-display-device \ --machine-type=MACHINE_TYPE \ --zone=ZONEReplace the following:
VM_NAME: the name of the VM.MACHINE_TYPE: the machine type to use for the VM.ZONE: the zone in which to create the VM.
Terraform
To create a VM with virtual displays enabled, use theTerraform resourcewith theenable_display argument set totrue.
For example, to create a VM in zoneus-central1-c with virtual displaysenabled, and specifyf1-micro as the machine type, use the followingresource:
resource "google_compute_instance" "instance_virtual_display" { name = "instance-virtual-display" machine_type = "f1-micro" zone = "us-central1-c" # Set the below to true to enable virtual display enable_display = true boot_disk { initialize_params { image = "debian-cloud/debian-11" } } network_interface { # A default network is created for all GCP projects network = "default" access_config { } }}REST
To create a VM with virtual displays enabled, make aPOST request to theinstances.insert method.In the request body, include theenableDisplay field set totrue.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances{ "name": "VM_NAME", "machineType": "zones/ZONE/machineTypes/MACHINE_TYPE", "disks": [ { "boot": true, "initializeParams": { "sourceImage": "project/IMAGE_PROJECT/global/images/IMAGE" } } ], "displayDevice": { "enableDisplay": true }, "networkInterfaces": [ { "network": "global/networks/default" } ]}Replace the following:
PROJECT_ID: the ID of the project in which to createthe VM.ZONE: the zone in which to create the VM.VM_NAME: the name of the VM.MACHINE_TYPE: the machine type to use for the VM.IMAGE_PROJECT: the image project that contains the OSimage—for example,debian-cloud. For more information about thesupported image projects, seePublic images.IMAGE: specify one of the following:A specific version of the OS image—for example,
debian-12-bookworm-v20240617.Animage family, which must beformatted as
family/IMAGE_FAMILY. This specifiesthe most recent, non-deprecated OS image. For example, if youspecifyfamily/debian-12, the latest version in the Debian 12image family is used. For more information about using imagefamilies, seeImage families best practices.
For more information about creating a VM, seeCreate and start a Compute Engine instance.
Enable virtual displays on an existing VM
Before enabling virtual displays on a VM, make sure tostop the VM.
To enable virtual displays on an existing VM, select one of the followingoptions:
Console
In the Google Cloud console, go to theVM instances page.
In theName column, click the name of the VM.
The details page of the VM opens.
ClickEdit.
The page to edit the VM's properties opens.
In theDisplay device section, select theEnable display devicecheckbox.
ClickSave.
gcloud
To enable virtual displays on an existing VM, use thegcloud compute instances update commandwith the--enable-display-device flag.
gcloud compute instances updateVM_NAME \ --enable-display-device \ --zone=ZONEReplace the following:
VM_NAME: the name of the VM.ZONE: the zone where the VM is located.
REST
To enable virtual displays on an existing VM, make aPOST request to theinstances.updateDisplayDevice method.In the request body, include theenableDisplay field and set it totrue.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/updateDisplayDevice{ "enableDisplay": true}Replace the following:
PROJECT_ID: the ID of the project where the VM islocated.ZONE: the zone where the VM is located.VM_NAME: the name of the VM.
Disable virtual displays on an existing VM
Before disabling virtual displays on a VM, make sure tostop the VM.
To disable virtual displays on an existing VM, select one of the followingoptions:
Console
In the Google Cloud console, go to theVM instances page.
In theName column, click the name of the VM.
The details page of the VM opens.
ClickEdit.
The page to edit the VM's properties opens.
In theDisplay device section, clear theEnable display devicecheckbox.
ClickSave.
gcloud
To disable virtual displays on an existing VM, use thegcloud compute instances update commandwith the--no-enable-display-device flag.
gcloud compute instances updateVM_NAME \ --no-enable-display-device \ --zone=ZONEReplace the following:
VM_NAME: the name of the VM.ZONE: the zone where the VM is located.
REST
To disable virtual displays on an existing VM, make aPOST request to theinstances.updateDisplayDevice method.In the request body, include theenableDisplay field and set it tofalse.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances/VM_NAME/updateDisplayDevice{ "enableDisplay": false}Replace the following:
PROJECT_ID: the ID of the project where the VM islocated.ZONE: the zone where the VM is located.VM_NAME: the name of the VM.
Install the virtual display driver
If you've enabled virtual displays on a Windows VM that runs a Windows OS imageearlier than versionv20190312, then, to use a virtual display device on theVM, you must install the virtual display driver provided by Google Cloud. If theVM runs a more recent OS image version, then the driver is already installed andyou can skip this section.
To install the virtual display driver on a VM with virtual displays enabled, dothe following:
Open a PowerShell terminal as an administrator.
Install the
google-compute-engine-driver-ggacomponent:googet install google-compute-engine-driver-gga
After you restart the VM, you canverify that the driver was correctly installed asdescribed in the next section.
Verify the virtual display driver installation
If you had to manuallyinstall the virtual display driver ona Windows VM as described in the previous section, then you can verify that theinstallation was successful by doing the following:
If you haven't already,connect to the Windows VM.
Open Device Manager.
In theDevice Manager list, in theDisplay adapters list, make surethat the Google Graphics Array (GGA) driver is listed.
If the driver isn't listed, thenreinstall the virtual display driver as described in thisdocument.
What's next
Learn how toset up Chrome Remote Desktop on Linux VMs.
Learn how toconnect to Windows VMs using RDP.
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.