To connect PC2 (Windows with VNC server) via PC1 (Ubuntu with noVNC setup) from the internet, you'll need to link your VNC setup effectively. Here are the steps:
Prerequisites:
-
PC1 (Ubuntu):
- noVNC installed and configured.
- VNC server installed and running.
-
PC2 (Windows):
- VNC server installed and configured.
Step-by-Step Guide:
1. Configure VNC Servers:
PC2 (Windows):
- Make sure the VNC server is running.
- Configure the VNC server with a password for security.
PC1 (Ubuntu):
- Ensure you have a VNC server running on PC1 (for local access) and that it aligns with noVNC setup.
2. Forward VNC Ports:
To access your Windows PC (PC2) over the internet using PC1 with noVNC:
Option A: Router Port Forwarding
- Log in to your router's admin page.
- Forward the VNC port (default is usually 5900) for PC2's local IP address.
- Ensure external access is possible and secure.
Option B: SSH Tunneling (Secure Option)
Let's assume you have SSH access to PC1.
- Create an SSH tunnel from PC1 to PC2 with port forwarding.
On PC1 (Ubuntu), you can set up a tunnel like this:
ssh -L 5901:localhost:5900 <user>@<pc2-ip>
This command would forward local port 5901 to port 5900 of the Windows PC (PC2).
3. Configure noVNC on PC1 (Ubuntu):
-
Install noVNC if not already done:
sudo apt-get install novnc
-
Ensure the WebSockets proxy (websockify) is installed:
sudo apt-get install websockify
-
Start noVNC:
/path/to/novnc/utils/launch.sh --vnc localhost:5901
This command launches a noVNC server on http://localhost:6080 that connects to localhost:5901.
4. Access VNC over the Internet:
-
Access noVNC from a web browser:
- From a web browser on any device connected to the internet, navigate to
http://<public-ip-of-pc1>:6080.
- You should see the noVNC web client interface.
-
Connect to the VNC Server on PC2:
- Enter
localhost:5901 into the noVNC web client when prompted for VNC server connection.
- Authenticate using the password configured on the VNC server running on PC2.
5. Security Considerations:
- Use Strong Passwords: Protect the VNC servers with strong passwords.
- Limit Firewall Rules: Restrict the firewall rules to allow connections only from your trusted IP ranges.
- Consider VPN: For an added layer of security, consider using VPN to connect to your network and access VNC servers.
Important:
- Check Firewall Settings: Ensure that any firewall on PC1 and PC2 permits VNC connections through required ports.
- Dynamic DNS: If your external IP is dynamic, consider using a Dynamic DNS service to keep track of your IP address.
By following these steps, you should be able to connect to PC2's VNC server over the internet by using PC1's noVNC setup.