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.
📋 Table of Contents
The VNC Server Error: New main PID
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
- 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
- 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. - 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
- 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.
- 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
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid