在Linux下用vnc远程桌面,centos中默认没有安装VNC

查询系统是否安装VNC

# rpm -q tigervnc tigervnc-server

安装VNC服务

# yum install tigervnc tigervnc-server -y

为vncserver设置密码

[root@localhost ~]# vncserver

You will require a password to access your desktops.

Password:<输入vnc登录密码>
Verify:<再次输入vnc登录密码> 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 ~]#

配置vnc

为了防止黑屏,需要修改一下/root/.vnc/xstartup,注释下面两行并添加一行内容

# vi /root/.vnc/xstartup

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

修改用户配置文件

# vi /etc/sysconfig/vncservers

注释上面两行,最后增加下面两行

VNCSERVERS="2:root"
VNCSERVERARGS[]="-geometry 1024x768 -depth 32"

改变xstartup的权限

# chmod 777 /root/.vnc/xstartup

防火墙开放端或者也可以直接关闭防火墙

查看端口号

# netstat -antpl

关闭防火墙

# service iptables stop

打开防火墙的监听端口

vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT //在此行下方增加
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900:5903 -j ACCEPT
保存退出,重启防火墙
service iptables restart

启动VNC

# /etc/init.d/vncserver start

然后在Windows中用客户端登录

输入设置的VNC密码

连接成功

centos6.5远程桌面连接(VNC\SPice)的更多相关文章

  1. linux远程桌面连接 VNC Server

    更新源 # sudo apt-get update 安装vnc4server # sudo apt-get install vnc4server 修改vnc远程连接密码 # vncpasswd 编辑v ...

  2. 通过VNC Viewer使用VMware虚拟机的远程桌面连接

    本文转自:http://www.14blog.com/archives/185 要在VMware虚拟机中使用远程桌面连接?方法有两个:一种是在虚拟机中做“端口映射”,当然,这个稍显复杂(虚拟机端口映射 ...

  3. CentOS7配置图形界面及设置vnc远程连接、windows远程桌面连接

    安装CentOS桌面 yum groupinstall "GNOME Desktop" 重启,进入终端,将启动模式变更为图形模式 systemctl set-default gra ...

  4. 树莓派3_win10下使用"远程桌面连接"与树莓派通信(使用VNC实现连接后)

    -----------------------------------------------------------学无止境------------------------------------- ...

  5. Windows与Linux相互远程桌面连接

        对于远程桌面连接Linux,大家可能会第一时间想到使用VNC,,远程桌面Windows,大家第一时间会想到使用Windows自带的远程桌面.那么有没有办法,使得在Linux中可以远程Windo ...

  6. 远程桌面连接KVM虚拟机

    问题描述 有些时候,由于网络存在问题,虚拟机无法获取到IP地址,无法使用spice或vnc来连接虚拟机,但是又需要连到虚拟机来排查故障 解决办法 编辑虚拟机配置 设置xml命名空间 <domai ...

  7. 阿里云服务器上开启linux远程桌面连接

    一.说明: 本文的目的是实现在windows机器上利用远程桌面连接来访问远程的linux桌面. 这里使用的是阿里云服务器,操作系统为Centos6.5. 二.基本步骤: 1.首先保证服务器已经安装完毕 ...

  8. linux 远程桌面连接

    我们知道在windows下面我们可以用远程桌面连接来控制其它电脑, 但linux 远程桌面连接?不过在说怎样连接之前还是要先明确一个概念,为什么我标题没有用linux中的远程桌面连接呢, 这是因为Li ...

  9. xmanager远程桌面连接Linux

    远程桌面连接Linux,两种工具:vnc.xmanager xmanager使用参考如下,暂未整理: Xmanager连接Centos的远程桌面 | 大爱 http://lovesoo.org/xma ...

随机推荐

  1. hdu3746 Cyclic Nacklace KMP

    CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, ...

  2. Go Example--通道同步

    package main import ( "fmt" "time" ) func main() { //缓存通道 done := make(chan bool ...

  3. LeetCode - Kth Largest Element in a Stream

    Design a class to find the kth largest element in a stream. Note that it is the kth largest element ...

  4. shell批量创建随机文件名格式文件

    //随机生成文件 //文件名会带数字的...注意echo后面的是反引号,不是单引号 #!/bin/bash dir=/root/bp for i in 'seq 10' touch $dir`echo ...

  5. gdb入门

    下面是我自己写的一个测试用例 a.c #include<stdio.h> int add(int a,int b){ return a+b; } int main(){ int n=add ...

  6. Django 之老师讲的教师,班级学生,class_2_teacher四个表格的项目

    现数据库中有四张表格 要求:实现查询功能  页面显示教师  id 姓名  教学班级 url 处设置 url(r'teacher_list/',teacher_list),  teacher_list函 ...

  7. 内置函数——filter和map

    filter filter()函数接收一个函数 f 和一个list,这个函数 f 的作用是对每个元素进行判断,返回 True或 False  ,  filter()根据判断结果自动过滤掉不符合条件的元 ...

  8. ESB雏形 -- 项目企业服务总线初始

    今天要厚着脸皮给大家推荐一个自己做的通信中间件——ServiceAnt,目前已经在我们团队的两个产品线上投入了使用. ServiceAnt是什么 它最初的定位是ESB(企业服务总线),但目前还没有达到 ...

  9. 非递归和递归分别实现求第n个斐波那契数。

    菲波那切数列为:0 1 1 2 3 5 8 13 21 34... 规律:从第三个数字起后面的每一个数字都是前两个数字的和. 非递归算法: #include<stdio.h> int ma ...

  10. 自动化部署--shell脚本--2

    node1和node2都装apache   [root@linux-node1 ~]# yum install httpd -y Loaded plugins: fastestmirror Loadi ...