Create a virtual GPU-accelerated Linux workstation

This tutorial shows how to create a virtual Linux workstation running CentOS with an attached display-capable GPU. Google Cloud offers three display-capable GPUs: NVIDIA T4, NVIDIA Tesla P4, and NVIDIA Tesla P100.

To create a Windows workstation, see the tutorial for Creating a virtual GPU accelerated Windows workstation.

After you create the virtual workstation, you learn how to remotely access it using HP Anyware (formerly Teradici CAS), using PC-over-IP (PCoIP®) technology. PCoIP is a remote desktop protocol widely used in the media and entertainment, game development, architecture, and engineering industries. PCoIP offers features essential to these types of workloads–such as color accuracy, support for multiple monitors, lossless display, and tablet pressure sensitivity.

This tutorial assumes you are familiar with the Linux command line.


  • Create a Compute Engine instance with a GPU. This instance serves as the foundation for a virtual workstation.
  • Install NVIDIA drivers on the virtual workstation.
  • Install HP Anyware software on the virtual workstation.
  • Connect to the virtual workstation from your local computer by using a PCoIP software client.


This tutorial uses the following billable component of Google Cloud:

You can use the pricing calculator to generate a cost estimate based on your projected usage. As of April 2023, the approximate cost for a typical media workstation configuration illustrated in this tutorial is US$1.36 per hour.

The resources that make up the virtual workstation and the factors that affect cost in this tutorial are:

Internet egress represents data that streams from your virtual workstation to your local display client and is billed at internet egress rates. Variables that affect data egress during a PCoIP session are bandwidth, screen resolution, number of display monitors, applications used, and the type of activity on each monitor. The cost in the example is based on an average usage of 10 Mbps. Teradici's Session Planning Guide can help you understand different workload requirements.

Before you begin

This tutorial uses gcloud and gsutil commands, which you can run from a Cloud Shell instance launched from the Google Cloud console . If you want to use gcloud and gsutil on your local workstation, install the Google Cloud CLI. The tutorial shows you how to run commands in Cloud Shell; if you use the gcloud CLI on your workstation, adjust the instructions accordingly.

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project. Learn how to check if billing is enabled on a project.

  4. Enable the Compute Engine API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project. Learn how to check if billing is enabled on a project.

  7. Enable the Compute Engine API.

    Enable the API

In addition, make sure you have the following:

  • A Google Cloud project with quota for virtual workstation GPUs in your selected zone. You can get a listing of GPU availability using the gcloud compute accelerator-types list command.
  • A Google Chrome browser to access the Google Cloud console.
  • The latest PCoIP Client software for Windows, Mac, or Linux to access the virtual workstation.
  • An account on to download the HP Anyware software. Account registration is free.
  • An HP Anyware software license. You can request a trial license, or contact your Teradici representative and ask for a trial registration code to use for this virtual workstation.


The following diagram shows the components that are used in this tutorial to deploy a single virtual workstation. Optional components shown in the diagram include different ways to connect to your virtual workstation, a shared-storage appliance, an additional instance for serving third-party licenses, and additional infrastructure representing a render or compute farm.

Virtual workstation architecture.

Choose an accelerator

An important factor when you deploy a virtual workstation is the latency between your location and the instance you create. The lower the latency, the better the experience. Therefore, you want to work in a zone that's geographically closest to you. To learn more about where the different GPUs are available, see GPU regions and zones availability.

  1. Open Cloud Shell. (If you're using the gcloud CLI, open a terminal window on your computer.)

    Go to Cloud Shell

  2. Get a list of the zones in which GPUs are available:

    gcloud compute accelerator-types list

    Take note of the region and zone that's physically closest to you.

  3. Set the zone that you want to work with:

    gcloud config set compute/zone ZONE

    Replace ZONE with the name of the zone you're using, such as us-west2-b.

Choose a machine type

You can attach NVIDIA T4 GPUs to any predefined or custom N1 machine type. Virtual machines with one or more GPUs have a maximum number of vCPUs for each GPU you add to the instance. For example, each NVIDIA Tesla T4 GPU lets you have up to 48 vCPUs and up to 312 GB of memory in your instance machine type. To see the available vCPU and memory ranges for different GPU configurations, see the GPUs list.

The example in this tutorial consists of an 8-vCPU virtual workstation, which is well under the limit of 48 vCPUs for a single NVIDIA T4 GPU.

Create the virtual workstation

  1. In Cloud Shell, create the Compute Engine virtual workstation instance:

    gcloud compute instances create NAME \
        --zone=ZONE \
        --machine-type=MACHINE_TYPE \
        --accelerator type=ACCELERATOR,count=NUM-GPUS \
        --maintenance-policy="TERMINATE" \
        --image-project=centos-cloud \
        --image-family=centos-7 \
        --boot-disk-size=SIZE \

    Replace the following:

    • NAME is the name of your workstation.
    • ZONE is the zone in which to create the VM.
    • MACHINE_TYPE is the predefined or custom machine configuration.
    • ACCELERATOR is the type of GPU you want to attach, such as nvidia-tesla-t4-vws.
    • NUM-GPUS is the number of GPUs to attach to the VM.
    • SIZE is the size of the boot disk, in gigabytes.
    • NETWORK is the network in which to create the VM.

    For example:

    gcloud compute instances create test-vws \
        --machine-type custom-24-32768 \
        --accelerator type=nvidia-tesla-p4-vws,count=1 \
        --can-ip-forward \
        --maintenance-policy "TERMINATE" \
        --tags "https-server" \
        --image-project centos-cloud \
        --image-family centos-7 \
        --boot-disk-size 100

    After the virtual workstation is created, the machine status is displayed. The output looks similar to the following:

    NAME: test-workstation
    ZONE: us-west1-b
    MACHINE_TYPE: n1-standard-8
    INTERNAL_IP: 10.138.XX.XXX

    Note the virtual workstation's external IP address. You will use it later in the tutorial.

    You can retrieve the external IP address of your virtual workstation at any time using the Google Cloud console.

Sign in to your virtual workstation

After you create the virtual workstation, you sign in to the machine so that you can configure it.

  1. In Cloud Shell, connect to the new virtual workstation:

    gcloud compute ssh NAME
  2. Set your account password. Teradici PCoIP requires a user password.

    sudo passwd `whoami`

    When you're prompted, enter a password. You will use this password later in the tutorial to log on to your virtual workstation with the Teradici PCoIP Client.

Install graphics libraries and a window manager

The default Google Cloud CentOS 7 image is a minimal installation of CentOS 7.x. The next step is to install libraries that are necessary to run your virtual workstation as a graphics workstation. For this tutorial, you also install the KDE window manager.

  1. Update the software repositories:

    sudo yum -y update
  2. Install the required components:

    sudo yum -y install \
      kernel-devel-$(uname -r) kernel-headers-$(uname -r)
    sudo yum -y groupinstall \
      "KDE desktop" "X Window System" "Fonts" \
      "Development Tools" "Server with GUI"
  3. Reboot the workstation:

    sudo reboot

    Your connection from Cloud Shell closes.

Install the NVIDIA driver

NVIDIA T4, NVIDIA Tesla P4, and NVIDIA Tesla P100 GPUs work on Google Cloud only with qualified NVIDIA RTX Virtual Workstation drivers for visualization workloads. These drivers can be downloaded from a public storage bucket.

  1. When the virtual workstation has restarted, in Cloud Shell, reconnect to the virtual workstation:

    gcloud compute ssh NAME
  2. Verify the system has the correct kernel headers installed:

    sudo yum -y install kernel-devel-$(uname -r)
    kernel-headers-$(uname -r)
  3. To install the latest NVIDIA RTX Virtual Workstation driver, follow the instructions (Step 3, only).

  4. Reboot the workstation:

    sudo reboot

Install HP Anyware software

HP Anyware software provides a graphics agent that runs on your virtual workstation, delivering the desktop to your hardware or software client.

  1. When the virtual workstation has restarted, in Cloud Shell, reconnect to the virtual workstation:

    gcloud compute ssh NAME
  2. Add the Teradici software repository:

    curl -1sLf | sudo -E distro=el codename=7 bash
  3. Update the software repositories:

    sudo yum -y update
  4. Optional: Install USB dependencies, if you need to support USB devices other than keyboards, mice, and pointer devices.

    sudo yum -y install usb-vhci
  5. Install the HP Anyware software:

    sudo yum -y install pcoip-agent-graphics
  6. Set display state to graphical:

    sudo systemctl set-default
  7. Reboot the virtual workstation:

    sudo reboot

Register the PCoIP graphics agent

To use the Teradici Graphics Agent, you must have a license, as noted earlier.

  1. In Cloud Shell, activate your HP Anyware software license:

    pcoip-register-host --registration-code=REGISTRATION-CODE
  2. Reboot the virtual workstation:

    sudo reboot

Create a firewall rule

The PCoIP client communicates with your virtual workstation using several ports. You must set firewall rules that allow traffic to your virtual workstation.

  • In Cloud Shell, on your local computer (not on the virtual workstation), create a firewall rule that opens the required ports:

    gcloud compute firewall-rules create allow-pcoip \
        --action=ALLOW \
        --rules=tcp:443,tcp:4172,udp:4172 \

Sign in to your virtual workstation using the PCoIP client

  1. On your local computer, go to the PCoIP Clients section on the Teradici support page, and then download, install, and launch the PCoIP Software Client application for your operating system.

  2. In the Host Address or Registration Code field, enter the external IP address of your virtual workstation. If you want, you can enter a name for the connection.

    By default, PCoIP traffic is encrypted using AES-256. However, Teradici Cloud Access Software uses a self-signed certificate that's issued by Teradici. This might trigger a verification warning when you connect.

    You can remove this warning by creating and installing your own custom security certificates. Or, you can suppress the warning by changing the client security mode. For the purposes of this tutorial, you can ignore this warning by clicking Connect Insecurely in the dialog.

  3. When you are connected, authenticate by entering the username and password that you created earlier for the virtual workstation.

    In a few seconds, you see your Linux desktop.

Test your virtual workstation

After you've deployed your virtual workstation, you can test performance and interactivity using a number of tools:

You can also learn more about Optimizing PCoIP performance based on your workload.

Clean up

To avoid incurring charges to your Google Cloud account for the resources used in this tutorial, either delete the project that contains the resources, or keep the project and delete the individual resources.

After you've finished the tutorial, clean up the resources you created on Google Cloud so you won't be billed for them in the future.

Stop your virtual workstation

Stopped virtual workstations incur costs for persistent disk, but can be restarted at any time. To stop your virtual workstation, run the following command in Cloud Shell:

gcloud compute instances stop test-vws

Delete the project

  1. In the Google Cloud console, go to the Manage resources page.

    Go to Manage resources

  2. In the project list, select the project that you want to delete, and then click Delete.
  3. In the dialog, type the project ID, and then click Shut down to delete the project.

Delete all the components

  1. Delete the virtual workstation.
  2. Delete the firewall rule.

What's next