VNCserver 配置 gnome 桌面

2023-05-16

HOWTO - Linux VNCserver

By Erik Rodriguez 

This article is a HOWTO for running VNCserver on Linux. These examples are specific to Red Hat Enterprise Linux, but should work on any type of Linux system.



What is VNCserver?

VNC stands for Virtual Network Computing. It was originally developed by AT&T as a way to administer machines without using the console. If you have used  Windows Terminal Services (RDP), VNC will seem very familiar. 

Why use VNCserver?

In Linux, everything can be done from a  shell. However, there may be a time when you need to access the machine as if you were at the console. 

Getting Started

You will need several things to get started:
  • root privledges
  • VNC client software (tightVNC, you can download it here.)
  • A good password!
As I mentioned above, this example is done with RHEL, which comes standard with VNCserver installed. To start the vncserver simply invoke the following commands:

[root@roswell etc]# service vncserver start
Starting VNC server:                                       [  OK  ]
[root@roswell etc]# 
[root@roswell etc]# vncpasswd
Password: 
Verify: 
[root@roswell etc]#
[root@roswell etc]# vncserver

New 'roswell:1 (root)' desktop is roswell:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/roswell:1.log

[root@roswell etc]# 
  
So what did we do there? First, we started the vncserver service. It may or may not have already been running on your system. Next we set a password to access the VNC desktop. When you set the password, you will not see any characters on the screen, and you must enter the password twice. You will only need to do this the very first time you run vncserver. The password will be saved in the Linux filesystem, and you can change it at any time by invoking the  vncpasswd command again. Last, to activate the VNC desktop, we simply invoked the  vncservercommand. Notice the output; the desktop is named "roswell:1" which can also be replaced via the machines IP address. 

Connecting

Assuming you already installed  TightVNC or another VNC client, enter the desktop name: 



You can replace the server name with an IP address if you are logging in from outside your LAN. Remember, if you are using  NAT port 5900 must be forwarded to your VNCserver. 



Upon successful connection, you will be prompted for a password. You will then see a terminal screen that will allow you to execute commands: 



VNCserver in Runlevel 5 (KDE or Gnome)

If you are new to linux, running VNC server with a terminal isn't going to do you much good. You might want to have a menu-driven GUI like Windows. No problem. Follow these steps: 


First, we are going to assume that VNCserver is running under the root user, as shown with the example above. For this example, I will be editing my VNCserver to enter Gnome. You can specify a KDE desktop if you have KDE installed on your server. Make sure you are in the root directory.

[root@roswell ~]# ls -a
.                                   cacti-0.8.6c.tar.gz  .gnome2_private     .lftp                  queue.dat          temp
..                                  client.cfg           .gnupg              machinedependent.dat  .recently-used      Templates
.config                             FAHlog-Prev.txt      .gstreamer-0.8      .metacity             .rhn-applet.cache  .themes
.cshrc                              FAHlog.txt           .gtkrc              .mozilla              .rhn-applet.conf   .thumbnails
.bash_history                       Desktop              .fonts.cache-1      .gtkrc-1.2-gnome2     .rnd               .Trash
.bash_logout                        .dmrc                .gconf              .ICEauthority         .mysql_history      scripts
.bash_profile                       .eggcups             .gconfd             .icons                .nautilus          .sh_history
.viminfo                            .bashrc              .bashdevl           .esd_auth             .gnome              php-4.11
.ssh                                .vnc                  cacti-0.8.6c       .gnome2                install.log
[root@roswell ~]# cd .vnc
[root@roswell .vnc]# ls
passwd         roswell:1.pid  roswell:2.pid  roswell:3.pid  roswell:4.pid  roswell:5.pid             roswell.area51.lan:1.pid
roswell:1.log  roswell:2.log  roswell:3.log  roswell:4.log  roswell:5.log  roswell.area51.lan:1.log  roswell.area51.lan:2.log
xstartup
[root@roswell .vnc]# vi xstartup
  


Using vi (vim) to edit the xstartup file, make sure your file matches this one: 



#!/bin/sh

# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
startx &
  


Notice that the last line is "startx &" as this command will launch Gnome upon login via VNCserver. If you are using a KDE desktop, the line "startkde &" should replace the last line. 

Logging in, you will be presented with a Gnome or KDE desktop. 



Shown above is a Gnome desktop on  Red Hat Enterprise Linux 4. 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

VNCserver 配置 gnome 桌面 的相关文章

  • Ubuntu Gnome下怎样修改应用的图标icon

    我在我机器上安装了一个matlab 但在软件搜索里找不到matlab 我发现是matlab没有对应的 desktop文件 顺便我将matlab的图标也修改下 步骤如下 1 准备一个icon图像文件 如我这里的文件名为matlab png 将
  • vncserver无法启动

    一 问题现象 运行vncserver的时候提示出错 xff0c 查看vnc的日志发现如下错误日志 litin 64 linuxService vnc cat linuxService 4 log Xvnc Free Edition 4 1
  • GNOMe面板丢失问题解决

    今天用安装虚拟机时屏幕太小 xff0c 安装框又不能向上拉 xff0c 导致我看不到下一步图标 xff0c 一怒之下 xff0c 把底面板给删了 xff0c 从此走上了麻烦之路 xff01 没有底面版 xff0c 很多最小化的图标都找不到
  • linux vncserver设置及配置自动启动

    VNC 服务端 vncserver 启动VNC vncserver kill num num一般从1开始 因为0被x server占用了 vncpasswd 设置vnc连接密码 要使用VNC图形界面修改 vnc xstartup配置文件中末
  • 开启CentOS 5.4下的vncserver服务

    2019独角兽企业重金招聘Python工程师标准 gt gt gt 开启CentOS 5 4下的vncserver服务 安装好CentOS 5 4后 xff0c 虽然我们可以通过ssh来远程登陆服务器 xff0c 但是我们使用ssh 毕竟是
  • linux安装vncserver服务,centos7最简单安装配置vncserver服务

    安装软件包 yum y install tigervnc server 添加防火墙策略 firewall cmd permanent zone 61 public add port 61 5900 5990 tcp firewall cmd
  • Ubuntu GNOME从入门到喜欢

    原文链接 xff1a Ubuntu GNOME从入门到喜欢 Keep Thinking 在Ubuntu官网下载的Ubuntu 16 04版本是Unity版本 xff0c Unity版本也可以 打扮 的很美观 xff0c 并且和今天介绍的GN
  • vncserver too many security failures

    在服务器上开了几个虚拟机 xff0c 装了VNC之后 xff0c 经常遇到报错too many security failures 查了下相关资料 xff0c 原来是有人在暴力破解 xff0c 触发了VNC的黑名单机制 重置黑名单 xff0
  • Ubuntu 使用VNCserver远程连接灰屏问题的解决方案

    问题 xff1a Ubuntu需要使用VNCserver服务提供远程桌面 xff0c 使用TightVNC Viewer远程连接主机 xff0c 发现只能出现三个正常显示的桌面 xff0c 继续开更多的桌面 xff0c 就会发现新开的窗口都
  • [授权发表]基于 VNCServer + noVNC 构建 Docker 桌面系统

    by Falcon of TinyLab org 2015 05 02 最初发表 xff1a 泰晓科技 聚焦嵌入式 Linux xff0c 追本溯源 xff0c 见微知著 xff01 原文链接 xff1a 基于 VNCServer 43 n
  • 在 Gnome 或 KDE 中以编程方式在桌面上移动应用程序窗口

    我想使用 C 程序在桌面上重新定位应用程序窗口 我应该如何去做 我需要针对这两种情况的解决方案 当我拥有想要移动的应用程序的源时 通过编写外部程序来移动其他应用程序的窗口 外部 Bash 脚本 xdotool search onlyvisi
  • gnome-terminal 无法工作,可能是因为区域设置

    我在日语环境下安装了Antergos Arch的简易版 但我想把语言改为英语 所以我建议维基文章 https wiki archlinux org index php Locale然后取消注释后运行一些命令 en US UTF 8 UTF
  • 无法从 git.gnome.org 克隆

    我正在使用 Ubuntu 操作系统 我尝试从 git gnome org 克隆几个存储库 例如 git clone git git gnome org newcomers tutorial Cloning into newcomers tu
  • 在 GEdit 中创建您自己的语法突出显示?

    如何将 关键字 添加到 GEdit 关键字列表中 我基本上想让 printf 函数看起来像一个关键字 printf Hello World n GEdit 使用Gtk源视图 http projects gnome org gtksource
  • Gtk Ckipboard:使用自定义 URI 方案从源粘贴文件

    我正在尝试编写一个 GTK C 应用程序 将一些文件放在 Gtk 剪贴板上 以便使用 Nautilus 的用户能够粘贴它们 有一个好的stackoverflow 上 Gtk 剪贴板本地文件复制和粘贴的示例 https stackoverfl
  • GtKGLArea 无法创建 OpenGL 2.1 上下文

    我目前正在为我的游戏引擎项目开发一个简单的编辑器 虽然该项目似乎在我的主工作站 支持 OpenGL 3 3 的 GTX 650Ti 上运行得很好 但当我在我的设备上测试它时 它似乎被破坏了 测试桌面 GMA4500 最大支持 OpenGL
  • 如何让python窗口以“Always On Top”的方式运行?

    我正在 python 中运行一个小程序 它启动一个小窗口 该窗口需要保持在所有其他窗口之上 我相信这是操作系统特定的 在带有 GNOME 的 GNU Linux 中是如何完成的 更新 Windows 解决方案 可爱的 我想我已经成功了 我在
  • 使用 Gnome 启动器的相对路径

    我们正在开发一个需要在可移动设备 例如 USB 记忆棒 上运行的应用程序 在 Linux 上 我们使用 Gnome 启动器将应用程序的快捷方式放置在设备的根目录上 但是 我们需要对可执行文件和图标使用相对路径 因为我们事先不知道设备将安装在
  • 如何禁用 GNOME 桌面屏幕锁定? [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 如何阻止 GNOME 桌面在几分钟空闲时间后锁定屏幕 我已经尝试过官方手册了在红帽 https access redhat com doc
  • 我如何抓取标题中含有特定单词的所有窗口?

    我正在运行 gnome 并且有一个程序可以生成大量单独的进程 每个进程都有自己的 GUI 窗口 我希望能够有选择地抓取标题与特定模式匹配的打开窗口来关闭它们 有人知道一种方法可以轻松做到这一点吗 你肯定想用python wnck 对于文档

随机推荐