安装软件包(有yum源安装的,不采用源码安装)

yum -y install vnc vnc-server

安装成功后,配置如下:

[root@localhost ~]# vncserver
#设置 VNC密码,输入:(在某用户下输入则登陆用户就是它,如果su imiss切换到imiss用户,输入vncserver则启动的是另一个桌面,同样要设置密码,以后在该账户下启动的vncserver登陆就需要在此用户下设置的密码了。)
You will require a password to access your desktops. Password:
Password must be at least characters - try again
Password:
Verify:
xauth: creating new authority file /root/.Xauthority New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain: Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:.log [root@localhost ~]# vncpasswd
Password:
Password must be at least characters - try again
Password:
Verify:
[root@localhost ~]#

修改配置文件:

vim ~/.vnc/xstartup (最后两行)

#xterm -geometry 80x24++ -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &

vim  /etc/sysconfig/vncservers  (最后两行)

# VNCSERVERS="2:myusername"
# VNCSERVERARGS[]="-geometry 800x600 -nolisten tcp -localhost"
VNCSERVERS="1:root"
VNCSERVERARGS[]="-geometry 800x600"

vi /etc/sysconfig/iptables (配置防火墙)

-A INPUT -m state --state NEW -m tcp -p tcp --dport  -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport -j ACCEPT
#VNC server 监听的端口从 5900 开始,display:1 的监听 5901,display:2 监听 5902,以此类推。CentOS 的防火墙缺省是不允许连接这些端口的,所以需要使用下面的步骤打开防火墙(需要 root 权限):
[root@localhost ~]# service iptables restart
iptables: Setting chains to policy ACCEPT: nat mangle filte[ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]

启动服务

[root@localhost ~]# chkconfig vncserver on
[root@localhost ~]# service vncserver start
Starting VNC server: :root
New 'localhost.localdomain:2 (root)' desktop is localhost.localdomain: Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:.log [ OK ]
[root@localhost ~]#

关闭vnc

vncserver -kill :
#注意kill后面要有一个空格

连接

centos 开启VNC的更多相关文章

  1. macOS 开启 VNC 远程桌面和 SSH 服务

    macOS 开启 VNC 远程桌面和 SSH 服务 准备用 macOS 来做为服务器,既然是服务器,那不可缺少的是远程管理,实际上 macOS 自带 VNC 远程桌面和 SSH 服务,只是默认没有开启 ...

  2. 05. 树莓派初始配置——开启VNC远程桌面

    开启VNC远程桌面 不插显示器就可以看到树莓派系统界面的方式. 1. 如果你下的系统镜像有包含一些基本软件(Raspberry Pi OS with desktop and recommended s ...

  3. CentOS 7.1安装GNOME,开启VNC Server

    版权声明:本文为博主原创文章,未经博主允许不得转载. A.准备: 1.安装GNOME Desktop yum groupinstall 'GNOME Desktop' 2.确认GNOME Deskto ...

  4. CentOS 7 开启VNC Service

    由於是透過 GUI 管理, 所以需要圖形桌面環境, 如果沒有安裝, 可以用以下指令安裝 GNOME: # yum groupinstall “GNOME Desktop” Centos 7安裝 VNC ...

  5. CentOS 5.11开启VNC Service

    1.     #yum install vncserver 2.     #vncpasswd       此密码将成为vnc的login password          password:    ...

  6. 基于CentOS搭建VNC远程桌面服务

    系统要求:CentOS 7.2 64 位操作系统 安装.启动 VNC VNC 远程桌面原理 名词解释: Xorg:在 Linux 用户中非常流行,已经成为图形用户程序的必备条件,所以大部分发行版都提供 ...

  7. centos安装VNC的方法

    https://help.aliyun.com/knowledge_detail/6698160.html(阿里云官方文档,但是官方文档有些地方是错的,我更正了下) ----------------- ...

  8. CentOS下VNC使用

    1. 介绍 本文主要介绍了VNC Server的配置和使用 2. 安装 CentOS中默认就有安装VNC,可以通过命令rpm查看 [Jerry@localhost ~]$ rpm -qa | grep ...

  9. CentOS 安装VNC Server

    环境 服务器:192.168.10.181 系统:CentOS 6.0 安装过程 1.切换至root用户 2.检测系统是否安装VNC [root@Nginx canyouNgx]# rpm -q vn ...

随机推荐

  1. windows Server 2008各版本区别详解

    Windows Server 2008 是专为强化下一代网络.应用程序和 Web 服务的功能而设计,是有史以来最先进的 Windows Server 操作系统.拥有 Windows Server 20 ...

  2. 用sql查询当天,一周,一个月的数据

    用sql查询当天,一周,一个月的数据   数据查询,不管在网站还是在系统,都很常见,下文是介绍最常见的以日期查询的语句 select * from ShopOrder where datediff(w ...

  3. Regular Expression Matching

    Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...

  4. grains

    用途 1,匹配客户端 2,配置文件里使用 3,资产管理     定义grains方法1:             方法2:        

  5. 软件工程(DBSD2016) Git Review

    说明:任何问题请在评论区说明,会集中更新回复. 连连看组 源码: git clone https://git.coding.net/jx8zjs/llk.git 提交日志 一共有20次commit日志 ...

  6. 工作随笔——使用svnsync实时备份SVN版本库

    前段时间把SVN版本库从win迁移到了Linux上,没隔几天那台win的磁盘就严重坏道了....这TMD什么运气! 花费了点时间研究了下svn自己的同步工具.写个日志记录下. 注意:svnsync要求 ...

  7. 网游中的网络编程系列1:UDP vs. TCP

    原文:UDP vs. TCP,作者是Glenn Fiedler,专注于游戏网络编程相关工作多年. 目录 网游中的网络编程系列1:UDP vs. TCP 网游中的网络编程2:发送和接收数据包 网游中的网 ...

  8. 移动端前端UI库—Frozen UI、WeUI、SUI Mobile

    [MUI]http://www.dcloud.io/ [Clouda]http://clouda.baidu.com/blend2是百度历时两年共同研发的开源App技术框架,基于Node.js,简单易 ...

  9. ASP.NET MVC 数据库依赖缓存的实现

    当数据库中的信息发生变化的时候,应用程序能够获取变化的通知是缓存依赖得以实现的基础.应用程序可以通过轮询获取数据变化的信息,使用轮询的话也不可能重新查一次后再和以前的数据做比较,如果这样的话如果我一个 ...

  10. memcache 安装

    1 下载两个文件 wget http://www.danga.com/memcached/dist/memcached-1.2.0.tar.gz wget http://www.monkey.org/ ...