Custom VM images
Create custom VM images for use in your sandboxes.
Last updated
Was this helpful?
Create custom VM images for use in your sandboxes.
Last updated
Was this helpful?
This guide explains how to create a custom Virtual machine (VM) image and use it as a sandbox host in a track.
The main benefit of using a custom VM image is that it allows you to pre-install your software and the files needed for a track. Your track will start faster, since software does not need to be installed as part of the track setup script.
Custom images can be have any disk size you like and are not restricted to the default 10GB that ships with the stock Instruqt images.
There are two ways to create a custom VM image:
Instruqt Host images allow you to create VM images directly inside your Instruqt team. You create Host images using the Web UI.
Click Settings → Host images.
Click Create image in the upper-right corner.
On the Image details page, enter an image name, and optionally provide a description and disk size (the default disk is 10GB).
Select a base image. You can use an Instruqt preset image, or choose your own.
Custom image names follow a PROJECT_ID/IMAGE_NAME
format.
At the bottom of the page, click Next.
On the Customize your image page, use the terminal and code editor tabs to edit your image by running install commands, adding files, etc.
Once you've finished customizing your image, click Save in the upper-right corner.
You can now reference your image in your sandboxes.
Instruqt host images follow a TEAM_NAME/IMAGE_NAME
format.
Open your browser and navigate to your GCP project on the Google Cloud Platform.
Click Compute Engine → VM instances.
Click [+] CREATE INSTANCE.
In the Name field, enter a name of your liking (ex: my-build-instance).
Click Change under Boot disk.
In the Operating system list, select your desired OS (ex: Ubuntu).
In the Version list, select the desired OS version (ex: Ubuntu 23.04 LTS).
Click Select.
Click Create.
Click SSH on the VM instance you created in step 1.
↳ This opens a new SSH-IN-BROWSER
window.
Modify your VM by running whatever commands you'd like.
Close the terminal.
Click ••• on your newly created VM instance, followed by Stop. And click Stop to confirm.
Under Storage, click Images on the navigation menu.
Click [+] Create Image.
In the Name field, enter a name of your liking (ex: ubuntu23-custom).
In the Source Disk list, select the disk from your instance (ex: my-build-instance).
For Location, choose Regional.
In the Select location list, select europe-west1 (Belgium).
Click Create. ↳ The custom image is built for you and shown on the Image page. Your custom image is ready when the Status column shows a green checkmark.
In Google Cloud there are Disk Images and Machine Images. In this guide, we only work with Disk Images. Machine Images will not work in Instruqt.
Click IAM & Admin → IAM on the navigation menu.
Click + Grant access to add a new principal.
In the New principals field, enter the following:
instruqt-track@instruqt-prod.iam.gserviceaccount.com
In the Select a role list, select Compute Image User
Click Save.
You are ready to incorporate the custom VM into your track.
Head over to your Web UI or Instruqt CLI to incorporate the custom VM image into your track:
Open your track from your Content.
In the Sandbox section, click Edit.
Click + Add a host.
Select the Virtual machine host type.
In the Hostname field, enter a name of your liking (ex: workstation
).
Select the Choose your own image type.
In the GCP compute image field, enter <YOUR-GCPPROJECT-ID>/<YOUR-IMAGE-NAME>
Select a machine type.
Click Show optional settings.
In the Shell field, enter /bin/bash
Click Save host.
Watch the video tutorial on how to use your own GCP project to host VM images.
You should have a Google Cloud Platform (GCP) project available or have your GCP admin for you.
Importing an existing image? If you are importing an existing image to GCP make sure to install the in your image. Instruqt requires the guest environment to bootstrap VMs.
is an open-source tool for creating identical VM images for multiple platforms from a single source configuration. See the for how to build VM images using Packer.