在 armbian 上安装 xfce 和 VNC 做远程桌面

2024-02-09T13:59:05

在 armbian 上安装 xfce 和 VNC 做远程桌面

配置 xfce 和 VNC

  1. 安装xfce和vnc

    apt update
    apt install xrdp -y
    apt install dbus-x11 -y

    安装好之后reboot一下。

    apt install xfce4 xfce4-goodies -y
    apt install tigervnc-standalone-server -y
    sudo apt-get install tigervnc-common -y
  2. 初始化VNC:

    vncserver

    输入两次密码然后会询问你是否创建仅观看(View-only)的密码,输入仅观看密码登录到VNC的用户只能观看远程桌面不能进行控制,可以创建也可以直接输入“n”跳过。

    设置好后杀掉创建出来的VNC进程:

    vncserver -kill :1
  3. 创建xstartup

    nano ~/.vnc/xstartup

    键入如下内容:

    #!/bin/bash
    xrdb $HOME/.Xresources
    startxfce4

    给这个文件加运行权限:

    chmod +x ~/.vnc/xstartup
  4. 测试是否可用:

    vncserver -localhost no

    -localhost no ,为可远程连接,此时可以在另一台设备上用vnc连一下试试。

    windows vnc下载:https://www.realvnc.com/en/connect/download/viewer/

    vnc上输入ip:5901

    端口号回显的日志文件名决定,如果为“xxx:1.log”,则输入5901。

    如果回显的日志文件为“xxx:2.log”,则需要放行5902端口;如果为“xxx:3.log”,则需要放行5903端口,以此类推。

    测试好了直接kill掉就行:

    vncserver -kill :1

中文显示为▯的问题

安装字体:

apt install fonts-wqy-zenhei -y

然后kill掉所有xfce进程和vnc进程再重新开。

安装火狐浏览器

sudo apt-get install firefox-esr -y

设置VNC开机启动

修改启动脚本

vim /etc/rc.local

添加以下内容

su - root -c "/usr/bin/vncserver -depth 24 -geometry 1920x1080 :1 &"
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »