Last active
June 23, 2025 21:01
-
-
Save MatiasVara/0b27f2ee947ff8064affc59c3185779b to your computer and use it in GitHub Desktop.
This gist presents how to connect to a VNC server of a VM in Xcp-ng/XenServer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Use it as: ./forward-vnc.sh "VM-name" | |
| # Connect a vnc client to 9999 | |
| # Note that sudo iptables -I INPUT -p tcp -m tcp --dport 9999 -j ACCEPT | |
| uuid="$(xe vm-list name-label="$1" --minimal)" | |
| domid="$(xe vm-param-get uuid="$uuid" param-name=dom-id)" | |
| socat -d -d TCP4-LISTEN:9999,fork UNIX-CONNECT:/var/run/xen/vnc-"$domid" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment