Moving VNC to the Relay
By default each server's VNC display listens on a port of its hypervisor, protected by a password, and the control server passes VNC to it unencrypted.
Moving VNC to the relay and agent changes that:
- No server listens for VNC on the network. Each display is a private socket on its hypervisor.
- VNC is encrypted all the way from the browser to the hypervisor.
- A session is opened with a single-use ticket for one server, not a password.
An installation that already exists is never moved by an update. You move it, once, with a command. A new installation starts on the relay.
There is no command to go back. Do not move VNC on a version you might need to roll back from.
What changes
- Browser VNC works as before.
- VNC connection details (host, port and password) are no longer shown to anyone, and the VNC Details and VNC Listen Type settings disappear. A VNC client that connects to a hypervisor port directly stops working, and so does any integration that does the same.
- Enabling and disabling VNC for a server still works. It no longer opens or closes a port. The event hooks for it still run.
- Disabling VNC, or removing a share, closes VNC sessions that are already open.
Before you start
- The relay is installed on the control server and the dashboard notice is gone.
- Every hypervisor has been updated, so that its agent is running. Check a hypervisor's Agent section.
- A serial console opens in a browser. VNC will use the same connection.
Check
This reports what stands in the way and changes nothing:
vfcli-ctrl vnc:convert --check
Each hypervisor that is not ready is named, as one of two kinds:
- Offline: the hypervisor cannot be reached at all.
- A hypervisor that answers but whose agent is missing or too old. Update it.
Move
vfcli-ctrl vnc:convert
It runs the same check, asks for confirmation, and then:
- Switches VNC to the relay for the whole control server.
- Closes the VNC port of every server in each hypervisor's firewall.
Running servers are not restarted and keep working: the agent reaches them on the hypervisor itself. Each server gets its private socket the next time it is powered off and started. A restart from inside the server is not enough.
Leaving hypervisors out
A hypervisor that is not ready stops the command. To go ahead without it:
vfcli-ctrl vnc:convert --skip-offline
vfcli-ctrl vnc:convert --skip=3,7
--skip-offline leaves out every hypervisor that cannot be reached. --skip leaves out the hypervisors
with those IDs, which answer but are not ready. The two can be used together.
Servers on a hypervisor that was left out have no VNC until that hypervisor is updated. There is no fallback to the old way for a single hypervisor.
When a hypervisor that was left out is back and updated, run vfcli-ctrl vnc:convert again. On a control
server that has already been moved, it only closes VNC ports, so it is safe to run as often as needed.
Hypervisors that manage their own VNC firewall rules
A hypervisor with /home/vf-data/conf/hv/no-vnc-ufw is not asked to change its firewall. The command says
so. The VNC port of each server on it stays as it is until that server is next powered off and started.
Confirming it works
Open VNC for a server, and on its hypervisor watch the agent:
journalctl -u vf-agent -f
A line appears for the session. display= ends in vnc.sock for a server that has been started since the
move, and is 127.0.0.1 with a port for one that has not.