Error: You’ll have to kill the Xvnc process manually
This tutorial guides you on how to kill VNC Process Manually on Linux. Sometimes when you are trying to kill vncserver session you will get error You’ll have to kill the Xvnc process manually error. Let’s see how to resolve the same in this tutorial with example.
Error You’ll have to kill the Xvnc process manually
I was trying to reset the display counter for the VNC to :1 when I start the VNC server using command vncserver. By default my VNC server has been started at :2.
Hence I tried killing using the following command.
$ vncserver -kill :2 Can't find file /root/.vnc/localhost:2.pid You'll have to kill the Xvnc process manually
But, it resulted with error saying I need to kill the Xvnc process manually.
Solution : Kill VNC Process Manually
I had followed the following solution to kill the VNC process manually.
First, you need to find the PID of the process. So that you will know which process/program is running on specific port. Then you need to kill VNC process manually.
For instance, first the foremost thing that you need to do is check which VNC services are running using grep command.
$ ps -ef | grep vnc
You would see output like the following.
ubuntuuser 12092 11906 0 05:51 pts/2 00:00:00 grep vnc root 15790 1 0 Aug06 ? 00:00:00 Xvnc :2 -desktop X -httpd /usr/share/vnc/classes -auth /root/.xauthzIQyDA -geometry 2556x1000 -depth 24 -pixelformat rgb888 -rfbwait 120000 -rfbauth /root/.vnc/passwd -rfbport 5902 -fp /usr/share/fonts/misc:unscaled,/usr/share/fonts/local,/usr/share/fonts/75dpi:unscaled,/usr/share/fonts/100dpi:unscaled,/usr/share/fonts/Type1,/usr/share/fonts/URW,/usr/share/fonts/Speedo,/usr/share/fonts/truetype,/usr/share/fonts/uni,/usr/share/fonts/CID -noreset
From the above response it is evident that only Xvnc is running on rfbport 5902. And whose PID is 15790.
Alternatively, you can netstat command along with grep as shown below.
# netstat -tulpn | grep :59
You would see the following output.
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 5264/xinetd tcp 0 0 0.0.0.0:5902 0.0.0.0:* LISTEN 15790/Xvnc tcp 0 0 0.0.0.0:59061
The above response also shows similar output for PID. Therefore, you need to use the PID 15790 to kill VNC session started at :2.
Command to Kill VNC process
Run the following command to kill the VNC process ie., kill -9 <PID of Xvnc Process>.
# kill -9 15790
Output
Killing Xvnc process ID 15790
That’s it. You had learnt how to find PID process that is using specific port. Also, learnt how to kill the VNC processes manually.
Hope this article is helpful 🙂
Also See:
- Set or change root password in Ubuntu Linux
- Linux: sudo: apt-get: command not found
- How to Start Stop Restart MariaDB on Linux OS ?
- Putty Fatal Error No supported authentication methods available
- How to find which users belongs to a specific group in linux
- Give write permissions for specific user or group for specific folder in linux
- How to unzip a zip file from Terminal (Google Cloud Shell)
- Build a Docker Image with a Dockerfile and Cloud Build in GCP?
- How to create GCP project on Google Cloud Platform
- MariaDB – How to set max_connections permanently ?
- How to create GCP project on Google Cloud Platform
- Is it possible to change Google Cloud Platform Project ID ?
- Create non-root SSH user account and provide access to specific folders
- MySQL : How to grant all privileges to the user on database ?
- How to install OpenJDK 11 in Ubuntu Machine ?
- Amazon Linux AMI : apt-get command not found
- How to get the first and last element of a list in Python ?
- Connect to Github using SSH ?
- Check OS version in Linux from command line ?
- Install and configure VNC on Ubuntu 20.04 ?
How to kill the first session then?