zoukankan      html  css  js  c++  java
  • Ubuntu 12.04 Unity桌面环境vnc配置手记[zz]

    注意,本说明只适用于ubuntu 12.04 unity 桌面版本,其他版本请酌情参考即可 

    安装vnc:
    sudo apt-get install vnc4server

    运行服务端:
    安装好后直接运行 vncserver 即可,更多参数可以参考man vncserver。首次运行要求设置密码,生成配置文件在~/.vnc目录下,无限root权限运行。

    在另外一台电脑通过远程vnc可以链接到桌面:
    例如:vncviewer 1.2.3.4:1 连接到远端桌面

    配置问题:
    默认配置文件~/.vnc/xstartup如下:

    #!/bin/sh

    # Uncomment the following two lines for normal desktop:
    # unset SESSION_MANAGER
    # exec /etc/X11/xinit/xinitrc

    [ -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 &

    采用默认配置可能存在的问题: 
    1. 采用默认配置,你登陆到vnc桌面后,只能看到桌面背景和一个终端,其他什么也没有,如下图。

    2. 登陆时出现 Counld not acquire name on session bus 等错误提示,如下图。


    以下是我的正确配置,解决上述问题,附带说明:
     修改后的~/.vnc/xstartup

    #!/bin/sh

    # Uncomment the following two lines for normal desktop:
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    # exec /etc/X11/xinit/xinitrc

    [ -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 &

    export DESKTOP_SESSION=ubuntu-2d #这个 ubuntu-2d 参考 /usr/share/gnome-session/sessions/ 下的文件名设置成不同的值
    export GDMSESSION=ubuntu-2d
    export STARTUP="/usr/bin/gnome-session --session=ubuntu-2d"

    $STARTUP

    最后的效果如下:

    对于其他ubuntu版本下的vnc的配置,基本是采用默认配置即可。

  • 相关阅读:
    Sprinig.net 双向绑定 Bidirectional data binding and data model management 和 UpdatePanel
    Memcached是什么
    Spring.net 网络示例 codeproject
    jquery.modalbox.show 插件
    UVA 639 Don't Get Rooked
    UVA 539 The Settlers of Catan
    UVA 301 Transportation
    UVA 331 Mapping the Swaps
    UVA 216 Getting in Line
    UVA 10344 23 out of 5
  • 原文地址:https://www.cnblogs.com/linucos/p/2954240.html
Copyright © 2011-2022 走看看