Debian 10 安装远程桌面环境

环境准备

我们这里假设用户为 test

安装软件

需要安装一个桌面环境,这里选择的是xfce,另外安装了vncserver和xrdp。xrdp是用来使用windows的远程桌面工具直接linux环境

apt update
apt install xfce4 xfce4-goodies tightvncserver xrdp

配置

systemctl enable xrdp.service
#启动xrdp服务
systemctl start xrdp

切换到用户test: su test
执行命令: vncserver
会有提示输出:

Output
You will require a password to access your desktops.

Password:
Verify:

这里是提示设置密码,密码必须在6到8位,超过8位的自动被截断。

vncserver

vncserver -kill :1
mv ~/.vnc/xstartup ~/.vnc/xstartup.bak
nano ~/.vnc/xstartup

内容如下:

!/bin/bash

xrdb $HOME/.Xresources
startxfce4 &

sudo chmod +x ~/.vnc/xstartup
vncserver

配置自动启动

sudo nano /etc/systemd/system/[email protected]
内容如下:

[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=test
Group=test
WorkingDirectory=/home/test

PIDFile=/home/test/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280×800 :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

sudo systemctl daemon-reload

sudo systemctl enable [email protected]

安装火狐浏览器

wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/77.0.1/linux-x86_64/en-US/firefox-77.0.1.tar.bz2

tar jzvf firefox-77.0.1.tar.bz2

mv firefox /usr/local/

ln -sf /usr/local/firefox/firefox ~/Desktop/ 

Leave a Reply

Your email address will not be published. Required fields are marked *