Use virt-customize to inject the VersionGopher™ collector directly into stopped VM disk images or Proxmox templates. The collector is ready to run on next boot - no runtime injection needed.
virt-customize on a running VM. Editing live disk images causes corruption. The VM must be shut down first.
# 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'
--firstboot-command to trigger a scan automatically when the VM next starts.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'
# 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