配置Ubuntu 16.04 LTS和Ubuntu 18.04 LTS的远程桌面

配置Ubuntu16.04 LTS的远程桌面很简单:

1.在Dash里输入Desktop找到Desktop sharing点击打开,勾选允许控制桌面,安全方面根据情况选择,一般选要求远程用户输入密码,关于通知显示则可选择never。注意不要选择 '必须为对本机器的每次访问进行确认',否则每次远程登录都需要在被登录的server端的桌面上进行确认允许访问(server端如果不做确认,会导致VNC viewer登录后看到的桌面全是黑的没显示,之后再也登录不进去了),这样就失去了远程访问控制server的便利!!!

2.安装和设置dconf:

      sudo apt-get install dconf-editor

 然后再Dash里输入dconf,找到deconf-editor点击打开窗口, 依次点击org--gnome--desktop--remote-access,在remote-access页把里面的require-encryption取消勾选了,如果authentication-methods的值是'none',则改为'vnc'。以上选项还可以通过修改 /usr/share/glib-2.0/schemas/org.gnome.Vino.gschema.xml这个文件里的相应xml element的值来完成。

3.安装并启动xrdp:

     sudo  apt-get  install   xrdp
     sudo service xrdp restart

对于Ubuntu16.04 LTS的远程桌面,配置和安装就完成了,可以使用VNC Viewer远程连接了。

对于Ubuntu18.04 LTS,搞不懂Ubuntu的开发者怎么想的,不知道是不是哪里神经短路了,相对于Ubuntu16.04 LTS,改动了一些地方又不负责任地改好,所以存在问题:Desktop sharing打不开,点击后就崩溃;vino-server不会随机启动而起来,就算你完成了上面的安装和配置。

解决上面Ubuntu18.04 LTS的问题需要对比Ubuntu16.04 LTS做以下处理:

1. sudo vi /usr/share/glib-2.0/schemas/org.gnome.Vino.gschema.xml

   重新加入被删掉的key element:

    <key name='enabled' type='b'>
      <summary>Enable remote access to the desktop</summary>
      <description>
        If true, allows remote access to the desktop via the RFB
        protocol. Users on remote machines may then connect to the
        desktop using a VNC viewer.
      </description>
      <default>false</default>
    </key>
2. sudo glib-compile-schemas /usr/share/glib-2.0/schemas

3. 创建一个桌面应用开机启动文件让系统启动时把/usr/lib/vino/vino-server启动起来:
     ~/.config/autostart/vino-server.desktop

文件内容如下:

    [Desktop Entry]
    Type=Application
    Name=Vino VNC server
    Exec=/usr/lib/vino/vino-server
    NoDisplay=true

做了上述处理,然后再做上面描述的针对Ubuntu16.04 LTS的远程桌面的配置和安装,然后reboot,系统起来后就可以使用VNC Viewer或其他远程桌面工具连接了。

发布了61 篇原创文章 · 获赞 90 · 访问量 11万+

猜你喜欢

转载自blog.csdn.net/XCCCCZ/article/details/102538061