转贴:
http://jakeyoon.com/2008/11/19/enable-vino-vnc-server-for-login-manager-gdm-in-ubuntu/
ubuntu 8.04 comes with vnc remote desktop, but user has to login then the vnc service starts. if anyone remotely reboots then remote desktop doesn’t work anymore. Here is the way to use remote desktop (ubuntu 8 built in vnc) without user login.
不需要用户登录就可以使用ubuntu8自带的远程桌面程序vnc,避免了每次远程重启机子后远程桌面程序vnc无法使用的情况。
====================================================
I have been a big fan for Remote Desktop in Windows XP/Server/Vista platform because you get a native display resolution of your client monitor and file/printer share is supported; however, for Windows 2000 or linux distributions, I do not have the option. There is an alternate option for Windows 2000 or linux distribution which is VNC.
For Windows platform, it looks like RealVNC and UltraVNC are the most popular ones while linux has many different VNC servers.
In this example, I would like to introduce a way to enable a built-in Vino VNC server for Ubuntu distribution.
1. After logging into Ubuntu, open up Remote Desktop option (System -> Preferences -> Remote Desktop)
2. Check “Allow other users to view your desktop” and “Allow other users to control your desktop” - this is to let others, others would be me in my case, take control of this machine
3. Uncheck “Ask you for confirmation” - when VNC is connected, VNC server will ask for a confirmation to local user. In my case, this machine will not have a local logged user since it does not have a monitor
4. If possible, assign a password - Having a password should be better than not having one even though VNC still lacks encryption and strong authentication
At this point, VNC server is just enabled with some settings; however, Vino server does not start until a user logs in. This means that Vino server is not running at User Login screen - where a user types username and password. In my case, this was not feasible since the machine will not have a monitor (nor keyboard/mouse).
5. Edit /etc/gdm/Init/Default - this gets run when gdm starts (at Login Screen)
emacs /etc/gdm/Init/Default
6. Add the following line right before exit 0 at the end of the file - Vino server runs when gdm starts up
/usr/lib/vino/vino-server &
Vino server starts up when gdm starts up; however, when username and password is typed in, gdm kill this vino-server meaning VNC connection will be terminated. To prevent this,
7. Edit /etc/gdm/gdm.conf with your favorite text editor
emacs /etc/gdm/gdm.conf
8. Find a commented option KillInitClients=true. Uncomment it and change it to false and save it. - this prevents vino-server from being killed right after login
KillInitClients=false
Now, you should be able to connect to the machine using VNC