IMVEEDev Portal

Installation

Step-by-step guide for setting up the SimulationLab on a KVM-capable host. At the end you will have an isolated lab environment with firewall, Active Directory and Linux clients.

:::info [Recommended: One-Click Deployment] For setting up on any test server there is the one-click flow (1 command: host prep + VMs + configuration + agent enrollment) — TeamCity build or make bootstrap TARGET=... SIZE=...: One-Click Deployment. This page describes the manual setup (step by step). :::

Prerequisites

  • Debian/Ubuntu host with KVM support (kvm-ok)
  • make, terraform, ansible installed
  • Access to /mnt/data/simulationlab/ (separate volume, at least 200 GB)
  • Access to k8s cluster (kubectl configured, secret agent-tokens in namespace imvee-dev present)

Initial Setup

1. Clone the Repository

git clone https://gitlab.com/imvee/simulationlab.git
cd simulationlab

2. Prepare the Host

One-time — installs dependencies and downloads cloud images:

make setup   # requires sudo

This step:

  • Installs libvirt, qemu-kvm, terraform, ansible
  • Creates storage directories under /mnt/data/simulationlab/
  • Downloads Ubuntu 24.04 cloud image

3. Generate SSH Key (optional)

ssh-keygen -t ed25519 -f ~/.ssh/simulationlab -N "" -C "simulationlab@$(hostname)"

Enter the public key in terraform/terraform.tfvars:

ssh_public_key = "ssh-ed25519 AAAA... simulationlab@host"

:::info [Password auth is the default] All Linux VMs use password-based SSH authentication (user ubuntu, on Kali kali). The password for all Linux VMs lives in Infisical (simlab-linux-password) and is loaded by Terraform/Ansible automatically from the local copy .secrets/linux_password (gitignored). SSH keys are optional (Terraform variable ssh_public_key) and not required. :::

4. Initialise Terraform

make init
make plan    # review the plan
make apply   # create VMs

5. Secrets and Enrollment Token

All lab secrets live in Infisical (env dev) — source of truth. No passwords in Git:

Infisical SecretPurposeLocal copy (gitignored)
simlab-linux-passwordSSH password for all Linux VMs.secrets/linux_password
simlab-windows-passwordWindows admin password.secrets/windows_admin_password
# Create local copies from Infisical (one-time, or after password rotation)
mkdir -p .secrets
# Add the values from Infisical (never commit to Git!)
echo "<simlab-linux-password>" > .secrets/linux_password
echo "<simlab-windows-password>" > .secrets/windows_admin_password
chmod 600 .secrets/linux_password .secrets/windows_admin_password

The enrollment token (short-lived) is passed as extra var satellite_enrollment_token when running make configure-linux. Token sources: SOCSuite UI (Settings → Agents → Tokens) or scripts/gen-enrollment-token.sh.

# Generate the token via script (SOCSuite API, writes enroll.env)
ENV_NAME=dev bash scripts/gen-enrollment-token.sh

# Deploy manually with token
ENROLLMENT_TOKEN=<TOKEN> bash scripts/deploy-agents.sh

6. Verify Inventory

All VMs have static IPs in the LAN segment (10.50.1.0/24):

VMIP
firewall10.50.1.1
simlab-mgmt10.50.1.5
win-server10.50.1.10
win-desktop10.50.1.20
ubuntu-server10.50.1.30
kali10.50.1.40

The Ansible inventory (ansible/inventory.ini) is generated automatically by make apply via scripts/generate-inventory.sh from the Terraform outputs (gitignored) and normally does not need to be adjusted.

7. Run Ansible

make configure-linux

Important Notes

:::warn [libvirt memory unit] The memory parameter in libvirt_domain is passed in KiB, not MiB. 2 GiB = 2097152, 4 GiB = 4194304. :::

:::warn [Cloud-Init] Cloud-Init only runs on the first boot of the VM. When the key changes, the VM must be recreated (terraform apply -replace=libvirt_volume.ubuntu_disk ...). :::


Next Steps

On this page