centos 开启VNC
安装软件包(有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的更多相关文章
- macOS 开启 VNC 远程桌面和 SSH 服务
macOS 开启 VNC 远程桌面和 SSH 服务 准备用 macOS 来做为服务器,既然是服务器,那不可缺少的是远程管理,实际上 macOS 自带 VNC 远程桌面和 SSH 服务,只是默认没有开启 ...
- 05. 树莓派初始配置——开启VNC远程桌面
开启VNC远程桌面 不插显示器就可以看到树莓派系统界面的方式. 1. 如果你下的系统镜像有包含一些基本软件(Raspberry Pi OS with desktop and recommended s ...
- CentOS 7.1安装GNOME,开启VNC Server
版权声明:本文为博主原创文章,未经博主允许不得转载. A.准备: 1.安装GNOME Desktop yum groupinstall 'GNOME Desktop' 2.确认GNOME Deskto ...
- CentOS 7 开启VNC Service
由於是透過 GUI 管理, 所以需要圖形桌面環境, 如果沒有安裝, 可以用以下指令安裝 GNOME: # yum groupinstall “GNOME Desktop” Centos 7安裝 VNC ...
- CentOS 5.11开启VNC Service
1. #yum install vncserver 2. #vncpasswd 此密码将成为vnc的login password password: ...
- 基于CentOS搭建VNC远程桌面服务
系统要求:CentOS 7.2 64 位操作系统 安装.启动 VNC VNC 远程桌面原理 名词解释: Xorg:在 Linux 用户中非常流行,已经成为图形用户程序的必备条件,所以大部分发行版都提供 ...
- centos安装VNC的方法
https://help.aliyun.com/knowledge_detail/6698160.html(阿里云官方文档,但是官方文档有些地方是错的,我更正了下) ----------------- ...
- CentOS下VNC使用
1. 介绍 本文主要介绍了VNC Server的配置和使用 2. 安装 CentOS中默认就有安装VNC,可以通过命令rpm查看 [Jerry@localhost ~]$ rpm -qa | grep ...
- CentOS 安装VNC Server
环境 服务器:192.168.10.181 系统:CentOS 6.0 安装过程 1.切换至root用户 2.检测系统是否安装VNC [root@Nginx canyouNgx]# rpm -q vn ...
随机推荐
- CF#345 (Div1)
论蒟蒻如何被cf虐 以下是身败名裂后的题解菌=========== Div1 A.Watchmen 有n个点,每个点有一个坐标.求曼哈顿距离=欧几里得距离的点对数量. 只需要统计x或y一样的点对数量. ...
- 线程 VS 进程
线程是指进程内的一个执行单元,也是进程内的可调度实体. 与进程的区别: (1)地址空间:进程内的一个执行单元;进程至少有一个线程;它们共享进程的地址空间;而进程有自己独立的地址空间; (2)资源拥有: ...
- MongoDB集群架构及搭建
MongoDB分布式集群 MongDB分布式集群能够对数据进行备份,提高数据安全性,以及提高集群提高读写服务的能力和数据存储能力.主要通过副本集(replica)对数据进行备份,通过分片(shardi ...
- SPM FDR校正
来源: http://blog.sciencenet.cn/blog-479412-572049.html,http://52brain.com/thread-15512-1-1.html SPM8允 ...
- js/jquery判断浏览器的方法小结
在网站前端开发中,浏览器兼容性是前端开发框架要解决的第一个问题,要解决兼容性问题就得首先准确判断出浏览器的类型及其版本,而判断浏览器的版本一般只能通过分析浏览器的userAgent才能知道.今天我们把 ...
- 后台运行程序screen or nohup
后台运行 方法1 & 方法2:screen screen –S lnmp à起个名字 进去后运行程序 Ctrl+ad à退出lnmp屏幕 Scree –ls à查看 Screen –r x ...
- QDir的mkdir和mkpath区别
mkdir:上层目录不存在时,创建会失败.比如创建“c:\\test\test”,如果test不存在,那test也创建不了.目录已经存在时会返回false. mkpath:上层目录不存在也没关系,自动 ...
- NDK开发之javaVM
1.关于JNIEnv和JavaVM JNIEnv是一个与线程相关的变量,不同线程的JNIEnv彼此独立.JavaVM是虚拟机在JNI层的代表,在一个虚拟机进程中只有一个JavaVM,因此该进程的所有线 ...
- js的Array的map和sort实现方法
Array.prototype.mapA = function(fun /*, thisp*/) { var len = this.length; if (typeof fun != "fu ...
- bat批处理文件启动Eclipse和ivy本地仓库的配置
一.bat批处理文件启动Eclipse 所需文件: 1.eclipse 2.jre 3.startup-eclipse.bat 确保以上三个文件夹同级 startup-eclipse.bat: set ...