Ova

How to Disable VNC Remote Service

Published in VNC Management 5 mins read

Disabling VNC remote service effectively involves stopping the VNC server software from running, which prevents unauthorized or unwanted remote access to your computer. The most direct and recommended approach is to stop or uninstall the VNC server application itself.

Here's a detailed guide on how to disable VNC remote service, covering various operating systems and scenarios:

1. Stopping the VNC Service (Recommended Method)

The VNC server typically runs as a background service on your operating system. Stopping this service will immediately disable VNC remote access without uninstalling the software.

On Windows:

  1. Open Services Manager: Press Win + R, type services.msc, and press Enter. Alternatively, search for "Services" in the Start Menu.
  2. Locate VNC Service: In the Services window, scroll down to find services related to VNC. Common names include:
    • RealVNC Server
    • TightVNC Service
    • UltraVNC Server
    • Aven VNC Server
    • TigerVNC Server
    • Any service with "VNC" in its name or description.
  3. Stop the Service:
    • Right-click on the identified VNC service.
    • Select Stop from the context menu. This will immediately cease the VNC server's operation.
  4. Prevent Automatic Startup (Optional but Recommended):
    • Right-click on the VNC service again and select Properties.
    • In the "General" tab, find the Startup type dropdown menu.
    • Change it from "Automatic" to Disabled or Manual.
      • Disabled: The service will not start automatically and cannot be started manually until the setting is changed back.
      • Manual: The service will not start automatically but can be started manually if needed.
    • Click Apply and then OK.

Here's a table of common VNC services you might encounter on Windows:

VNC Product Service Name Example Default Port
RealVNC VNC Server (vncserver) 5900
TightVNC TightVNC Service (tvnserver) 5900
UltraVNC UltraVNC Server (uvnc_service) 5900
TigerVNC (Often runs as a user process, or a systemd service 5901+
Aven VNC Aven VNC Server (avenvnc) 5900

On Linux:

The method depends on your Linux distribution's init system (most modern systems use systemd, older ones might use SysVinit).

  • For systemd (e.g., Ubuntu 16.04+, Debian 8+, CentOS 7+, Fedora):
    1. Stop the VNC service:
      sudo systemctl stop vncserver.service
      # Or if a specific user VNC session, it might be:
      sudo systemctl stop vncserver@:<display_number>.service
    2. Disable the VNC service from starting at boot:
      sudo systemctl disable vncserver.service
      # Or for user sessions:
      sudo systemctl disable vncserver@:<display_number>.service
    3. Check status (optional): sudo systemctl status vncserver.service
  • For SysVinit (older distributions):
    1. Stop the VNC service:
      sudo /etc/init.d/vncserver stop
    2. Disable the VNC service from starting at boot:
      sudo update-rc.d vncserver disable
      # Or for RedHat/CentOS:
      sudo chkconfig vncserver off
  • Killing VNC processes (if not running as a formal service):
    If VNC is running as a direct process and not managed by a service, you can find and kill its process:
    1. List VNC processes:
      ps aux | grep vnc
    2. Identify the process ID (PID) of the VNC server (often associated with Xvnc or vncserver).
    3. Kill the process:
      kill <PID>

      Replace <PID> with the actual process ID.

2. Uninstalling the VNC Server Software

If you no longer need VNC remote access and want to remove the software entirely, uninstalling is the most thorough approach.

On Windows:

  1. Open Programs and Features: Go to Control Panel > Programs > Programs and Features (or search for "Add or remove programs" in Windows 10/11).
  2. Find VNC Software: Locate the VNC server application (e.g., "RealVNC Server," "TightVNC Server," "UltraVNC").
  3. Uninstall: Select the VNC software and click Uninstall/Change. Follow the on-screen prompts to complete the uninstallation.

On Linux:

Use your distribution's package manager to remove the VNC server package.

  • For Debian/Ubuntu-based systems (apt):
    sudo apt remove realvnc-vnc-server
    # Or for TightVNC, TigerVNC, etc.
    sudo apt remove tightvncserver
    sudo apt remove tigervnc-standalone-server
  • For Red Hat/CentOS/Fedora-based systems (yum/dnf):
    sudo dnf remove tigervnc-server
    # Or for older systems
    sudo yum remove tigervnc-server

3. Disabling Network Adapter

Another way to instantly prevent VNC connections is by disabling the network adapter that the VNC server uses. This will cut off all network access through that specific connection, effectively isolating the VNC server from the network.

To do this on a Windows system:

  1. Navigate to the Control Panel.
  2. Go to Network and Sharing Center, then click on Change adapter settings (or directly Network Connections).
  3. Right-click on your active network connection (e.g., "Ethernet," "Wi-Fi").
  4. Select Disable from the context menu.

Important Note: This action will disable all network communication for that specific adapter, not just VNC. Ensure you understand the implications before proceeding, as it will disrupt internet access and other network services on that connection.

4. Modifying VNC Server Configuration

Some VNC servers allow you to disable remote access directly through their configuration interface or settings. This method is highly dependent on the specific VNC software you are using. Look for options like "Disable remote access," "Stop server," or "Listen for incoming connections" within the VNC server's control panel or system tray icon context menu.

5. Using Firewall Rules

Blocking the default VNC ports (commonly 5900, 5901, and onwards, or 5800 for HTTP access) at the host firewall level can also disable remote access, even if the service is running. This acts as a protective barrier.

  • On Windows: Open "Windows Defender Firewall with Advanced Security," go to "Inbound Rules," and create a new rule to block TCP ports 5900-590x (depending on your VNC configuration).
  • On Linux (using ufw):
    sudo ufw deny 5900/tcp
    sudo ufw deny 5901/tcp
    # Or if you're blocking all incoming VNC ports
    sudo ufw deny from any to any port 5900:5910 proto tcp

    Remember to enable the firewall: sudo ufw enable.

By implementing one or more of these methods, you can effectively disable the VNC remote service on your system and prevent unwanted remote access.