配置ubuntu
执行以下命令
sudo apt update
sudo apt install xrdp
sudo apt install -y xfce4
sudo apt install -y xfce4-goodies
sudo apt-get -y install xserver-xorg-core
sudo apt-get -y install xserver-xorg-input-all
sudo apt-get -y install xorgxrdp
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini
echo xfce4-session > ~/.xsession
sudo vi /etc/xrdp/startwm.sh
将startwm.sh末尾的test和exec两行注释掉如下
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession
#exec /bin/sh /etc/X11/Xsession
增加以下行:
startxfce4
之后启动xrdp
sudo /etc/init.d/xrdp start
windows远程桌面连接
- windows打开远程桌面输入ubuntu主机ip或者主机名
- 选择xorg,输入用户名密码
- 会提示几次授权修改主机的颜色设置什么的,都可以cancel掉,然后即可登陆成功
参考
https://zhuanlan.zhihu.com/p/354125719
https://zhuanlan.zhihu.com/p/40937988
附VN
xfdp有点卡感觉,而且也不是ubuntu的界面,所以我后来改用vnc了,参考教程:https://blog.csdn.net/qq_43385853/article/details/115602747?spm=1001.2014.3001.5501