Linux之vnc启动及异常处理

摘要:
1) 启动桌面1的服务[root@testdb~]#Vncserver:1。log2)手动终止已启动的VNC服务进程[root@testdb~]#Ps ef|grep ivnc|grep vgreproot11781011:此处可以看到错误消息[root@testdb~]#Vncserver:仍报告错误[root@testdb~]#vncserver:1(root)'desktopistestdb:

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启动及异常处理》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇【转】如何给Ubuntu添加Windows及Mac字体?pg_ctl — 启动、停止、重启 PostgreSQL下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Github Actions 还能做这些事

前言 最近公司内部项目的发布流程接入了 GitHub Actions,整个体验过程还是比较美好的;本文主要目的是对于没有还接触过 GitHub Actions的新手,能够利用它快速构建自动测试及打包推送 Docker 镜像等自动化流程。 创建项目 本文主要以 Go 语言为例,当然其他语言也是类似的,与语言本身关系不大。 这里我们首先在 GitHub 上创...

docker 和 FastDFS上传和下载文件

1,从仓库拉取镜像 sudo docker image pull delron/fastdfs  也可以解压已经打包好的镜像文件 $ sudo docker load -i 文件路径/fastdfs_docker.tar 2,开启tracker容器   将tracker运行目录映射到宿主机的/var/fdfs/tracker目录中 sudo docker...

Docker php安装扩展步骤详解

前言 此篇,主要是演示docker-php-source , docker-php-ext-install ,docker-php-enable-docker-configure 这四个命令到底是用来干嘛的,它们在PHP容器中都做了哪些事情。 很多人很不理解在Dockerfile中安装PHP扩展的时候总是出现这几个命令,本篇就就是为你揭开这些命令的神秘面纱...

Hutool-解析JSON

1、创建JSONObject JSONObject jsonObject = JSONUtil.createObj() .put("姓名","张三") .put("年龄",12) .put("国籍","中国") .put("爱好"...

在 Node.js 中引入模块:你所需要知道的一切都在这里

本文作者:Jacob Beltran 编译:胡子大哈 翻译原文:http://huziketang.com/blog/posts/detail?postId=58eaf471a58c240ae35bb8e3 英文连接:Requiring modules in Node.js: Everything you need to know Node 中有两个...

小程序分包加载

开发者需要将小程序划分成不同的子包,在构建时打包成不同的分包,用户在使用时按需进行加载。 在构建小程序分包项目时,构建会输出一个或多个分包。每个使用分包小程序必须包含 一个主包,所谓的主包,即放置默认启动页/TabBar 页面,以及一些所有分包需要用到 整个小程序所有分包大小不超过 8M单个分包/主包大小不能超2M 对小程序进行分包,可以优化小程序首次启动...