• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Kill VNC Window Sessions in Linux

by admin

VNC (Virtual Network Computer) is a low-bandwidth cross-platform display system. VNC is a system for controlling a computer remotely and sharing desktops over a network using a graphical interface. Access to a remote desktop requires a VNC server installed on the remote system, a VNC viewer on the system from which access is being established and, optionally, a secure SSH connection.

Sometimes you may have to kill a particular VNC session from a Linux box. This post outlines the steps to kill a VNC session from the command line using the vncserver command.

1. Stop entire VNC service:

[root@server ~]# service vncserver stop

2. Kill individual VNC Sessions. To stop individual VNC session, you need to first login as the user account that associated with the VNC session. For example if you assigned VNC session 1 (:1) for the user “nix”, login as “nix” and run the below command

[nix@server ~]# vncserver -kill :1

3. To start VNC session again:

[nix@server ~]# vncserver :1

4. Command to Start new VNC Session:

[nix@server ~]# vncserver :2

5. Find Running VNC server sessions (login as associated user first):

[nix@server ~]# vncserver -list
Note: Also open firewall to allow all incoming connections (new sessions) to VNC Server.

Killing All VNC sessions

You can also use the following command to kill all currently running VNC server sessions:

$ vncserver -kill :*
Killing Xtigervnc process ID 1607... success!
Killing Xtigervnc process ID 5287... success!

Summary

You start the VNC server on your remote Linux database server by running vncserver and a port number. Like the other Linux daemons–such as httpd, which usually listens on port number 80, and sshd, which usually listens on 22–the VNC server listens on port number 5901 by default. If you include a port number when running vncserver, the actual port number is plus 5900. For example, if you run vncserver :9, then the VNC server listens on port number 5909.

To manually stop the VNC server on your Linux database server, run the Linux command vncserver -kill, and provide the same port number you used when starting the VNC server. For example:

# /usr/bin/vncserver -kill :9
Killing Xvnc process ID 13836

Filed Under: Linux

Some more articles you might also be interested in …

  1. nethogs: command not found
  2. cpufreq-info: command not found
  3. whois: command not found
  4. How to Manage Zimbra Account Status from CLI
  5. How to Enable Verbose Logging for VSFTPD
  6. CentOS / RHEL : How to disable root login or root access on a system
  7. exif Command Examples in Linux
  8. CentOS / RHEL : How to delete LVM volume
  9. gdebi: command not found
  10. How to disable Ctrl+Alt+Del causing system reboot in CentOS/RHEL 6

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright