Skip to main content

Virtual Machines

This guide walks you through creating, configuring, and connecting to your first Targon Virtual Machine (VM).

What is a Virtual Machine?​

A Virtual Machine on Targon is a full VM running on the Targon Virtual Machine (TVM) platform—not a container. TVM uses Intel TDX for encrypted confidential compute and NVIDIA PCIe Confidentiality to protect GPU workloads in transit and at rest.

VMs are ideal when you need:

  • A traditional Linux environment with a dedicated public IP
  • Hardware-backed confidential compute on NVIDIA H200, H100, A100, and RTX GPUs
  • Direct SSH access as the ubuntu user

Preview: Virtual Machines are currently in beta. The feature is in high demand and may be out of stock. Unexpected issues, including potential data loss, may occur.

When to choose a VM​

Choose a Virtual Machine for confidential GPU compute, a dedicated public IP, and a traditional Linux environment. For fast, short-lived development and agent environments, use Sandboxes.

Before you begin​

To get the most out of Virtual Machines, you should be familiar with:

  • The command-line terminal: Basic shell commands and navigation.
  • SSH: You need an SSH key to connect to your VM.
  • Hostname (optional): Set the machine hostname at creation, or leave it blank to use the VM name.

Creating a Virtual Machine​

  1. Navigate to the Virtual Machines page:

    • Go to the Dashboard, open the Virtual Machines section, and click Create VM.
  2. Select VM image:

    • Choose from the available pre-configured VM images. Each image lists a display name and description to help you pick the right environment.
  3. Select VM configuration:

    • Pick a hardware tier (GPU or CPU). Available options depend on current inventory—H200, H100, A100, and RTX GPUs are supported for demanding AI workloads.
    • Check live availability on the Inventory page.
  4. Add SSH key:

    • Attach at least one SSH key for access. Add a new key or select an existing one from your account settings.
  5. Name and hostname (optional):

    • Give your VM a descriptive name (lowercase letters, numbers, and hyphens).
    • Set an optional hostname for the machine itself (RFC 1123: lowercase letters, digits, hyphens, dots; max 63 characters). If you omit it, Targon uses the workload name.
  6. Deploy: Click Start VM. Your VM will provision and become available once its status is running.

Connecting to your Virtual Machine​

Once your VM is running, connect over SSH.

  1. Copy the SSH command: On your VM's detail page in the dashboard, find the SSH command in the VM Status card.

  2. Open your terminal on your local machine.

  3. Paste and run the command. It looks like:

    ssh -p <SSH_PORT> ubuntu@<PUBLIC_IP>
    • <SSH_PORT>: The port assigned to your VM (not the default port 22).
    • <PUBLIC_IP>: The VM's public IP address.
    • User is always ubuntu.

    Example: If your VM's public IP is 203.0.113.42 and SSH port is 4022:

    ssh -p 4022 ubuntu@203.0.113.42

    If your private key is not the default, add -i /path/to/your/key:

    ssh -i ~/.ssh/id_ed25519 -p 4022 ubuntu@203.0.113.42

The hostname on the machine is the value you set at creation, or the workload name if you left hostname blank.

Service ports​

Depending on your VM's network mode, ports are exposed differently:

  • Shared network: Add or edit exposed ports from the VM detail page (Edit → Exposed Ports). Each port supports TCP or UDP with direct routing.
  • Passthrough network: All ports map 1:1 to the VM except 22, 4050, 5001, 8081, 8980, 8981, and 9899.

Active service URLs appear on the VM detail page under Service Ports once the VM is running.

Managing your Virtual Machine​

From the VM detail page you can:

  • Reboot: Restart the VM (available when status is running). Active connections are interrupted.
  • Edit ports: Update exposed ports on VMs with shared network mode.
  • View logs and events: Monitor provisioning progress and runtime output from the Logs and Events tabs.
  • Delete: Permanently remove the VM and its runtime. This action cannot be undone.

Connecting with VS Code​

Install the Remote - SSH extension and add an SSH host entry using the same connection string from the dashboard:

Host my-targon-vm
HostName <PUBLIC_IP>
Port <SSH_PORT>
User ubuntu

Open the folder on the remote host through VS Code's Remote Explorer.

Programmatic access​

Create and manage VMs through the Workloads API. Set type to VM, optionally set vm_config.hostname, and choose an image from the VM images endpoint:

curl -X POST https://api.targon.com/tha/v3/orgs/{org_slug}/workloads \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "my-confidential-vm",
"type": "VM",
"image": "<vm-image-name>",
"resource_name": "h200-small",
"ssh_keys": ["shk-def456ghi789"],
"vm_config": {
"hostname": "my-confidential-vm"
}
}'

List available VM images:

curl -X GET https://api.targon.com/tha/v3/orgs/{org_slug}/workloads/vm-images \
-H "Authorization: Bearer <YOUR_API_TOKEN>"

Filter inventory for VM tiers:

curl -X GET "https://api.targon.com/tha/v3/inventory?type=vm&gpu=true" \
-H "Authorization: Bearer <YOUR_API_TOKEN>"