本文共 4956 字,大约阅读时间需要 16 分钟。
This article is a HOWTO for running VNCserver on Linux. These examples are specific to , but should work on any type of Linux system.
[root@roswell etc]# service vncserver startStarting VNC server: [ OK ][root@roswell etc]# [root@roswell etc]# vncpasswdPassword: Verify: [root@roswell etc]#[root@roswell etc]# vncserverNew 'roswell:1 (root)' desktop is roswell:1Starting applications specified in /root/.vnc/xstartupLog 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.
[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]# lspasswd roswell:1.pid roswell:2.pid roswell:3.pid roswell:4.pid roswell:5.pid roswell.area51.lan:1.pidroswell:1.log roswell:2.log roswell:3.log roswell:4.log roswell:5.log roswell.area51.lan:1.log roswell.area51.lan:2.logxstartup[root@roswell .vnc]# vi xstartupUsing 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/.Xresourcesxsetroot -solid greyvncconfig -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 .
转载地址:http://btxli.baihongyu.com/