centos6安装vnc

yum安装

yum groupinstall -y "Desktop" yum install -y tigervnc-server tigervnc-server-module

安装这两个yum就够了,装第一个Desktop的时候可能会遇到缺少相关库等等,把镜像源替换成阿里云的就可以了。

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

``wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo`

安装完vnc,配置完密码之后按照下边修改配置文件然后再启动vnc,再用vnc连就可以了。

vi /etc/sysconfig/vncservers
#注释以下两行
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
#添加以下两行
VNCSERVERS="1:root"  
VNCSERVERARGS[1]="-geometry 1024x768" vi /root/.vnc/xstartup
#注释以下两行
#ixterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
#添加gnome-session & 
gnome-session & 
#xstartup赋权
chmod 777 /root/.vnc/xstartup

centos7安装vnc

yum安装

yum groupinstall "GNOME Desktop" yum install -y tigervnc-server tigervnc-server-module

yum安装,正常用阿里云的源这个"GNOME Desktop"是可以正常装上去的。装完配置完密码就按照vnc配置文件里提示的步骤改配置文件就行了

# The vncserver service unit file
#
# Quick HowTo:
# 1. Copy this file to /etc/systemd/system/vncserver@.service
# 2. Replace <USER> with the actual user name and edit vncserver
# parameters appropriately
# (ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
# PIDFile=/home/<USER>/.vnc/%H%i.pid)
# 3. Run `systemctl daemon-reload`
# 4. Run `systemctl enable vncserver@:<display>.service`
  1. 拷贝配置文件到 /etc/systemd/system/vncserver@.service

    cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

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

    [Unit]
    Description=Remote desktop service (VNC)
    After=syslog.target network.target [Service]
    Type=forking
    user=root
    # Clean any existing files in /tmp/.X11-unix environment
    ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
    ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver :1"
    PIDFile=/root/.vnc/%H:1.pid
    ExecStop=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :' [Install]
    WantedBy=multi-user.target

    参照上边的配置文件修改就可以了,根据自己的需要改,不是root用户启动的vnc可以把root换成其他用户。

    3.执行提示的第三步和第四步,让配置文件生效,和开启服务

    systemctl daemon-reload

    systemctl enable vncserver@:<display>.service

    systemctl start vncserver@:1.service

注意点

执行./runInstaller之后可能会报错,并且安装图形化状况不弹出来,则需要在root账户下执行xhost +,然后切换到oracle账户,执行export DISPLAY=:0.0,然后再执行./runInstaller,图形化界面应该就可以弹出来了,不过还是要视具体报错来看。

参考报错

[oracle@iZk55kn4inic7nZ database]$ ./runInstaller
Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 28019 MB Passed
Checking swap space: 0 MB available, 150 MB required. Failed <<<<
Checking monitor: must be configured to display at least 256 colors
>>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<< Some requirement checks failed. You must fulfill these requirements before continuing with the installation, Continue? (y/n) [n] y >>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-09-11_11-21-23PM. Please wait ...
DISPLAY not set. Please set the DISPLAY and try again.
Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
- For csh: % setenv DISPLAY 192.168.1.128:0.0
- For sh, ksh and bash: $ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
echo $SHELL
Use the following command to view the current DISPLAY environment variable setting:
echo $DISPLAY
- Make sure that client users are authorized to connect to the X Server.
To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':
% <full path to xclock.. see below>
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
Typical path for xclock: /usr/X11R6/bin/xclock

记得主机名也是要配置的,配置自己主机实际IP和主机名,<主机名实际IP><主机名>

centos6和7安装vnc的更多相关文章

  1. CentOS6.6中安装VNC server(CentOS配置远程桌面)

    1.安装服务 yum install tigervnc-server 1 2 名字有点怪哦,CentOS5前叫vnc-server 2.运行并设置密码 vncserver + 回车 1 2 输入密码, ...

  2. centos6.7下安装配置vnc

    vnc是一款使用广泛的服务器管理软件,可以实现图形化管理,下面简单介绍一下如何在centos6.7下安装vnc. 1.安装vncserver yum install tigervnc tigervnc ...

  3. Centos6 安装vnc

    Centos6 安装vnc 1. 安装 使用yum方式安装 yum install tigervnc-server tigervnc #启动 vncserver #重启动 /etc/init.d/vn ...

  4. CentOS6.4安装VNC

    http://jingyan.baidu.com/article/ca2d939dd1dabbeb6c31ce24.html 一.安装 VNC 默认情况下,CentOS 6.4 是没有安装的. 检查是 ...

  5. Centos6.x 安装vnc

    一.安装gnome桌面环境 如果系统已经安装了gnome桌面环境,此步省略. # 安装fontforge,避免字体出现方框乱码 yum install fontforge -y # 安装gnome桌面 ...

  6. (转)centos6.5安装VNC

    在Linux下用VNC远程桌面是个很不错的玩意.但在CentOS中默认没有安装VNC的.可以用下面语句查询,如果出现下面情况说明没有安装vnc #rpm -q tigervnc tigervnc-se ...

  7. Linux Centos6.9下安装部署VNC的实操详述

    VNC (Virtual Network Console)是虚拟网络控制台的缩写.它 是一款优秀的远程控制工具软件,由著名的AT&T的欧洲研究实验室开发的.VNC 是在基于 UNIX和 Lin ...

  8. Centos6.9下安装并使用VNC的操作记录

    VNC是一个的"远程桌面"工具.,通常用于“图形界面”的方式登录服务器,可视化操作.废话不多说了,操作记录如下: 1)安装桌面环境 [root@vm01 ~]# yum -y gr ...

  9. centos6.5安装VNC、远程及启动关闭

    标签: centos vnc 远程桌面 安装 详解 0.说明 安装服务的过程当中,最好是在联网环境下操作.由于涉及到远程连接的问题,系统的防火墙需要关闭,或者是做好相应的过滤策略.参考了网上很多大牛的 ...

随机推荐

  1. >>> print "hello" SyntaxError: Missing parentheses in call to 'print'

    错误原因说你的函数print缺省圆括号,可以知道你用的python是3.x版本3.x版本的python,print中的参数要用圆括号括起来,改成:print("hello")

  2. Dubbo面试常见问题

    一.dubbo是什么? dubbo是⼀个分布式服务框架,提供⾼性能和透明化的RPC远程服务调⽤⽅案,以及SOA服务治理方案.说白了其实dubbo就是一个远程调用的分布式框架. 二.dubbo的核心服务 ...

  3. spark window本地运行wordcount错误

    在运行本地运行spark或者hadoop代码时可能会遇到一下三种问题   1.Exception in thread "main" java.lang.UnsatisfiedLin ...

  4. Hive速览

    一.概述 Hive由Facebook开源,是一个构建在Hadoop之上的数据仓库工具 将结构化的数据映射成表 支持类SQL查询,Hive中称为HQL 1.读模式 2.Hive架构 3.使用Hive的原 ...

  5. jQuery与Vue的区别、从jQuery到Vue框架优点总结

    一.两者的区别 1.数据与视图分离 2.数据驱动视图 二.从jQuery到Vue框架的总结 1.数据与视图分离,解耦 2.数据驱动视图,只关心数据,DOM操作已经被框架封装

  6. Spring boot自定义拦截器和拦截器重定向配置简单介绍

    大家好: 本文简单介绍一下用于权限控制的Spring boot拦截器配置,拦截器重定向问题. 开发工具:jdk1.8   idea2017(付费版,网上找的破解教程) 1,首先使用idea创建一个Sp ...

  7. SQl 分组后按照某一列拼接字符串

    /* 分组之后拼接字符串 */ ;with t as( SELECT WorkflowId,Remark FROM dbo.OperatorAutomationProcess GROUP BY Wor ...

  8. Python:验证码识别

    说明:此验证方法很弱,几乎无法识别出正确的验证码  

  9. Delphi实现程序只运行一次并激活已打开的程序

    我们的程序有时候只允许运行一次,并且最好的情况是,如果程序第二次运行,就激活原来的程序.网上有很多的方法实现程序只运行一次,但对于激活原来的窗口却都不怎么好.关键就在于激活原来的程序,一般的做法是在工 ...

  10. (转)ubuntu下如何安装使用SSH?

    转:http://os.51cto.com/art/201109/291634.htm ubuntu默认并没有安装ssh服务,如果通过ssh链接ubuntu(比如使用securecrt客户端来访问ub ...