Ubuntu VNC 远程桌面及常见问题

一、Ubuntu 远程桌面开启

  1. 在ubuntu 设置中打开远程桌面

**注意:如果没有共享桌面选项也不要谎,只需要安装 vino 即可


sudo apt update

sudo apt install vino

gsettings set org.gnome.Vino require-encryption false

  1. 设置远程登录密码

到此Ubuntu系统的远程桌面就开启了,现在就可以进行远程连接了

二、VNC连接工具

网上有很多远程桌面的VNC工具,其他的我没用过,这里我推荐两种方式

  1. 使用工具MobaXterm工具进行连接,如下图所示:

  2. 使用windows自带的远程工具,如下图所示:

三、Ubuntu系统重启后,远程密码会改变

  1. 安装dconf-editor工具
    sudo apt install dconf-editor -y 
    
    安装完成后打开dconf-editor工具, 打开命令为 dconf-editor ,找到org->gnome->desktop->remote-access 选项
    关闭require-encryption选项即可。
    或者使用指令关闭
    dconf write /org/gnome/desktop/remote-access/require-encryption false
    

四、重启Ubuntu系统后存在秘钥环认证

使用命令打开操作面板

seahorse

如下图所示:

将密码更改为空即可

五、Ubuntu不连接显示器时,无法进行远程控制

解决办法,只需要安装虚拟显示器即可

  1. Ubuntu 虚拟显示器的安装:

    sudo apt-get install  xserver-xorg-core-hwe-18.04
    sudo apt-get install  xserver-xorg-video-dummy
    
  2. 添加配置文件
    在 /usr/share/X11/xorg.conf.d/ 中添加 xorg.conf 文件。

    
    Section "Device"
        Identifier  "Configured Video Device"
        Driver      "dummy"
    EndSection
    
    Section "Monitor"
        Identifier  "Configured Monitor"
        HorizSync 31.5-48.5
        VertRefresh 50-70
    EndSection
    
    Section "Screen"
        Identifier  "Default Screen"
        Monitor     "Configured Monitor"
        Device      "Configured Video Device"
        DefaultDepth 24
        SubSection "Display"
        Depth 24
        Modes "1920x1080"
        EndSubSection
    EndSection
    ~
    
    

安装完成后,重启即可生效

注意:

  • 启动虚拟显示器后,默认使用的是虚拟显示器,所以原主机的显示器就不能显示了。
  • 如果需要再用显示器,需要删除或者重命名“xorg.conf”文件
  • 一定要将电源设置改为永不息屏,不然息屏后,就不能在连接了,最终只能重启才能进入
posted @ 2022-08-25 16:51  浇筑菜鸟  阅读(2768)  评论(0编辑  收藏  举报