Skip to content

The NexoVirt node agent

NexoVirt runs a small agent on each connected Proxmox node. It does the work that the Proxmox API can’t do cleanly on its own: downloading OS images, applying NAT and WireGuard, reading the node firewall and logs, installing package updates, and feeding the panel accurate node facts. The current agent version is 0.27.1.

The agent is a single PHP script (/opt/nexovirt-agent.php, config in /etc/nexovirt-agent.conf) run by the nexovirt-agent systemd service. It runs on the stock Proxmox php-cli and needs no extra PHP extensions (no curl or mbstring extension).

It holds no open inbound port. It sends a heartbeat to the panel over HTTPS about every 15 seconds (every 3 seconds while it has work), picks up queued jobs from the response, runs them and posts the results back. It authenticates with a per-node token issued during onboarding. Nothing outside your panel can reach it.

The panel needs a working agent and checks it on every heartbeat:

  • Missing (a connection that never got an agent): the panel shows a blocking dialog on every admin page with the one-click fix (Set up agent). The dialog clears itself once the agent reports in. Nodes that are down and handled by failover, and nodes where you deliberately used Remove agent, do not trigger it.
  • Not responding (no heartbeat for 5 minutes): the panel does not lock. It shows a red banner Node agent not responding with the node names. Actions on those nodes wait until the agent answers again. Check that the node reaches the panel over HTTPS (firewall, bans under Settings > Security), or use Set up agent on the node page. The heartbeat is never counted by the login jails.
  • A cluster node without an agent, while another node of the cluster has one, does not block the panel. Its node page shows “No agent on this node: images, updates and network features are off here.” with a Set up agent button. The node still accepts new guests.
  • Outdated (the installed version differs from the one bundled with the panel): the agent keeps working. The panel shows a dismissible “node agents need updating” banner once per new agent version, and the Nodes list shows Update available with an Update button.

Some features need a minimum agent version and say so when the agent is older, for example node updates.

The agent only runs a fixed, allow-listed set of jobs. There is no “run this command” job: the panel can only ask for one of these named operations, each validates its own inputs on the node, and anything else is rejected as an unsupported job type.

JobWhat it does
Provision image storageCreates the managed nexovirt-images directory storage on the node.
Image cacheDownloads an OS cloud image once per node into the image cache (detached, resumable, SHA-256 verified), and deletes cached images. Older agents used a per-guest download instead.
Write cloud-init snippetWrites a validated cloud-init vendor snippet (for example to install the QEMU guest agent or enable root SSH).
LXC password / root SSHRuns pct exec in a container to set the root password or enable root SSH (Proxmox has no API for this).
Apply / clear NATPrograms only the dedicated NEXOVIRT-* iptables chains for masquerade and port forwards. Built-in and Proxmox chains are never flushed.
Apply / read WireGuardManages the wg-nexovirt interface and its own NEXOVIRT-VPN* chains, and reports VPN status and readiness.
SDN DHCP and egressInstalls dnsmasq only if absent and enables the per-zone DHCP backend; enables forwarding for SNAT subnets.
Set IP forwardingTurns net.ipv4.ip_forward on or off through its own sysctl.d file.
Scan IPsPing-sweeps a CIDR (at most 1024 addresses) and reads the ARP table to find addresses in use for IPAM.
Probe TCPChecks that a host and port are reachable (migration pre-flight).
Unlock guestRuns qm unlock / pct unlock for a guest left locked by a migration.
Configure DynDNSStores the DynDNS token and keeps the node’s DynDNS name updated every 5 minutes.
Package updatesRefreshes the package lists, simulates and installs Debian / Proxmox updates. See Node updates.

Separately from the jobs above, the agent reads node facts for the node page, health checks, firewall view and diagnostics. These reads are read-only:

  • System: OS release, kernel, CPU, memory, uptime, load average, pending package updates, SMART disk health, the state of pve-cluster, pvedaemon, pveproxy and pvestatd, and the ip_forward setting.
  • Proxmox VE: version, cluster, HA and Ceph status, and the storage list.
  • Firewall: the raw output of the firewall tooling present (iptables, nftables, ufw, firewalld, pve-firewall), which the panel parses into a read-only view.
  • Logs: recent system and Proxmox daemon log lines from journalctl, shown under Diagnostics.
  • Heartbeat stats: uptime, load, memory, and the image cache contents and free space.

The agent does not read your guests’ disks, your files or any secrets.

The agent runs as root (it needs pct, iptables, sysctl and apt-get), which is why the design is deliberately narrow: a fixed job list, validated inputs, dedicated firewall chains and detect-first behaviour.

  1. Set up. Add node (or Set up agent on an existing connection) connects once over SSH (host key pinned), installs php-cli if missing, installs the script and systemd service, and waits for the first heartbeat. See Nodes & onboarding.
  2. Update. Update agent on the node page (Settings tab) or the Update button in the Nodes list pushes the agent bundled with the panel, restarts the service and waits for a heartbeat at the new version. On a cluster, update each node. After a panel update, update the agent on every node. NAT adoption and the foreign NAT checks need 0.24.5, one-click apps need 0.26.0, disks per backup job need 0.27.0, refusing to turn off IP forwarding while the VPN is on needs 0.27.1, DHCP on NAT networks and the web UI login jail need 0.25.1, so update every node to the current version.
  3. Remove. Remove agent uninstalls the service, script and config and revokes the token, while keeping the node, its inventory and metrics. On a cluster it removes only that node’s agent. Deleting the node from the panel can also wipe the agent and the nexovirt-images storage.

If SSH credentials are stored for the node, update and remove run without asking for them again.

When one or more agents are older than the panel’s bundled version, the Nodes page shows Update all agents (N), and the update banner links to it. The dialog lists every outdated agent (one row per node on a cluster) with its current and target version, then updates them as normal Update agent runs after you confirm (admins confirm with a fresh step-up). At most two nodes update at once (setting agents.update_parallel, 1 to 5) and only one node per cluster at a time. Each row shows Queued, Running, Updated to v… or Failed with the reason and a Retry button. You can close the dialog: the updates continue in the background.

  • Nodes without stored SSH credentials are listed as Needs credentials and skipped. Store them with Set up agent and Remember root password, then retry.
  • Agents that do not answer or nodes without an agent are listed but never updated here: use Set up agent on the node.
  • Nodes in maintenance are updated like any other (the row says so).

The same runs from the REST API: POST /api/v1/agents/update-all starts it, GET /api/v1/agents/update-all lists the outdated agents and the latest run, GET /api/v1/agents/update-all/{id} one run. Tokens limited to some hosts cannot use these endpoints. Every start is audited as agent.update_all, each node as agent.update. If the panel server blocks proc_open, run the worker manually; see CLI & daemons.

  • Root SSH access to the node for the one-time setup (password or the panel’s key).
  • php-cli on the node (installed automatically if missing).
  • Outbound HTTPS from the node to your panel. No inbound port is opened.

NexoVirt is developed and designed by Nucez Software, your partner for custom software and web design.