If applications on your VM instances require a display device, but do not require the full power or cost of a GPU, you can configure your instances to use a virtual display device. These devices allow you to run remote system management tools and remote desktop software that require a display device.
Configure a virtual display device when you create a new instance or add a virtual display device to an existing instance while it is stopped. There is no cost to enable your instances with a virtual display device.
Before you begin
- If you want to use the command-line examples in this guide:
- Install or update to the latest version of the gcloud command-line tool.
- Set a default region and zone.
- If you want to use the API examples in this guide, set up API access.
Restrictions
- Google supports virtual display devices only on Windows instances that use any Windows images v20190312 or later.
- If your VM instance is running a Windows image that is older than v20190312, you must also manually install the device driver after enabling virtual displays for the instance. Images that are newer than v20190312 come preinstalled with the device drivers.
- Virtual display devices are functional only after the guest operating system boots and initializes the virtual display driver. You cannot use virtual display devices during POST or while the guest operating system is booting.
- Virtual display devices are not compatible with instances running the Sandy Bridge CPU platform.
Creating an instance with a virtual display device
Enable a virtual display device on an instance when you create a new instance. Alternatively, you can add a virtual display device to an existing instance.
Console
- Go to the Instances page.
- Click the Create instance button to create a new instance.
- Define the properties for the new instance including the machine type, zone, disk, and networking settings.
- In the Machine configuration section, click CPU platform and GPU to expand the machine type, GPU, and display device settings.
- Click Turn on display device to enable the virtual display device.
- At the bottom of the instance creation settings, click Create to create the instance.
gcloud
In the gcloud
command-line tool, use the
compute instances create
command and include the --enable-display-device
flag:
gcloud compute instances create [INSTANCE_NAME] --enable-display-device
where [INSTANCE_NAME]
is the name of the instance that you want to
create.
API
In the API, construct a POST
request to the
compute.instances.insert
method.
In the request body, include the instance properties as well as the
displayDevice
property with enableDisplay
set to true
.
POST https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances
{
"name": "[INSTANCE_NAME]",
"machineType": "zones/[ZONE]/machineTypes/[MACHINE_TYPE]",
"displayDevice": {
"enableDisplay": true
},
⋮
}]
where:
[INSTANCE_NAME]
is the name of the instance.[PROJECT_ID]
is your project ID.[ZONE]
is the zone where your instance is located.
After you create an instance with a virtual display device, you can configure remote desktop to remotely manage your Windows instance.
Adding or removing a virtual display device on an existing instance
You can enable a virtual display device on an existing instance. Alternatively, you can enable a virtual display device when you create a new instance.
Before you can enable or disable a virtual display device on a running instance, you must stop the instance.
Console
- Go to the Instances page.
- In the Name column, click the name of the instance where you want to add or remove the virtual display device.
- At the top of the instance details page, click Edit.
- In the Machine configuration section, click CPU platform and GPU to expand the machine type, GPU, and display device settings.
- Click Turn on display device to either enable or disable the virtual display device for this instance.
- At the bottom of the instance creation settings, click Save to save the instance settings.
gcloud
To add a virtual display device, use the
compute instances update
command in the gcloud
command-line tool and include the
--enable-display-device
flag:
gcloud compute instances update [INSTANCE_NAME] --enable-display-device
where [INSTANCE_NAME]
is the name of the instance that you want to
create.
To remove a virtual display device, use the
compute instances update
command in the gcloud
tool and include the
--no-enable-display-device
flag:
gcloud compute instances update [INSTANCE_NAME] --no-enable-display-device
where [INSTANCE_NAME]
is the name of the instance that you want to
create.
API
In the API, construct a POST
request to the
compute.instances.updateDisplayDevice
method. In the request body, include the enableDisplay
property. To enable
the virtual display device on this instance, set enableDisplay
to true
.
To disable the virtual display device on the instance, set enableDisplay
to false
.
POST https://compute.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]/updateDisplayDevice
{
"enableDisplay": [ENABLE_DISPLAY]
}
where:
[INSTANCE_NAME]
is the name of the instance where you want to enable or disable the virtual display device.[PROJECT_ID]
is your project ID.[ZONE]
is the zone where your instance is located.[ENABLE_DISPLAY]
is eithertrue
to enable the virtual display device on the instance orfalse
to disable the virtual display device on the instance.
After you create an instance with a virtual display device, you can configure remote desktop to remotely manage your Windows instance.
Installing the virtual display driver
Google provides a display driver that allows Windows instances to use virtual display devices correctly. The driver is required for several Compute Engine features. Google provides and supports this display driver only for Windows instances.
After you create an instance with a virtual display device or add a virtual display device to an existing instance, you can install the virtual display device on the instance using the following process:
- Connect to the Windows instance where the virtual display device is enabled.
- Open a PowerShell terminal as an administrator.
Run the
googet
installer to install thegoogle-compute-engine-driver-gga
component:googet install google-compute-engine-driver-gga
Restart the instance.
After you restart the instance, confirm the driver was installed by following the instructions below.
Verifying the virtual display driver install
If you had to manually install the device driver, follow these instructions to verify that the install was successful.
- Connect to the Windows instance where the virtual display device is enabled.
- Open the Run tool and run the
devmgmt.msc
Computer Management tool. - On the left navigation for the Computer Management tool, click Device Manager to see a list of devices.
- Under the Display adapters list, check to ensure that the
Google Graphics Array driver is listed.
- If the Microsoft Basic Display adapter is listed as a display adapter instead of the Google Graphics Array, repeat the driver install process and check the driver again.
What's next
- Learn about different methods for connecting to Windows instances.
- Learn how to stop and start an instance.