You can use the VNC SDK to establish direct TCP connections between devices if your network environment allows. This might be useful if you can’t (or don’t want to) use our VNC Cloud service to broker and relay connections. It also means you can create Viewer or Server apps that can potentially connect* to millions of computers world-wide with our flagship VNC product already installed.
*Providing connecting users know the correct credentials, of course.
Want to give it a try?
You can be up and running in just a few minutes with one of our Viewer sample apps and a free trial of VNC.
First, install VNC on the computer you want to control. In the picture above, this is a Windows 10 computer, but VNC is available for a wide range of Windows, Mac, Linux and UNIX computers, including Raspberry Pi.
- Download and install VNC.
- Obtain a free 30 day trial Enterprise license key, and apply it when prompted.
- Make a note of the listening TCP/IP address of the computer, available from the VNC Server dialog:
Note that VNC is secure out-of-the-box; connections are encrypted, and connecting users can only authenticate if they know the login credentials (user name and password) of an administrative user on the computer.
Connecting locally from a Viewer sample app
Download the VNC SDK to the computer or device you want to control from (this can be for any one of our supported platforms, with the exception of HTML 5). Then, follow the README to compile and run the appropriate basic Viewer sample app. For example, for a Linux PC or Raspberry Pi:
- Install some prerequisites:
- Email email@example.com to obtain an add-on code.
vnc-sdk/samples/basicViewerX11/main.cxxin a text editor and paste in the add-on code at line 68. Note this same code can be used to enable direct TCP connectivity in the Server sample apps too.
- Compile the Viewer sample app:
- Run the Viewer sample app, appending the listening TCP/IP address and port of the computer you want to control (the port will be the default for VNC, 5900, unless you’ve explicitly changed VNC Server’s settings):
- Enter the user name and password you normally use to login when prompted.
apt-get install cmake g++ libx11-dev build-essential #Ubuntu
yum install cmake gcc gcc-c++ libX11-devel #CentOS
apt-get install cmake libx11-dev #Raspi
./basicViewerX11 10.10.17.47 5900
Connecting over the Internet
When it comes to connecting devices directly over the Internet, you’ll need to be able to configure firewalls and port-forward routers protecting the VNC Server computer (this is one of the many services provided by VNC Cloud). For a general introduction to establishing direct TCP connections please read our documentation, and if you’re not sure how to port-forward routers then watch our video.