Answers:
我通常建议使用备用VNC服务器,x11vncserver或FreeNX。
这假定VNC已设置且可运行:
将下面的代码块复制到中/etc/init.d/vncserver
。做到这一点最简单的方法是将它复制到剪贴板,运行sudo -i && cat > /etc/init.d/vncserver && exit
在终端,将其粘贴,和类型Ctrl- D`。确保将USER变量更改为希望VNC服务器在其下运行的任何用户。
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: networking
# Default-Start: 3 4 5
# Default-Stop: 0 6
### END INIT INFO
PATH="$PATH:/usr/X11R6/bin/"
# The Username:Group that will run VNC
export USER="mythtv"
#${RUNAS}
# The display that VNC will use
DISPLAY="1"
# Color depth (between 8 and 32)
DEPTH="16"
# The Desktop geometry to use.
#GEOMETRY="<WIDTH>x<HEIGHT>"
#GEOMETRY="800x600"
GEOMETRY="1024x768"
#GEOMETRY="1280x1024"
# The name that the VNC Desktop will have.
NAME="my-vnc-server"
OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
. /lib/lsb/init-functions
case "$1" in
start)
log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
;;
stop)
log_action_begin_msg "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}"
su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
使脚本可执行sudo chmod +x /etc/init.d/vncserver
。
然后,运行sudo update-rc.d vncserver defaults
。这会将适当的符号链接添加到vncserver脚本,以便在适当的时间向其发送启动和停止命令。
注意:sudo update-rc.d vncserver 99
如果作业在引导过程中运行得太早,则可能需要使用它。
要启动服务器而不重新引导,请运行 sudo /etc/init.d/vncserver start
最后,使用端口590X上的VNC客户端连接到服务器,其中X是vncserver脚本中“ DISPLAY”的值
尝试时会发生什么:(?)
vino-preferences
..并将其添加到Autostarted Apps中,以启动vino服务器:
/usr/lib/vino/vino-server
更新:
尝试这个:
在启动时在Ubuntu上启动VNC服务器
http://www.abdevelopment.ca/blog/start-vnc-server-ubuntu-boot
sudo update-rc.d vncserver defaults 99
我认为延迟序列启动命令应该是。