Linux on VNC startup and shutdown already FAQ __linux

Source: Internet
Author: User
Tags auth

0. Reset Password

[root@yqrh5u2 ~]# vncpasswd
Password:
Verify:
[Root@yqrh5u2 ~]#

1, start and kill Vncserver

[root@yqrh5u2 ~]# vncserver:1

New ' yqrh5u2:1 (root) ' Desktop is yqrh5u2:1

Starting applications specified In/root/.vnc/xstartup
Log file Is/root/.vnc/yqrh5u2:1.log

[root@yqrh5u2 ~]# vncserver:2

New ' yqrh5u2:2 (root) ' Desktop is Yqrh5u2:2

Starting applications specified In/root/.vnc/xstartup
Log file Is/root/.vnc/yqrh5u2:2.log


[root@yqrh5u2 ~]# ps-ef|grep-i VNC
Root 12572 1 0 02:23 pts/2 00:00:00 xvnc:1-desktop yqrh5u2:1 (Root)-httpd/usr/share/vnc/classes-auth/roo t/. Xauthority-geometry 1024x768-depth 16-rfbwait 30000-rfbauth/root/.vnc/passwd-rfbport 5901-PN
Root 12580 1 0 02:23 pts/2 00:00:00 vncconfig-iconic
Root 12617 1 0 02:23 pts/2 00:00:00 xvnc:2-desktop yqrh5u2:2 (Root)-httpd/usr/share/vnc/classes-auth/roo t/. Xauthority-geometry 1024x768-depth 16-rfbwait 30000-rfbauth/root/.vnc/passwd-rfbport 5902-PN
Root 12625 1 0 02:23 pts/2 00:00:00 vncconfig-iconic
Root 12735 12536 0 02:24 pts/2 00:00:00 VNC

Manual kill:1,: 1 pid is 12572, and verify that 1 has actually been killed

[root@yqrh5u2 ~]# kill-9 12572
[root@yqrh5u2 ~]# ps-ef|grep-i VNC
Root 12617 1 0 02:23 pts/2 00:00:00 xvnc:2-desktop yqrh5u2:2 (Root)-httpd/usr/share/vnc/classes-auth/roo t/. Xauthority-geometry 1024x768-depth 16-rfbwait 30000-rfbauth/root/.vnc/passwd-rfbport 5902-PN
Root 12625 1 0 02:23 pts/2 00:00:00 vncconfig-iconic
Root 12779 12536 0 02:25 pts/2 00:00:00 VNC

Through Vncserver Kill:1,:2, this is the best way to recommend the use of

[root@yqrh5u2 ~]# vncserver-kill:1
Killing Xvnc process ID 12572
Kill 12572:no Such process
[root@yqrh5u2 ~]# vncserver-kill:2
Killing Xvnc process ID 12617
[root@yqrh5u2 ~]# ls/root/.vnc/
passwd Xstartup Yqrh5u2:1.log Yqrh5u2:2.log

2, restart a manual kill of the Vncserver,

Because it was manually deleted, you can restart it by deleting the lock file again, as shown in the figure

[root@yqrh5u2 ~]# vncserver

Warning:yqrh5u2:1 is taken because of/tmp/. X1-lock
Remove This file if there is no X server yqrh5u2:1

New ' yqrh5u2:2 (root) ' Desktop is Yqrh5u2:2

Starting applications specified In/root/.vnc/xstartup
Log file Is/root/.vnc/yqrh5u2:2.log

[root@yqrh5u2 ~]# vncserver:1

Warning:yqrh5u2:1 is taken because of/tmp/. X1-lock
Remove This file if there is no X server yqrh5u2:1
A VNC Server is already running as:1
[root@yqrh5u2 ~]# rm-f/tmp/. X1-lock
[root@yqrh5u2 ~]# vncserver:1

Warning:yqrh5u2:1 is taken because of/tmp/. X11-unix/x1
Remove This file if there is no X server yqrh5u2:1
A VNC Server is already running as:1
[root@yqrh5u2 ~]# ps-ef|grep-i VNC
Root 12971 1 0 02:32 pts/2 00:00:00 xvnc:2-desktop yqrh5u2:2 (Root)-httpd/usr/share/vnc/classes-auth/roo t/. Xauthority-geometry 1024x768-depth 16-rfbwait 30000-rfbauth/root/.vnc/passwd-rfbport 5902-PN
Root 12979 1 0 02:32 pts/2 00:00:00 vncconfig-iconic
Root 13047 12536 0 02:33 pts/2 00:00:00 VNC
[root@yqrh5u2 ~]# rm-f/tmp/. X11-unix/x1
[root@yqrh5u2 ~]# vncserver:1

New ' yqrh5u2:1 (root) ' Desktop is yqrh5u2:1

Starting applications specified In/root/.vnc/xstartup
Log file Is/root/.vnc/yqrh5u2:1.log

[root@yqrh5u2 ~]# ps-ef|grep-i VNC
Root 12971 1 0 02:32 pts/2 00:00:00 xvnc:2-desktop yqrh5u2:2 (Root)-httpd/usr/share/vnc/classes-auth/roo t/. Xauthority-geometry 1024x768-depth 16-rfbwait 30000-rfbauth/root/.vnc/passwd-rfbport 5902-PN
Root 12979 1 0 02:32 pts/2 00:00:00 vncconfig-iconic
Root 13071 1 1 02:33 pts/2 00:00:00 xvnc:1-desktop yqrh5u2:1 (Root)-httpd/usr/share/vnc/classes-auth/roo t/. Xauthority-geometry 1024x768-depth 16-rfbwait 30000-rfbauth/root/.vnc/passwd-rfbport 5901-PN
Root 13092 1 0 02:33 pts/2 00:00:00 vncconfig-iconic
Root 13123 12536 0 02:34 pts/2 00:00:00 VNC
[Root@yqrh5u2 ~]#

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.