桌面版centos安装vncserver并在windows下使用VNC Viewer远程连接

首先关闭防火墙

在Centos中安装vncserver

yum install tigervnc-server

拷贝一份  /lib/systemd/system/[email protected]

cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]:1.service

编辑/etc/systemd/system/vncserver@:1.service

vim /etc/systemd/system/[email protected]:1.service

修改内容为

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
#Type=forking
Type=simple
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :‘
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i -geometry 1280x720"                #其中的root是用户名
PIDFile=/home/oracle/.vnc/%H%i.pid
ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :‘

[Install]
WantedBy=multi-user.target

保存后重新加载此文件

systemctl daemon-reload

设置开机启动

systemctl enable [email protected]:1.service

执行

vncserver

设定密码,输入自己的密码即可

杀死服务并重启

vncserver -kill :1
systemctl daemon-reload
systemctl restart [email protected]:1.service

查看服务开启状态

systemctl restart [email protected]:1.service

出现下列情况表示服务成功开启

查看服务开启的端口号

netstat -lntpu | grep vnc --color

现在在windows中下载 VNC Viewer (百度即可) 并安装

运行软件

在搜索框中输入Centos的IP以及端口(我这里是5901),然后回车连接,在弹框中输入之前设置的密码即可成功连接

不过这个软件不支持文件传输,还是很不方便的(^ _^)

遇到的问题:

开启服务失败

[[email protected] hadoop]# systemctl restart [email protected]:1.service
Job for [email protected]:1.service failed because the control process exited with error code. See "systemctl status [email protected]:1.service" and "journalctl -xe" for details.

解决办法1:执行下列命令删除 /tmp/.X11-unix/

rm -rf /tmp/.X11-unix/

(但是在我这并没有解决问题,方法来源于网络)

解决办法2:将/etc/systemd/system/vncserver@:1.service文件中的Type改为simple(之前默认为forking)

[Service]
#Type=forking
Type=simple


本节完......

原文地址:https://www.cnblogs.com/xinglichao/p/9774628.html

时间: 2024-08-06 04:00:04

桌面版centos安装vncserver并在windows下使用VNC Viewer远程连接的相关文章

windows下使用vnc viewer远程连接Linux桌面

在windows下使用vnc viewer远程连接Linux桌面,主要配置步骤: Linux: 1.rpm -qa vnc //查看是否安装vnc服务,如果没有安装,可以使用yum,或者rpm进行安装 2.修改配置文件: vim /etc/sysconfig/vncservers,如下图修改 3.设置vnc密码: vncpasswd 4.启动vncserver: service vncserver start 5.更改xstartup配置: vim /root/.vnc/xstartup,如下图

windows下使用vnc viewer 远程链接Linux桌面

在window下使用vnc viewer 连接Linux桌面 配置步骤: Linux: rpm -qa  vnc    //查看是否安装vnc服务,如果没有安装,可以使用yum 或者rpm 给以安装 2.修改配置文件 : vim /etc/sysconfig/vncservers ,如下图所示: 3.设置vnc密码: vncpasswd 4.启动vncserver :  service vncserver start 5. 更改xstartup 配置:  vim /root/.vnc/xstar

windows下在eclipse上远程连接hadoop集群调试mapreduce错误记录

第一次跑mapreduce,记录遇到的几个问题,hadoop集群是CDH版本的,但我windows本地的jar包是直接用hadoop2.6.0的版本,并没有特意找CDH版本的 1.Exception in thread "main" java.lang.NullPointerException atjava.lang.ProcessBuilder.start 下载Hadoop2以上版本时,在Hadoop2的bin目录下没有winutils.exe和hadoop.dll,网上找到对应版本

windows下通过VNC图形化访问Ubuntu桌面环境

要在windows下图形化访问Ubuntu或其它Linux系统桌面环境有很多方法,我比较喜欢的是使用VNC服务,需要在Ubuntu下安装vncserver和在windows下安装客户端访问工具. 1. windows下客户端访问工具 对于VNC,客户端访问工具也有不少,比如RealVNC.VNCViewer等,我比较喜欢的是VNCViewer,比较小巧轻量级,使用也十分简单,如下图所示: 后面的:1是分配的桌面号,可以给不同的客户端分配不同的桌面号访问,如果是默认端口这样输入就可以了,如果设置了

windows下通过VNC客户端软件远程连接Ubuntu14.04的桌面共享服务vino

http://www.ubuntukylin.com/ukylin/forum.php?mod=viewthread&tid=8631 https://bugs.launchpad.net/ubuntu/+source/vino/+bug/1290666 解决方案如下: 1.安装dconf-editor sudo apt-get install dconf-editor 2.用Dconf-editor调整,并访问如下配置路径 org > gnome > desktop > app

CentOS下安装MySQL,Windows下使用Navicat for MySql连接

安装 查看有没有安装过:          yum list installed mysql*          rpm -qa | grep mysql* 查看有没有安装包:          yum list mysql* 安装mysqlclient:          yum install mysql 安装mysql server端:          yum install mysql-server          yum install mysql-devel 启动&&停止

windows下Apache配置SSL安全连接

什么是SSL? SSL(Secure Socket Layer): 是为Http传输提供安全的协议,通过证书认证来确保客户端和网站服务器之间的数据是安全.Open SSL下载地址:http://www.openssl.org/source/ 一.下载并安装 支持SSL的 Apache  1.安装配有SSL模块的apache, 下载地址http://httpd.apache.org/download.cgi#apache23附件提供httpd-2.2.15-win32-x86-openssl-0.

windows下检测软件的网络连接

首先打开任务管理器选中你要查看的应用,右键转到进程 可以看到进程的PID 打开cmd命令行窗口 再输入netstat  -ano|findstr 2652即可查到应用的网络连接状况 windows下检测软件的网络连接

使用Teamviewer远程桌面版CentOS 6.5

1.下载.安装并运行Teamviewer # wget https://dl.tvcdn.de/download/version_12x/teamviewer_12.0.85001.i686.rpm # yum install teamviewer_12.0.85001.i686.rpm  # service start teamviewer # service status teamviewer # service enable teamviewer 2.应用Teamviewer # team