操作系统: Ubuntu18.04 xfce4桌面系统
硬件平台:imx8m

安装xrdp

# sudo apt-get install xrdp

配置xfce4

# echo "xfce4-session">~/.xsession

修改/etc/xrdp/startwm.sh文件,在./etc/X11/Xsession前一行插入

xfce4-session

重启xrdp

# sudo service xrdp restart

安装vnc4server

# apt-get install vnc4server

设置vncserver的密码

# vncpasswd

启动vnc4server

# vnc4server

如果启动失败,日志提示:

mesg: ttyname 失败: 对设备不适当的 ioctl 操作

root用户修改/root/.profile文件,将/root/.profile文件中的mesg n替换成:

tty -s && mesg n

以下错误不用理会:不影响使用

error opening security policy file /etc/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!

安装tightvncserver软件:

apt-get install tightvncserver

设置密码: 可设置无操作权限的密码

# vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:

启动服务:

# vncserver

New 'X' desktop is vnvn:1

Starting applications specified in /etc/X11/Xvnc-session
Log file is /root/.vnc/vnvn:1.log

关闭服务:

# vncserver -kill :1