← All Scanning Guides
⚠️ Critical: Never use virt-customize on a running VM. Editing live disk images causes corruption. The VM must be shut down first.
1

Inject the collector into a stopped image

Copy the collector binary into the disk image and set executable permissions.
Proxmox Host
# Target a Proxmox VM disk image (VM must be stopped)
virt-customize \
  -a /var/lib/vz/images/100/vm-100-disk-0.qcow2 \
  --mkdir /opt/versiongopher \
  --copy-in ./version_gopher-linux-x64:/opt/versiongopher \
  --run-command 'chmod +x /opt/versiongopher/version_gopher-linux-x64 && \
    ln -sf /opt/versiongopher/version_gopher-linux-x64 \
           /opt/versiongopher/version_gopher'
2

Optional: scan on first boot

Add a --firstboot-command to trigger a scan automatically when the VM next starts.
Proxmox Host
virt-customize \
  -a /var/lib/vz/images/100/vm-100-disk-0.qcow2 \
  --mkdir /opt/versiongopher \
  --copy-in ./version_gopher-linux-x64:/opt/versiongopher \
  --run-command 'chmod +x /opt/versiongopher/version_gopher-linux-x64' \
  --firstboot-command \
    '/opt/versiongopher/version_gopher-linux-x64 /usr/bin \
     -o /var/tmp/versiongopher/scan'
Template baking: Apply this to a Proxmox template image. Every VM cloned from the template will have the collector pre-installed and ready to run.
3

Retrieve results after boot

Once the VM boots and the scan completes, retrieve results via the guest agent or SSH.
Proxmox Host
# Via guest agent (if available)
qm guest exec 100 -- /bin/sh -lc \
  "cat /var/tmp/versiongopher/scan.json" \
  | jq -r '."out-data"' > /tmp/vm-100-scan.json

# Or via SSH
scp root@vm-ip:/var/tmp/versiongopher/scan.json \
  /tmp/vm-100-scan.json
Use cases: Template baking is ideal for large fleets where you don't want to inject at runtime. Bake once, clone many, scan on first boot, collect results centrally.