带有 vnc 服务器的空白屏幕

Ala*_*lan 6 vnc 12.04

在 10.04 LTS 上,我能够在显示器 :1 上运行 vnc4server 并获得一个新桌面。这很棒,因为我可以在家工作而没有人看到我屏幕上的内容(:0 处于“锁定屏幕”状态)。

在 12.04 LTS 上复制此内容时,我只是得到一个空白桌面,但无法找出有什么区别?

有没有其他人遇到过这种情况,或者有没有其他人安装过 VNC 设置,您可以在其中连接到显示 :0 以外的屏幕?

谢谢

Jus*_*tin 10

有同样的问题。网上没找到解决办法。这对我有用。(假设您已经安装了 Gnome)

我的 xstartup 文件:

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
gnome-session –session=gnome-classic &
gnome-panel&

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
Run Code Online (Sandbox Code Playgroud)

我补充说:

gnome-session –session=gnome-classic &   
gnome-panel&    
Run Code Online (Sandbox Code Playgroud)

并取消注释:

unset SESSION_MANAGER   
Run Code Online (Sandbox Code Playgroud)

还修改了 $defaultXStartup 部分,/usr/bin/vncserver以便默认 xstartup 与上述相同:

$defaultXStartup
    = ("#!/bin/sh\n\n".
       "# Uncomment the following two lines for normal desktop:\n".
       "unset SESSION_MANAGER\n".
       "# exec /etc/X11/xinit/xinitrc\n".
       "gnome-session –session=gnome-classic &\n".
       "gnome-panel&\n\n".
       "[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup\n".
       "[ -r \$HOME/.Xresources ] && xrdb \$HOME/.Xresources\n".
       "xsetroot -solid grey\n".
       "vncconfig -iconic &\n".
       "x-terminal-emulator -geometry 80x24+10+10 -ls -title \"\$VNCDESKTOP Desktop\" &\n".
       "x-window-manager &\n");
Run Code Online (Sandbox Code Playgroud)

这对我有用!