
qm vncproxy: Proxy VM VNC traffic
qm vncproxy
Proxy Virtual Machine VNC (Virtual Network Computing) traffic to stdin or stdout. This is handy when you want to route a VM’s VNC console through a pipe or a custom launcher.
What it does
- Bridges the VM’s VNC console to your process’s standard input/output.
- Useful for scripting scenarios or when you want to connect via non-standard tools that can read/write a VNC stream from a pipe.
- Typically used with a specific VM by its VM ID.
Basic usage
- Proxy a specific virtual machine:
qm vncproxy {{vm_id}}
Replace {{vm_id}} with the numeric ID of the VM you want to access.
Note: This command assumes you are running it on a Proxmox VE host (where the VM resides) and you have permission to access the VM.
Examples
- Proxy VM 101:
qm vncproxy 101
- Run and forward to stdout (example workflow):
qm vncproxy 101 > vm101_vnc_stream.bin
This demonstrates redirecting the VNC stream to a file via stdout redirection. In practice, you’d pipe stdout into a consumer that can speak VNC as appropriate for your setup.
Common pitfalls
- Misidentifying the VM ID: Ensure the ID exists and is powered on or accessible for VNC access.
- Permissions: Running on the Proxmox host may require root or appropriate capabilities.
- Terminal handling: Since the VNC stream goes to stdout, your shell or consumer must be prepared to read a binary VNC stream. Ordinary terminal windows will not render it.
- Long-running sessions: Leaving the proxy open ties up the process; remember to terminate when finished.
- Network considerations: If you intend to access the VNC over network, ensure proper routing and security controls (firewall, SSH tunnel, etc.).
Troubleshooting tips
- If the command exits immediately or you don’t see a VNC client connect, verify the VM ID and that the Proxmox host can access the VM.
- Check Proxmox logs for any VNC-related errors, e.g., /var/log/qemu-server/ or journalctl on the host.
- Ensure your environment’s read/write permissions align with the need to consume or produce a VNC stream on stdout/stdin.
Alternatives and complements
- Use the standard Proxmox console tools if you simply need an interactive console.
- Consider SSH/VNC tunneling (e.g., SSH port forwarding) if your goal is remote access with a GUI.
- For scripted automation, pair qm vncproxy with a proper VNC client or consumer that can handle a raw VNC stream.
Quick recap
- qm vncproxy {{vm_id}} proxies a VM’s VNC to stdout/stderr.
- It’s a targeted, VM-specific proxy; start with the VM ID and iterate from there.
- Understand that the VNC stream here is a binary stream intended for specialized consumption rather than direct terminal display.