1)启动桌面1的服务

[root@testdb ~]# vncserver :1
New 'testdb:1 (root)' desktop is testdb:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/testdb:1.log

2)手工杀掉已经启动的VNC服务进程

[root@testdb ~]# ps -ef | grep -i vnc | grep -v grep
root      1178     1  0 11:07 pts/2    00:00:00 Xvnc :1 -desktop testdb:1 (root) -httpd /usr/share/vnc/classes -auth /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -pn
root 1182 1 0 11:07 pts/2 00:00:00 vncconfig -iconic
[root@testdb ~]# kill -9 1178

3)确认进程已经杀掉

[root@testdb ~]# ps -ef | grep -i vnc | grep -v grep

4)再次启动桌面1的VNC服务,这里可以看到报错

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

5)按照错误提示的内容,需要删除/tmp/.X1-lock文件

[root@testdb ~]# rm -f /tmp/.X1-lock

启动尝试,仍然报错

[root@testdb ~]# vncserver :1
Warning: testdb:1 is taken because of /tmp/.X11-unix/X1
Remove this file if there is no X server testdb:1
A VNC server is already running as :1

同样,按照提示的错误,进一步删除/tmp/.X11-unix/X1文件

[root@testdb ~]# rm -f /tmp/.X11-unix/X1
再次启动尝试,OK,启动成功!
[root@testdb ~]# vncserver :1
New 'testdb:1 (root)' desktop is testdb:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/testdb:1.log

6)如果服务器异常关机很可能会出现5)的问题,根据提示删除文件,最后运行命令开启VNC服务

systemctl start vncserver@:1.service

Linux之vnc启动及异常处理的更多相关文章

  1. Linux上VNC 启动和关闭常见问题

    0, 重设密码 [root@yqrh5u2 ~]# vncpasswd           Password:          Verify:        [root@yqrh5u2 ~]# 1, ...

  2. Linux上VNC 启动和关闭

    查询vnc的线程: [admin@cn2-uat-esb-01-0001 ~]$ ps -ef|grep vncadmin 19080 21305 0 10:04 pts/2 00:00:00 gre ...

  3. 【VNC】Linux环境VNC服务安装、配置与使用

     [VNC]Linux环境VNC服务安装.配置与使用 2009-06-25 15:55:31 分类: Linux   前言:作为一名DBA,在创建Oracle数据库的过程中一般要使用dbca和netc ...

  4. 红帽Linux 配置VNC桌面远程工具

    1.先确认VNC是否安装 默认情况下,Red Hat Enterprise Linux安装程序会将VNC服务安装在系统上. 使用rpm命令检查是否安装了vnc,如果安装了就显示软件名称: [root@ ...

  5. Window VNC远程控制LINUX:VNC详细配置介绍

    Window VNC远程控制LINUX:VNC详细配置介绍 //---------------------------------------vnc linux下的详细配置 1.VNC的启动/停止/重 ...

  6. Linux下VNC配置多个桌面和修改密码 不会当系统重启vnc失效

    1:vncserver 2:iptables -I INPUT -p tcp --dport 5901 -j ACCEPT   客户端方式 3:iptables -I INPUT -p tcp --d ...

  7. Linux下VNC配置使用总结:开启+桌面配置+安全访问

    操作环境:CentOS 5.3 + Windows XP SP3 32bit + RealVNC 4.1.2 i386 + TigerVNC. 参考:潇湘隐者-Linux系统VNC配置实践总结,萨米的 ...

  8. 虚拟机下linux迁移造成MAC地址异常处理办法

    虚拟机下linux迁移造成MAC地址异常处理办法 Linux无法启用网卡:Device eth0 has different MAC address than expected,ignoring解决 ...

  9. Linux系统开机启动时的工作原理

    Linux系统开机启动时的工作原理也是深入了解Linux系统核心工作原理的一个很好的途径. 启动第一步--加载BIOS 当你打开计算机电源,计算机会首先加载BIOS信息,BIOS信息是如此的重要,以至 ...

随机推荐

  1. Centos7.3安装Mysql5.7.26(glibc即linux通用版)

    1.检查防火墙是否关闭 //查看防火墙状态 firewall-cmd --state //关闭防火墙 systemctl stop firewalld systemctl disable firewa ...

  2. hdu 1576

    老生常谈的问题 利用同余的思想 抽象出表达式  bx+9973y=n 然后用bx+9973y=1(题目给出了gcd(b,9973)=1) 求出基础解 y0 bx+9973y=n 的 基础解y=n*y0 ...

  3. layer的两种提示信息

    layer.msg('您的航班价格已变动,请返回重新选择航班!', { time: 10000, shade : [0.6 , '#000' , true], btn: ['返回列表', '关闭'], ...

  4. CSS3总结三:文字(text)/字体、文本、文本装饰、多列

    Text-Decoration text-shadow text-decoration Font font font-face Text 常用Text属性 Multi-column Multi-col ...

  5. 给没有连接因特网的centos使用yum安装其他软件(转)

    https://blog.csdn.net/bbg221/article/details/78360618 在centos上,使用yum安装软件很方便,比如安装gcc,java等, 但是在没有网络的情 ...

  6. Linux--环境变量配置文件

    Linux系统中环境变量配置文件分为两类: 全局环境变量配置文件 /etc/profile 用户环境变量配置文件 ~/.bash_profile . ~/.bash_login ~/.profile ...

  7. https://bbs.ichunqiu.com/thread-48915-1-1.html

    使用BurpSuite进行双文件上传拿Webshell 首先进入网站后台:(后台界面应该是良精CMS) <ignore_js_op> 在 添加产品 这一栏有个上传文件: <ignor ...

  8. python+opencv+sift环境配置教程

    最近在做对应点估计homography,需要用到opencv,c++的接口不如python的接口来的方便 但是在安装python接口的opencv的时候,遇到了各种问题,主要是函数找不到的问题 比如在 ...

  9. 基于MQTT的串口数据转发器

    问: ComHub能做什么?ComHub使用MQTT协议,将串口数据经TCP分发出去.这种结构可以实现很多功能:1.COM-Over-TCP: 将COM数据使用TCP远程传送;2.COM多播:一个CO ...

  10. C++ void*解惑

    最近遇到void *的问题无法解决,发现再也无法逃避了(以前都是采取悄悄绕过原则),于是我决定直面它. 在哪遇到了? 线程创建函数pthread_create()的最后一个参数void *arg,嗯? ...