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.

VMs vs Rentals

Virtual MachineRental
RuntimeFull VM (TVM)Dedicated container
ImagesPre-configured VM imagesDocker images and templates
SSHssh -p <port> ubuntu@<public_ip>ssh <rental-id>@ssh.deployments.targon.com
Sudo passwordRequired at creation (not stored)Not required
VolumesNot supportedSupported
Custom env/commandsNot supportedSupported

For persistent storage and custom Docker images, use Rentals. For confidential GPU compute on bare-metal VMs, use Virtual Machines.

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.
  • Sudo password: Choose a sudo password at creation. Targon does not store or recover it—save it somewhere safe.

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. VM name:

    • Give your VM a descriptive name (lowercase letters, numbers, and hyphens).
  6. Password:

    • Set the sudo password for the VM. This password is not saved nor recoverable—store it securely before deploying.
  7. 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

Use your sudo password when running commands that require elevated privileges.

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 (EditExposed 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, provide vm_config.password, and choose an image from the VM images endpoint:

curl -X POST https://api.targon.com/tha/v2/workloads \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-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": {
"password": "your-sudo-password"
}
}'

List available VM images:

curl -X GET https://api.targon.com/tha/v2/workloads/vm-images \
-H "Authorization: Bearer <YOUR_API_KEY>"

Filter inventory for VM tiers:

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