Vino& VNC server auto start after Ubuntu boot up

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/Default

2. 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 editor

vi /etc/gdm/gdm.conf

4. 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
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:
vncpassword
no "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 desktop
after 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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值