vnc 连接 VNC 服务器 in linux

本文为初学者提供了一步一步的Linux教程,讲解如何在Red Hat Enterprise Linux上安装和配置VNC服务器。安装VNC服务器后,需要为每个允许远程访问的Linux登录账户创建VNC登录密码。启动VNC服务器时,它会在不同的TCP/IP端口上运行,可以通过HTTP或RFB协议连接。使用VNC客户端,可以通过修改$HOME/.vnc/xstartup文件来运行KDE或Gnome桌面管理器。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

For the newbie (as myself), here is my another 3-minute Linux guide about How to setup VNC server in Red Hat Enterprise Linux ?

Though this Linux-VNC guide is tested on Redhat Enterprise Linux 4, it served the general guide of installing VNC in Linux distributions.

  1. Locate the vnc-server-4.0-8.1.rpm package from the Red Hat Linux installation CD or download the latest free version of VNC server from Real VNC .  
  2. Install the rpm package of VNC server:
    rpm -Uvh vnc-server-4.0-8.1.rpm  
  3. VNC server is using different set of login authentication than the Linux /etc/passwd. Meaning that, you have to create VNC login password for individual Linux login accounts who are granted remote access with VNC client.
    To create VNC login password, just execute vncpasswd command and enter a valid password twice as usual.  
  4. Unlike VNC server for Windows , each user account can run more than one VNC servers in Linux.
    To start an instance of VNC server, just execute vncserver command, which will create the $HOME/.vnc directory with VNC default startup scripts inside (if $HOME/.vnc is not currently exists).  
  5. The vncserver command will startup a VNC server that open 3 next available TCP/IP port, starting from 5801, 5901, and 6001 respectively.
    Port 5801 is for VNC client connection over HTTP protocol, port 5901 is for VNC client connection over RFB protocol, and port 6001 is to allows X applications to connect to the VNC server. The lsof or netstat command will able to show the network port opened by Xvnc server.

    By executing vncserver for the second time or execute the vncserver :2 command, this will startup VNC server that bind and listen to port 5802, 5902, and 6002 respectively.

    To connect to Linux VNC server over HTTP protocol, just type walkernews.net:5801 (replace walkernews.net with your VNC server IP/hostname) at any javascripts-enabled web browser, such as Mozilla Firefox , Opera , or Internet Explorer .

    To connect to Linux VNC server over RFB protocol, just type walkernews.net:2 at the VNC client.
  6. To kill the VNC server in Linux, just execute vncserver -kill :1 will kill the first VNC server that bind and listen to port 5801, 5901, and 6001. The vncserver -kill :2 will kill the second VNC server, and so on.

By these step , you could could conncet to VNC SERVER.

 

 

 

============================================================

 

 

Attach:

 

How to get KDE or Gnome Desktop Manager running in Linux VNC server?

Don’t worry, it’s just a 3-seconds Linux trick ! Edit the default VNC server startup scripts $HOME/.vnc/xstartup and un-remark the two “critical” lines, as per the scripts suggestion:

#!/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" &
twm &


Isn’t easy to setup and configure Real VNC in Linux, particularly with Red Hat Linux?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值