Configure VNC Access in the Configuration File
Add a line to the VM’s configuration file /etc/pve/local/qemu-server/<VMID>.conf which specifies the VNC display number as follows (“77” in the example below):
args: -vnc 0.0.0.0:77
If you want to use password protection, add:
args: -vnc 0.0.0.0:77,password=on
The display number can be freely chosen, but each number must occur only once. The VNC service then listens at port 5900+display_number. Note that connections via noVNC use display number 0 and following, therefore it is recommended to use higher numbers in order to avoid conflicts.
You can now connect the VNC client to the host IP address and port as chosen (“5977” in the example above).