Chinaunix首页 | 论坛 | 博客
  • 博客访问: 350451
  • 博文数量: 93
  • 博客积分: 4578
  • 博客等级: 上校
  • 技术积分: 1005
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-13 08:12
文章分类
文章存档

2012年(2)

2011年(45)

2010年(46)

分类: LINUX

2010-11-04 14:49:34

Open up your terminal and install tigervnc via yum.
Type this command in your terminal:

yum -y install tigervnc tigervnc-server

Edit the VNC configuration file

vi /etc/sysconfig/vncservers

and append these lines:

VNCSERVERS="1:user"
VNCSERVERARGS[1]="-geometry 800x600 -depth 16"

Where VNCSERVERS= is for configuring the username.
The "1:user" tells the vnc server that the username user is map to display 1, so the port number to access this user via vnc is 5901.

Note: "By default, VNC uses ports numbered 5900 plus the display number. In
this example, the display is 1, so the port number is 5901.

Please make sure the username to match your linux login name.

The VNCSERVERARGS[1]= refers to the argument for "1:user". The -geometry sets the size of the VNC desktop while -depth sets the pixel depth.

If you want to allow more than one users to access VNC, your config should be like this:

VNCSERVERS="1:user 2:user2"
VNCSERVERARGS[1]="-geometry 800x600 -depth 16"
VNCSERVERARGS[2]="-geometry 800x600 -depth 16"

but we will stick to our example which is using one user only.

Create password for your VNC user by typing this command:

su user -c vncpasswd user

Then edit the vnc startup scrtipt in .vnc folder inside your users home directory.

vi .vnc/xstartup

This line should be commented because it will break your desktop, trust me.

#twm &

And append this line instead:

metacity &

Now start your vnc server and configure it to run automatically at system boot.

service vncserver start
chkconfig vncserver on

Last but not the least, allow the vnc packet through your firewall.

iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
service iptables save

To access your server from your other Fedora system using vnc, use this command:

vncviewer ip_address:5901
阅读(428) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~