Configuring GCP to create desktop VMs
Agents are designed to be capable of operating on desktop VMs. Running a full VM locally can consume a fair amount of resources, it’s often preferred to run the VM in the cloud. This section will walk you through how to set up a GCP account from scratch to run a VM.
Prerequisites
- A valid email address
- A credit card for billing (GCP offers a free tier and $300 in free credits for new users)
Step 1: Create a GCP Account
- Go to the Google Cloud Platform website.
- Click on the Get started for free button.
- Follow the on-screen instructions to create a new Google account or sign in with an existing Google account.
- Set up your billing information to access the free tier and free credits.
Step 2: Set Up a New Project
- Once logged into the GCP Console, click on the Select a project dropdown at the top of the page.
- Click on New Project.
- Enter a project name, select a billing account, and choose a location.
- Click on Create.
Step 3: Enable the Compute Engine API
- In the GCP Console, go to the Navigation menu > API & Services > Library.
- Search for Compute Engine API.
- Click on Compute Engine API and then click on Enable.
Step 4: Ensure Necessary Permissions
- As the owner of the project, you already have the necessary permissions to manage Artifact Registry repositories. If you are using a different account, ensure that it has the Editor role at the project level.
Step 5: Install and Configure Google Cloud SDK (gcloud CLI)
- Download and install the Google Cloud SDK.
- Open a terminal or command prompt.
- Initialize the SDK with the following command:
- Follow the on-screen prompts to log in with your Google account and set the default project.
NOTE: If you already have other gcloud accounts configured for your work or for other projects you should see something like the following:
The easiest is to choose [2] to create a new configuration which will you keep your old configurations. However, if you do not wish to keep old accounts you can choose to [1] to re-initialize the settings.
If you choose two you will be prompted to name the configuration, so name it something clear to differentiate it from other configs and then you should see the following:
Choose 2 and you will be redirected to your browser to click through the authentication with your Google enabled email account and password.
At the end of the of the configuration process you should see an asterix next to your new email address to indicate that it is the default for logging into gcloud.
You may run gcloud config configurations list
to see the list of configurations available and then gcloud config configurations activate NAME
, where NAME is the friendly name you have choosen for any given account in the first column of the list.
Step 6: Authenticate the CLI Using Application-Default Login
- Authenticate the gcloud CLI with your user account:
Follow the on-screen prompts to log in with your Google account. This command sets up application-default credentials for the CLI.
Step 7: Set up the Project in CLI
Step 8: Verify Permissions
- Verify that the CLI is authenticated and can access the project:
If this is your first GCP account, you will see only one account listed. If you have multiple, you will see an *
next to the active account like so:
- Verify that the Compute Engine API is enabled:
You should see the following:
- Verify that project is set up:
Additional Considerations: Quotas
By default, GCP provides sufficient quotas for most users. However, if you need to increase quotas for your project:
- Go to the Navigation menu > IAM & Admin > Quotas.
- Filter by the quota you need to increase (e.g.,
CPUs
). - Select the quota and click on Edit Quotas.
- Fill out the request form and submit it. Google will review your request and notify you of the outcome.
Conclusion
You have now successfully created a GCP account, set up the necessary permissions, and authenticated the CLI using application-default login to create GCE VM instances. For more advanced configurations and management, refer to the GCP documentation.
If you have not already run through our Quickstart to setup SurfKit, please do that now.
Once you’ve done that, you’re ready to create a GCP cloud VM for an agent to use with the following command:
Replace my-surfkit-vm
with whatever friendly name you want to use.