Vino& VNC server auto start after Ubuntu boot up

来源:互联网 发布:同望预算软件 编辑:程序博客网 时间:2024/05/17 06:51

remote login problem

there are two kinds of remote desktop connection server on Ubuntu:Vino and VNC.(in fact other Linux based systems like Fedora also supported).

while a most common problem encountered is that after the remote side rebooted, the VNC become not available.

that's caused by the service would only be started after system session started. before that no service is alive at all.

some people workaround by disable all password verify while that's not  safe for security concern.

solution thought

in fact the key point is to make the target server run after system is started, whenever an normal user session started. 

Vino

for the default service Ubnutu provided, here is one way found:

1. Edit /etc/gdm/Init/Default – this gets run when gdm starts (at Login Screen)vi /etc/gdm/Init/Default2. 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,3. Edit /etc/gdm/gdm.conf with your favorite text editorvi /etc/gdm/gdm.conf4. 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 loginKillInitClients=false
some advise that above "KillInitClients" flag is better to set as default value and add one root preference by "sudo vino-preferences" to avoid stuck problem as there is user switch during UI starting(initialized by root and switch to normal user after login).


VNC

its name is vnc4server while previous named as vino-server.

1.first install the server:sudo apt-get install vnc4server
2.then close original vino service:just open remote desktop sharing and uncheck the first checkbox "Sharing"-->"Alloow other users to view your desktop"
3.config an login passwrod by typing:vncpasswordno "sudo" is needed
4.start vnc service:vncserver -geometry 1920×1280 -alwaysshared :1-geometry indicates the screen definations, here is 1920*1280, the "*" is "x" but not the operator multiple-alwaysshared allows more than one user to login to one desktop:1 is just the id you named for this remote desktop, you can use <ip>:1 to connect to this desktopafter the service started, an ".vnc" folder would be generated under current user directory:/home/<bob>/.vnc/modify xstartup file under this folder:mark the line "twm &" with "#",and add gnome-session &save and exit.5. try to connect to the VNC server by VNCViewer or others

reference

http://blog.sina.com.cn/s/blog_86d540e401016hhv.html



0 0
原创粉丝点击