Chinaunix首页 | 论坛 | 博客
  • 博客访问: 97944
  • 博文数量: 21
  • 博客积分: 451
  • 博客等级: 一等列兵
  • 技术积分: 215
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-03 20:46
个人简介

记录技术旅程

文章分类

全部博文(21)

文章存档

2014年(3)

2011年(18)

我的朋友

分类: LINUX

2011-04-02 16:22:04

1. Install the vnc server in ubuntu.
$sudo apt-get install vnc4server

2. create a password for current account by below command.
$vncpasswd

3. Start the vnc4server, then the .vnc/xstartup file will be created.
$vncserver

4. Open the .vnc/xstartup file and edit it as the following.
$vi ~/.vnc/xstartup
  1. #!/bin/sh

  2. # Uncomment the following two lines for normal desktop:
  3. unset SESSION_MANAGER
  4. exec /etc/X11/xinit/xinitrc

  5. [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
  6. [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
  7. #xsetroot -solid grey
  8. #vncconfig -iconic &
  9. #x-terminal-emulator -geometry 80x24+10+10 -ls -title
  10. "$VNCDESKTOP Desktop" &
  11. x-window-manager &
Uncomment the lines that start with unset and exec. Comment out the lines that start with xsetroot, vncconfig, xterm and .

5. Change the permissions on the /etc/X11/xinit/xinitrc file to make it executable.
$sudo chmod 755 /etc/X11/xinit/xinitrc

6. Stop the vnc4server.
$vncserver -kill :1
Please pay attention to the number after the colon. When the vncserver started, a number will be allocated.
So when stop the vncserver must match with the allocated number.

7. Restart the vncserver as the following.
$vncserver -geometry 1280x800 -alwaysshared :1
You can set the resolution for your screen and allocate a number for account.

8. Connect the VNC server from remote computer.
vncviewer xxx.xxx.xxx.xxx:1.



 



阅读(1909) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~