How to configure Virtual Network Computing (VNC) to work with Red Hat Enterprise Linux?

问题
  • How to configure Virtual Network Computing (VNC) to work with Red Hat Enterprise Linux?
环境
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 3
决议

Install the prerequisite required to enable VNC on Red Hat Enterptise Linux. As root, run the command below. This assumes that you have an active entitlement and your system is registered to Red Hat Network (RHN). Otherwise, you will have to install the RPMs from your installation media.

On Red Hat Enterprise Linux 6, ensure that system are subscribed to RHEL Server/Workstation/Client Optional channel.

yum install tigervnc-server tigervnc-server-module tigervnc

On Red Hat Enterprise Linux 5:

yum install vnc vnc-server

On Red Hat Enterprise Linux 3 and 4:

up2date vnc vnc-server

Edit the /etc/sysconfig/vncservers file to include the users will be running VNC servers. Add a line to that file as follows:

VNCSERVERS="N:user"

Where N is the number of the display VNC server will be running and user is the username by which the server will be run as. Multiple displays and users can be specified by placing a space between them, as follows:

VNCSERVERS="N:user1 Y:user2"

Note that if the X Window System is used, display 0 cannot be used for VNC as it is already being used by X.

For each user specified, a VNC password needs to be set. VNC passwords are completely separate from the normal system password for that account. A user can set their VNC password by executing the vncpasswd command as shown below

vncpasswd
Password:
Verify:

root may run vncpasswd username command to set password for username, but this may lead to mistakes. The user should run the commandvncpasswd by himself, which will create a directory ~username/.vnc owned by the username.

By default, VNC starts up only a simple window manager and a terminal window. For the full Red Hat desktop environment, refer How do I configure vncserver to start GNOME or KDE by default in Red Hat Enterprise Linux ?.

Lastly, ensure that the resulting file has the execute bit set:

chmod 755 ~username/.vnc/xstartup

In order to start the vncserver service immediately, run the following command:

service vncserver start

For example:

service vncserver start
Starting VNC server: 1:user1

In order for the vncserver service to start during the boot sequence, run the following command:

chkconfig vncserver on 

Note this command will simply return a command prompt. For example:

chkconfig vncserver on
chkconfig --list vncserver
vncserver       0:off   1:off   2:off    3:on    4:on    5:on    6:off

Now that VNC is running, vncviewer command can be used to connect from a remote Linux machine to the proper VNC-based X session. If the remote system is running Windows, a Windows-based VNC viewer program can be freely downloaded from the websitehttp://www.tigervnc.org/.

vncviewer vncserver-address:N

replace N with the number of the VNC-based X session where the application is running.

Comment

  • These VNC-based X sessions must be left running when users are finished with them. They can do this by simply closing the vncviewer program instead of logging out. This maintains the state of the desktop so that when they reconnect, all their programs will be in the same state in which they were left.

  • If a user accidentally logs out from within a VNC-based X session they should follow these steps to get X working again:

    1. Log in to the server as the user for whom VNC needs to be restarted.
    2. Issue the command vncserver -kill :N
    3. Run vncserver :N
  • For further information on VNC, refer What are different ways to setup VNC on Red Hat Enterprise Linux ?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值