Software⏱️ 4 min read📅 2026-06-11

How to Fix: VNC Server Error: New main PID <PID> does not belong to service

VNC server error on CentOS Linux. Solution: Check the VNC configuration and ensure the correct desktop geometry is set.

Quick Answer: Check the VNC configuration to ensure the correct desktop geometry (1920x1080) is set in the Xvnc command line.

The VNC Server Error: New main PID does not belong to service is an issue that affects users who have installed tigervnc-server on CentOS Linux. This error occurs when the systemd service manager fails to recognize the new process ID (PID) of the VNC server, causing it to refuse starting the service.

This error can be frustrating for users as they are unable to use their remote desktop connection. However, with the right troubleshooting steps, you can resolve this issue and get your VNC server up and running smoothly.

⚠️ Common Causes

  • The first main reason why this error happens is due to a mismatch between the process ID (PID) of the new VNC server and the PID specified in the systemd service file. This can occur when the user runs the vncserver command with an incorrect or missing PID, causing systemd to refuse starting the service.
  • Another possible reason for this error is that the user does not have the necessary permissions to start the VNC server service. In some cases, the user may need to use a different user account or group to run the VNC server.

🛠️ Step-by-Step Verified Fixes

Resolving the PID mismatch

  1. Step 1: To resolve the PID mismatch, you can try running the vncserver command with the correct PID. You can do this by checking the output of the ps aux | grep vnc command to find the actual process ID of the VNC server. Once you have the correct PID, you can run the following command: sudo systemctl restart vncserver@:1.service -f
  2. Step 2: Alternatively, you can try setting the CorrectPIDFile option in the systemd service file to match the actual PID of the new VNC server. You can do this by editing the /etc/systemd/system/vncserver@:1.service file and adding the following line: CorrectPIDFile=/tmp/.Xvncsock- where is the actual process ID of the VNC server.
  3. Step 3: After making these changes, you can restart the VNC server service using the following command: sudo systemctl restart vncserver@:1.service

Resolving permission issues

  1. Step 1: If you suspect that permission issues are causing the error, you can try running the VNC server as a different user account or group. You can do this by editing the /etc/systemd/system/vncserver@:1.service file and changing the User option to match the new user account or group.
  2. Step 2: Alternatively, you can try adding the necessary permissions to the systemd service file using the following command: sudo chmod 755 /etc/systemd/system/vncserver@:1.service

✨ Wrapping Up

In conclusion, the VNC Server Error: New main PID does not belong to service is an issue that can be resolved by identifying and resolving the root cause of the problem. By following the steps outlined in this guide, you should be able to get your VNC server up and running smoothly with a resolution of 1920x1080 screen resolution.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions