How to Stop a VNC Server on Linux
VNC Server is typically installed as a service, which means that it runs in the background rather than being visible to the user, and also starts when the computer boots up. For security reasons or troubleshooting measures, it is sometimes necessary to stop the VNC Server.
Instructions
-
-
1
Open a command line terminal by selecting the “Applications” menu, then click “Accessories,” then click on “Terminal” (if using the Gnome user interface) or click “KMenu,” then select “System,” and then click “Terminal (Konsole)” (if using the KDE user interface) and the command line terminal will display.
-
2
Type “service vncserver stop” and press the “Enter” key. If a “permission denied” or similar error appears, type “sudo vncserver stop” and press the “Enter” key. (Type in the superuser or root password if requested.)
-
-
3
Type “ps –aux | more” on the command line and press the “Enter” key, then press the “Space” bar on the keyboard to continue scrolling through the output while looking for “vncserver” in the list of running processes. If “vncserver” is not listed, then the VNC Server service has been stopped. If “vncserver” is listed, then proceed to the next step.
-
4
Note the number in the “vncserver” row that is located under the “PID” column in the command line output.
-
5
Type “kill PID”, replacing “PID” with the “vncserver” PID number found earlier in the command line output and then press the “Enter” key. If a “permission denied” or similar error appears, type “sudo kill PID”, replacing the “PID” with the “vnceserver” PID number, and press the “Enter” key. (Type in the superuser or root password if requested.)
-
6
Type “ps –aux | more” on the command line and press the “Enter” key, then press the “Space” bar on the keyboard to scroll through the output and verify that the “vncserver” name is no longer in the list.
-
1
Tips & Warnings
Be sure to place a space between each word or symbol for commands typed on the command line.
References
- Photo Credit Creatas Images/Creatas/Getty Images