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,ansibleinstalled- Access to
/mnt/data/simulationlab/(separate volume, at least 200 GB) - Access to k8s cluster (
kubectlconfigured, secretagent-tokensin namespaceimvee-devpresent)
Initial Setup
1. Clone the Repository
git clone https://gitlab.com/imvee/simulationlab.git
cd simulationlab2. Prepare the Host
One-time — installs dependencies and downloads cloud images:
make setup # requires sudoThis 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 VMs5. Secrets and Enrollment Token
All lab secrets live in Infisical (env dev) — source of truth. No
passwords in Git:
| Infisical Secret | Purpose | Local copy (gitignored) |
|---|---|---|
simlab-linux-password | SSH password for all Linux VMs | .secrets/linux_password |
simlab-windows-password | Windows 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_passwordThe 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.sh6. Verify Inventory
All VMs have static IPs in the LAN segment (10.50.1.0/24):
| VM | IP |
|---|---|
| firewall | 10.50.1.1 |
| simlab-mgmt | 10.50.1.5 |
| win-server | 10.50.1.10 |
| win-desktop | 10.50.1.20 |
| ubuntu-server | 10.50.1.30 |
| kali | 10.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-linuxImportant 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
- One-Click Deployment — set up the lab with a single command (recommended for test servers)
- Operations — Daily commands and VM management
- Test Scenarios — Test the agent and run scenarios
- Troubleshooting — Common issues and solutions