VNC Server in Virtual Mode does not start correctly on Ubuntu 12.04

针对Ubuntu 12.04环境下使用默认设置安装VNC Server后,在虚拟模式下无法正确启动桌面的问题,提供了解决方案。通过创建并配置特定的xstartup文件,可以解决桌面组件无法正常显示的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://kb.realvnc.com/questions/196/VNC+Server+in+Virtual+Mode+does+not+start+correctly+on+Ubuntu+12.04


Using the default settings on a 4.6.3 install on Ubuntu 12.04, the desktop is not started properly when VNC Server in Virtual Mode  is launched.  A user connecting to VNC Server in Virtual Mode will see a backdrop and the VNC Server status window (without a title), but will not see any other desktop features such as toolbars or launcher.

The xstartup file should be created/modified as per below:

--------------------------------------------------

#!/bin/sh

# VNC Server (Virtual-Mode) start-up script compatible with Ubuntu 12.04

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey

vncconfig -iconic &

if [ -f /usr/bin/gnome-session ]; then
  # Some gnome session types won't work with Xvnc, try to pick a sensible
  # default.
  for SESSION in "ubuntu-2d" "2d-gnome"; do
    if [ -f /usr/share/gnome-session/sessions/$SESSION.session ]; then
      DESKTOP_SESSION=$SESSION; export DESKTOP_SESSION
      GDMSESSION=$SESSION; export GDMSESSION
      STARTUP="/usr/bin/gnome-session --session=$SESSION"; export STARTUP
    fi
  done
fi

if   [ -x /etc/X11/Xsession ]; then /etc/X11/Xsession
elif [ -x /etc/X11/xdm/Xsession ]; then /etc/X11/xdm/Xsession
elif [ -x /etc/X11/xinit/Xsession ]; then /etc/X11/xinit/Xsession
elif [ -x /etc/gdm/Xsession ]; then /etc/gdm/Xsession gnome-session
elif [ -x /etc/kde/kdm/Xsession ]; then /etc/kde/kdm/Xsession
elif [ -x /usr/dt/bin/Xsession ]; then
  XSTATION=1 DTXSERVERLOCATION=local /usr/dt/bin/Xsession
elif [ -x /usr/dt/bin/dtsession ]; then /usr/dt/bin/dtsession
else
  if which twm > /dev/null 2>&1; then
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    twm
  else
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop"
  fi
fi

vncserver -kill $DISPLAY

--------------------------------------------------

Creating this file in ~/.vnc/xstartup and making the file executable should resolve the issue by launching a Unity session for VNC Server in Virtual Mode.  Alternatively, it can be copied to /etc/vnc/xstartup.custom and made executable to make it a system-wide default.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值