VNC Viewer

首先需要明确,什么事VNC , Virtual Network Computing ,VNC允许Linux系统可以类似实现像Windows中的远程桌面访问那样访问Linux桌面。

首先试试服务器装了VNC没

[[email protected] ~]# rpm -q tigervnc tigervnc-server

没安装的话会直接出现

package tigervnc is not installed
package tigervnc-server is not installed

如果没有安装X-Windows 桌面的话要先安装Xwindows

[[email protected] ~]# yum check-update
[[email protected] ~]# yum groupinstall "X Window System"
[[email protected] ~]# yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
[[email protected] ~]# unlink /etc/systemd/system/default.target
[[email protected] ~]# ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
[[email protected] ~]# reboot

第一步,安装VNC packages:

[[email protected] ~]# yum install tigervnc-server -y

第二步,修改配置信息,在/etc/systemd/system/下建立文件夹[email protected]:1.service 把example config 文件从/lib/systemd/system/[email protected]复制到里面

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

然后打开这个配置文件/etc/systemd/system/[email protected]:1.service替换掉默认用户名

找到这一行

ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid

这里我直接用root 用户登录,所以我替换成

ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid

如果是其他用户的话比如john替换如下

ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid

第三步,重加载 systemd

[[email protected] ~]# systemctl daemon-reload

第四步,为VNC设密码

[[email protected] ~]# vncpasswd

第五步,由于我这边的Centos 7 是用iptable防火墙的所以

vim /etc/sysconfig/iptables

在合适位置加上

-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5903 -j ACCEPT

重启iptable

service iptables restart

如果是用Centos 7 默认防火墙的可能需要

[[email protected] ~]# firewall-cmd --permanent --add-service vnc-server
[[email protected] ~]# systemctl restart firewalld.service

第六步,设默认启动并开启VNC

[[email protected] ~]# systemctl enable [email protected]:1.service
[[email protected] ~]# systemctl start [email protected]:1.service

这样基本上Centos 端就设好了,Windows 端要去下一个VNC Viewer 的软件。连接一下试试看着有点简陋但是上去了的

转载自:http://wic.xingning.gov.cn/blog/29

时间: 2024-08-04 22:18:51

VNC Viewer的相关文章

vnc viewer on Ubuntu

我使用的是putty和SSL/SSH Vnc Viewer.因为刚入坑,也希望小白们能少走弯路,所以本贴写得比较细. 先说说vnc server和 vnc viewer的区别:server用于服务器,就是被控制的远程主机上,(本文不作具体介绍如何使用server):而viewer用于客户端,就是你的pc机,本文将介绍如何通过viewer登陆远程的主机. 1.安装putty和vnc 我是在 ubuntu软件 下搜索"putty"和"vnc viewer"安装的. 2.

ubuntu下使用vnc viewer

从昨天到今天弄了好久都登陆不成功vnc viewer,今天下午终于成功了.现在把我的经验放上来,供大家参考. 我使用的是putty和SSL/SSH Vnc Viewer.因为刚入坑,也希望小白们能少走弯路,所以本贴写得比较细. 先说说vnc server和 vnc viewer的区别:server用于服务器,就是被控制的远程主机上,(本文不作具体介绍如何使用server):而viewer用于客户端,就是你的pc机,本文将介绍如何通过viewer登陆远程的主机. 1.安装putty和vnc 我是在

如何使用VNC Viewer连接远程CentOS服务器

如何使用VNC Viewer连接远程CentOS服务器 安装图形界面 1. yum groupinstall  -y  "Desktop"   yum groupinstall -y "X Window System" 2.vi /etc/inittab 3. 4.Reboot Linux VNC server的安装及简单配置使用 1,打开终端使用yum命令安装vnc sever.命令:yum install tigervnc-server -y 2,将vncser

ORACLE 11g安装中vnc viewer黑屏现象

1,vnc viewer黑屏问题: 2,可能是centos下面的桌面组件没有安装好 yum groupinstall "X WindowSystem" "KDE Desktop" Desktop -y yumgroupinstall -y   "Desktop"   "DesktopPlatform"   "Desktop Platform Development" "Fonts" &q

Vnc viewer Linux远程连接

测试环境: 1.System version:redhat 6.5 2.client version:windows 10 .vnc viewer 配置步骤: 1. [[email protected] ~]#yum -y install tigervnc-server 2. [[email protected] ~]# vncserver You will require a password to access your desktops. Password: //输入密码 Verify:

VNC Viewer for windows 连接服务器centos6.8后出现方块乱码

一.环境 操作系统: [[email protected] zhi]# uname -a Linux bogon 2.6.32-642.11.1.el6.i686 #1 SMP Fri Nov 18 18:48:28 UTC 2016 i686 i686 i386 GNU/Linux [[email protected] zhi]# cat /etc/redhat-release  CentOS release 6.8 (Final) VNC Viewer : 二.故障 VNC登陆服务器后显示画

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下使用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,如下图

Linux VNC客户端软件VNC Viewer | RealVNC

Linux很多时候是作为服务器操作系统,如果是桌面系统通常情况会远程管理linux服务器,很多时候通过VNC进行远程管理,这个时候就要在客户端安装VNC客户端软件,VNC Viewer | RealVNC软件是VNC软件中用的比较多的. 安装:Linux各发行版因软件管理方式不同而不同,先通过软件管理从自己的软件仓库进行搜索安装如果有就进行安装,没有通过官网下载对应的二进制软件包进行安装 如.deb .rpm文件程序. 原文地址:https://www.cnblogs.com/pipci/p/8