Add a Proxmox hypervisor
A hypervisor is a Proxmox VE server (a standalone node or the entry node of a cluster) that PxVault drives through the Proxmox API. You can add it in two ways, from the Hypervisors page with the Add a Hypervisor button:
- Auto-Registration (recommended method): you run a single command as root on the node and it registers itself.
- Manual Configuration: you create a Proxmox API token yourself and fill in a form.
You can then enable SSH access (data plane). It is used for network operations that the Proxmox API cannot do.
Important: to add a hypervisor, your account must have the
hypervisors:createpermission. To enable SSH access, you needhypervisors:admin. See Users and access.
Automatic registration by script
This is the simplest method. PxVault creates a service account and an API token on the node by itself.
Steps
- Open Hypervisors, then click Add a Hypervisor.
- In the left panel, Auto-Registration, a
curl -fsSL "…" | bashcommand is generated automatically. - Leave the Also enable SSH access (data-plane) box checked if you want to enable SSH access in the same operation (it is checked by default).
- Click Copy Command.
- Log in to the Proxmox node (SSH or the shell in the Proxmox interface) as root, paste the command and press Enter.
- If the terminal is interactive, the script asks you for:
- the address PxVault should use to reach this node (arrow keys or a number, or "Enter custom IP/Host address manually" to type an address);
- the Proxmox API port (suggested value: the detected port, otherwise
8006).
- In PxVault, the window shows Waiting for registration..., then Hypervisor Detected! It then closes by itself and the new hypervisor appears in the list.
Warning: the command is single-use and valid for 15 minutes by default (configurable on the server with
REGISTRATION_TOKEN_TTL_MINUTES). If it has expired, the window shows This command has expired. Then click Generate a new command.
What the script does, step by step
- It checks that it is running on a Proxmox host (
pveshandpveumpresent) and as root. - It installs
jqandopensslif they are missing (viaapt-get). - It detects the node's IP addresses (local IPs,
127.0.0.1, then the public IP if it can be found). - It looks for the API port by comparing the Proxmox certificate fingerprint on ports 8006 to 8020. Otherwise, it keeps
8006. - It creates the Linux user
pxvault(if it does not exist) and gives it a random password. - It creates the Proxmox user
pxvault@pamand gives it the Administrator role on/. - It creates an API token
pxvault@pam!pvemanager-<horodatage>without privilege separation (--privsep 0). - It sends PxVault the address, the port, the token, the node's hostname (which becomes the hypervisor's name) and the console credentials (
pxvault@pam+ password). - It shows
REGISTRATION SUCCESSFUL!with the node name, the address and the account used. - If the SSH option was checked, it continues with SSH enrollment (see below). If this step fails, the registration remains valid. The script says so and you can try again from the hypervisor's Settings tab.
sequenceDiagram
participant UI as PxVault (browser)
participant N as Proxmox node (root)
participant PX as PxVault server
UI->>PX: Generates a single-use command
N->>PX: curl … /api/registration/script
N->>N: Creates pxvault@pam + API token
N->>PX: POST /api/registration/complete
PX->>PX: Creates the hypervisor, tests the API
UI->>PX: Checks the command status
PX-->>UI: Hypervisor detected
Tip: the node must be able to reach PxVault at the address your browser used when you opened the window, because that is the address embedded in the command. If you access PxVault through
localhost, the node will not be able to reach it: open PxVault by its real network address before generating the command.
If registration is rejected
If the window shows Registration failed, the command was used but no hypervisor was created. The most common cause is that this host and port are already registered: PxVault never overwrites an existing hypervisor. Check the list, then click Generate a new command if needed.
Add a hypervisor manually
Use this method if you prefer to create the Proxmox API token yourself, or if the node cannot reach PxVault.
Create the Proxmox API token
Option 1: the command provided by PxVault. The Manual Configuration panel contains a ready-to-use command, under "On the Proxmox node - a single command, as root:". Copy it with Copy Command and run it as root on the node. It:
- creates the Linux user
pmmanagerand the Proxmox userpmmanager@pam; - gives it the Administrator role on
/; - (re)creates the token
pmmanager@pam!pvemanagerwithout privilege separation; - shows a
==== PASTE INTO PXVAULT ====block with the Token ID, the Token Secret, the user and the PAM password to copy into the form.
Option 2: the Proxmox web interface.
- In Proxmox, open Datacenter → Permissions → API Tokens and click Add.
- Choose the user (for example
root@pamor a dedicated user) and give the token a name. - Uncheck "Privilege Separation": the token then inherits the user's rights.
- Confirm, then copy the Secret right away: Proxmox only shows it once.
- Check that the user has the Administrator role on
/(Datacenter → Permissions). This is the role PxVault's scripts grant, because the application manages VMs, storage, network and firewall.
Warning: if you leave privilege separation enabled, the token has no rights until you explicitly assign some. PxVault's calls will then fail.
Fill in the form
In Add a Hypervisor, fill in the right-hand panel, Manual Configuration:
| Field | Required | Content |
|---|---|---|
| Name | Yes | Name shown in PxVault (e.g. pve-paris-01). |
| Host | Yes | IP address or DNS name of the node (e.g. 192.168.1.100). A pasted URL (https://pve:8006/) is reduced to the host, and its port is used if Port is empty. |
| Port | No | Proxmox API port, 8006 by default. |
| Token ID | Yes | Format utilisateur@realm!nomdutoken, e.g. pmmanager@pam!pvemanager. |
| Token Secret | Yes | The token secret (format xxxxxxxx-xxxx-…). |
| Console User (PAM) | No | E.g. pmmanager@pam. Required for the text console (xterm) and LXC password actions. |
| Console Password (PAM) | No | This Linux user's password. Must be filled in together with the console user, otherwise the form rejects it. |
| Verify TLS certificate | Checked | Verifies the Proxmox certificate to prevent the token from being intercepted (see below). |
| Packer Build Bridge (optional) | No | Overrides the global network bridge for Packer template builds on this hypervisor. Leave empty to use the global default value. |
Then click Add Manually.
Tip: PxVault tests the API as soon as the hypervisor is added. If the test fails (unreachable address, invalid token, rejected certificate), the hypervisor is still created, but with the Offline status. Fix the settings, then click Refresh.
Self-signed certificate and TLS verification
By default, Proxmox uses a self-signed certificate. When the Verify TLS certificate box is checked, the connection to this kind of certificate is refused and the hypervisor stays Offline. Two solutions:
- Recommended: have the PxVault server trust your certificate authority (CA) with the
NODE_EXTRA_CA_CERTSenvironment variable, then keep verification enabled. - Otherwise: uncheck the box. A warning is shown, because the API token becomes exposed to a man-in-the-middle attack. The operation is recorded in the audit log.
Important: hypervisors added by auto-registration use the global setting Settings → Security → Verify certificates by default, which is enabled out of the box. If your node has a self-signed certificate, it will therefore appear Offline after registration. Then turn off SSL Verification in the hypervisor's Settings tab, or trust your CA.
Enable SSH access (data plane)
The Proxmox API does not allow some network operations: inbound port forwarding (DNAT), floating IP (1:1 NAT), Internet egress for VPCs, or image preparation. For these operations, PxVault uses a restricted and audited SSH channel to the node, called the data plane. Until it is enabled, the hypervisor's card shows SSH data-plane: Inactive.
Enable SSH access later
- Open the hypervisor (⋮ → Details menu on its card), then the Settings tab.
- In the SSH data-plane card, click Enable SSH access (data-plane).
- Copy the command shown under Command to execute on the node (root), then run it as root on the node.
- The window shows Waiting for enrollment…, then ✔ Hypervisor enrolled. The badge changes to SSH data-plane: Active.
The token in this command is single-use and valid for 15 minutes. If it has expired, click Regenerate Token. On a node that is already enrolled, the Reactivate / regenerate button restarts enrollment.
What enrollment does on the node
- It installs
sudo,nftables,libguestfs-toolsanddhcpcd-base, then enables IP routing (ip_forward). - It creates the service user
pxvault(or reuses the one from auto-registration) with a fallback password, kept encrypted by PxVault. - It installs the
pm-node-execagent, the only command PxVault is allowed to run (sudoers limited to this agent). - It adds PxVault's public key, specific to this hypervisor, to
authorized_keys. The key is restricted to the forced command and, if possible, to PxVault's IP address (from="…"). - It sends back the SSH host key fingerprint, which PxVault pins: any other key will then be refused.
Detected PxVault IP address and the PM_MANAGER_IP variable
The address allowed in from="…" is detected automatically. PxVault opens a connection to the node's SSH port and looks at which local address it uses. If PxVault is behind NAT and the node has a public IP, it asks api.ipify.org then ifconfig.me for its outbound IP. If detection fails, it falls back to the host from APP_URL, then to * (any address).
If PxVault is behind a reverse proxy, a CDN or an unusual NAT, detection may be wrong. In that case, force the address on the PxVault server, in backend/.env:
PM_MANAGER_IP=203.0.113.10 # address seen by the nodes; "*" = any address
Then restart enrollment with Reactivate / regenerate. Symptom of a wrong address: not from a permitted host in journalctl -u ssh on the node.
Different SSH port
If the node's SSH does not listen on port 22 (tunnel, NAT), enter the right port in Settings → Connection Settings → SSH Port (data-plane). The host used is the API host.
Update the network agent
The SSH data-plane card shows the version of the Network agent (pm-node-exec) and an Update button. On the Hypervisors page, the MAJ agents (n) button (n = number of enrolled nodes) updates all nodes at once, without re-enrollment. This requires the agent signature to be in place (next section): otherwise, the button explains what is missing instead of starting an update the nodes would refuse.
Sign and update the node agent
The agent runs as root on each hypervisor. A node therefore only installs a new version if it is signed by your organization's release key. This private key is never stored on the PxVault server: even a compromised PxVault server could not push code to your hypervisors. Each organization running PxVault has its own key.
Setup (one time only)
- On an administrator workstation, from the PxVault source code:
The command creates the private key (pnpm run agent:keygen --out ~/pxvault-release-key.pem.pemfile, permissions 600) and the public key, and prints the public key on one line (PXVAULT_AGENT_RELEASE_PUBKEY=…). - Store the private key offline (password manager, secrets vault) and delete the local copy. Never commit it.
- Give the public key to the PxVault server, in one of these ways:
- the simplest: Settings > Security > Node agent release key, paste the printed line then Save (no restart);
- or the environment variable
PXVAULT_AGENT_RELEASE_PUBKEY=<la ligne affichée>inbackend/.env, then restart the backend (it takes precedence over the setting); - or commit the file
node-agent/release-key.pubin your repository.
- Sign the shipped agent:
then commitPXVAULT_RELEASE_KEY=~/pxvault-release-key.pem PXVAULT_AGENT_RELEASE_PUBKEY=<la ligne> pnpm run agent:signnode-agent/pm-node-exec.sig. - Nodes enrolled before the key was created do not know it: re-enroll them (or, as root on the node, copy the public key to
/etc/pxvault/agent-release.pub). New enrollments pin it automatically.
With each new agent version
The signature covers the exact content of the agent: as soon as node-agent/pm-node-exec changes, it must be redone (pnpm run agent:sign). So you no longer have to think about it, give the private key to the release pipeline, as a protected secret:
| Hosting | Secret (private key, PEM) | Variable (public key, one line) |
|---|---|---|
| GitHub | secret AGENT_SIGNING_KEY |
variable AGENT_RELEASE_PUBKEY |
| GitLab | masked and protected variable AGENT_SIGNING_KEY |
variable AGENT_RELEASE_PUBKEY |
The release then signs the agent automatically before publishing the version.
Check the signature status
GET /api/hypervisors/node-agent/release tells you whether the shipped agent is ready (ready) or what is missing (problem): no_release_key (no public key configured), invalid_release_key, no_signature (.sig file missing), signature_mismatch (the agent has changed since it was signed, or another key signed it). The update buttons show the same explanation.
Check a hypervisor's status (online / offline)
Each card shows an Online, Offline or Unknown status. PxVault determines it by querying the Proxmox API (version and cluster status) with the stored token:
- automatically every 2 minutes (configurable with
HYPERVISOR_HEALTH_INTERVAL_MS, 30 seconds minimum); - on demand: Refresh statuses on the Hypervisors page (the whole fleet, with an "x/y hypervisors online" summary), or Refresh in a card's ⋮ menu or on the detail page.
An Offline hypervisor can no longer be chosen to create machines or run builds. Failures are logged. To diagnose them, see Troubleshooting.
On a large fleet, the Search a hypervisor by name or host... field filters the cards; beyond 60 cards, the page shows how many are hidden and invites you to refine the search. The CPU, memory and disk gauges of the displayed cards are loaded in a single request, and each host's usage is cached for 15 seconds: opening the page no longer queries each server separately.
A hypervisor's page has a VMs tab: its machines, page by page, with a search by name or VMID and a status filter. The counters (running, stopped, total) cover the whole hypervisor.
Edit or delete a hypervisor
Edit the settings
- Open the hypervisor, then the Settings tab.
- In Connection Settings, click Edit.
- Change the fields you want: Display Name, Host, Port, SSH Port (data-plane), Packer Build Bridge (optional), Console User (PAM), Console Password (PAM), SSL Verification.
- Click Save. PxVault immediately rechecks the connection.
Warning: the Token ID is shown read-only and the secret cannot be changed from this screen. To change the API token, delete the hypervisor and add it again.
In the same tab, Datacenter Assignment lets you attach the hypervisor to a datacenter.
Delete a hypervisor
Click Delete (the card's ⋮ menu, the detail page header, or Danger Zone → Delete Hypervisor), then confirm. If your security policy requires it, you are asked for a two-factor authentication (TOTP) code.
Important: deletion only removes the hypervisor and its credentials from PxVault. Nothing is destroyed on the Proxmox side: the VMs keep running. The service account and the token created on the node stay in place. Delete them in Proxmox if you no longer need them.