linux下源码安装VNC
源码安装如下:
首先远程到服务器.
1.从网上下载:VNC软件包
[root@www root]#wget http://www.realvnc.com/dist/vnc-4.0-x86_linux.tar.gz
--14:00:42-- http://www.realvnc.com/dist/vnc-4.0-x86_linux.tar.gz
=> `vnc-4.0-x86_linux.tar.gz'
Resolving www.realvnc.com... done.
Connecting to www.realvnc.com[146.101.152.142]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,625,390 [application/x-gzip]
100%[====================================>] 1,625,390 104.15K/s ETA 00:00
14:01:00 (104.15 KB/s) - `vnc-4.0-x86_linux.tar.gz' saved [1625390/1625390]
2.发现4.0版本安装起来更加方便,解压后按照README文档操作即可:
[root@www root]# ls
anaconda-ks.cfg install.log install.log.syslog vnc-4.0-x86_linux.tar.gz
[root@www root]# tar -zxvf vnc-4.0-x86_linux.tar.gz
vnc-4.0-x86_linux/
vnc-4.0-x86_linux/README
vnc-4.0-x86_linux/vncinstall
vnc-4.0-x86_linux/Xvnc
vnc-4.0-x86_linux/Xvnc.man
vnc-4.0-x86_linux/vncviewer
vnc-4.0-x86_linux/vncviewer.man
vnc-4.0-x86_linux/vncpasswd
vnc-4.0-x86_linux/vncpasswd.man
vnc-4.0-x86_linux/vncconfig
vnc-4.0-x86_linux/vncconfig.man
vnc-4.0-x86_linux/vncserver
vnc-4.0-x86_linux/vncserver.man
vnc-4.0-x86_linux/x0vncserver
vnc-4.0-x86_linux/x0vncserver.man
vnc-4.0-x86_linux/vnc.so
vnc-4.0-x86_linux/LICENCE.TXT
vnc-4.0-x86_linux/java/
vnc-4.0-x86_linux/java/index.vnc
vnc-4.0-x86_linux/java/logo150x150.gif
vnc-4.0-x86_linux/java/vncviewer.jar
[root@www root]# ls
anaconda-ks.cfg install.log.syslog vnc-4.0-x86_linux.tar.gz
install.log vnc-4.0-x86_linux
[root@www root]# cd vnc-4.0-x86_linux
[root@www vnc-4.0-x86_linux]# ls
java vncconfig.man vncserver vncviewer.man Xvnc.man
LICENCE.TXT vncinstall vncserver.man x0vncserver
README vncpasswd vnc.so x0vncserver.man
vncconfig vncpasswd.man vncviewer Xvnc
[root@www vnc-4.0-x86_linux]# ./vncinstall /usr/local/bin
Can't install manual pages to /usr/local/man/man1
Copying Xvnc to /usr/local/bin
Copying vncviewer to /usr/local/bin
Copying vncpasswd to /usr/local/bin
Copying vncconfig to /usr/local/bin
Copying vncserver to /usr/local/bin
Copying x0vncserver to /usr/local/bin
[root@www vnc-4.0-x86_linux]# mkdir -p /usr/local/vnc/classes
[root@www vnc-4.0-x86_linux]# cp java/* /usr/local/vnc/classes
3.此时即可启动vncserver:
第一次启动要设置密码.VNC远程密码
[root@www vnc-4.0-x86_linux]# vncserver
You will require a password to access your desktops.
Password:
Verify:
New 'www.janny.com:1 (root)' desktop is www.janny.com:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/www.janny.com:1.log
上面这段话表示起动了一个图形终端,编号为1,要记住这个编号,等下登录时需要提供这个编号。
如果你要停止这个进程,使用
代码::
$vncserver -kill :1
4.如果上面的没有成功,发出现以下提示:缺少libstdc++库文件.
You will require a password to access your desktops.
vncpasswd: error while loading shared libraries: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory
5.请到这里下载
http://rpm.pbone.net/index.php3/stat/4/idpl/843376/com/compat-libstdc++-7.3-2.96.118.i386.rpm.html
rpm -ivh compat-libstdc++-7.3-2.96.118.i386.rpm
6.如果存在防火墙,还需要开放防火墙,然后就可以通过浏览器在5801端口访问vncserver了.
可以通过如下命令确认端口已经正常启动:
[root@www vnc-4.0-x86_linux]# netstat -an|grep 01
tcp 0 0 0.0.0.0:5801 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 4904 /tmp/orbit-root/linc-5ee-0-121b01141620a
unix 2 [ ACC ] STREAM LISTENING 4964 /tmp/orbit-root/linc-5ec-0-121b011493273
unix 2 [ ACC ] STREAM LISTENING 4994 /tmp/orbit-root/linc-5f1-0-121b0114bb267
unix 2 [ ACC ] STREAM LISTENING 3010 /tmp/orbit-root/linc-527-0-7af285a063ec3
unix 3 [ ] STREAM CONNECTED 5036 /tmp/orbit-root/linc-5ec-0-121b011493273
unix 3 [ ] STREAM CONNECTED 5013 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 5012
unix 3 [ ] STREAM CONNECTED 4997 /tmp/orbit-root/linc-5f1-0-121b0114bb267
unix 3 [ ] STREAM CONNECTED 4967 /tmp/orbit-root/linc-5ec-0-121b011493273
unix 3 [ ] STREAM CONNECTED 4907 /tmp/orbit-root/linc-5ee-0-121b01141620a
7.PS:
在/root/.vnc/xstartup
把twm & 改为gnome-session& or kde&
保存修改配置后.重启服务器.(之后多出现了xwindows)
8.再运行开启vncserver命令.开启一次图形终端,编号为1,
如果要开启两个图形终端就运行两次vncserver命令.但第二个图形终端在远程的时候.要以:XXX.XXX.XXX.XXX:2 这样的格式.表示远程图形终端2
9.客户端远程的时候.一般是用WIndows 系统.在客户端安装
10.*** 开机自动启用 VNC Server 的方法:
执行ntsysv , 把 vncserver 设为启用
作者“LaoKa”