vps安装xfce4桌面及优化

突然发现,自己还有一台百度云的bcc已经闲置将近小半年了,做内网穿透,只是偶尔用用,实在是太浪费了,那就拿来安装个桌面。

系统:Ubuntu18.04,1核1g运存,40g内存。

1、创建swap分区,https://bbs.zsxwz.com/thread-2421.htm

1g实在是太小了,虽然xfce4基本不占什么内存,但还是建了一个2g的swap,如果2g不够,在添加也可以,swap空间可以叠加。

2、安装桌面:

apt install xfce4-goodies xfce4 -y

可以不安装sddm等登录管理。

3、安装中文字体及修改中文:

apt install dialog language-pack-zh-hans ttf-wqy-zenhei fonts-powerline -y

nano /etc/default/locale 
#内容替换为
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh:en_US:en"

dpkg-reconfigure locales
#选择 zh_CN.UTF-8

fc-cache -fv

#修复wps字体缺失,如果不安装wps可以选择不安装symbol字体
wget http://16220046.d.cturls.net/down/16220046/other/wps_symbol_fonts.zip
unzip wps*.zip
mkdir -p /usr/share/fonts/wps-office/
mv *.ttf /usr/share/fonts/wps-office/
mv *.TTF /usr/share/fonts/wps-office/
mkfontscale
mkfontdir
fc-cache

4、更新内核:

#安装5.4内核,当然也可以选择其他版本的
apt install linux-modules-5.4.0-37-generic linux-headers-5.4.0-37-generic linux-image-5.4.0-37-generic -y

#更新一下grub
sudo update-grub

5、安装vnc远程,推荐使用vnc4server,其他vnc也可以试一试都差不多。

#安装
apt install vnc4server -y

#运行,第一次运行需要设置密码。
vncserver

nano /root/.vnc/xstartup
# 添加以下内容:
startxfce4 &

# 设置开机自启动:
nano /etc/systemd/system/vncserver.service

# 添加以下内容
Description=vncserver
After=network.target
[Service]
Type=forking
User=root
PIDFile=/root/.vnc/bdy:1.pid
#在/root/.vnc文件夹会生成一个.pid文件,根据自己的情况修改一下
ExecStartPre=-/usr/bin/vncserver -kill :1 > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -geometry 1280x860 :1
#设置分辨率为1280x860同样根据自己的需求更改
ExecStop=/usr/bin/vncserver -kill :1
[Install]
WantedBy=multi-user.target

#开机自启:
systemctl enable vncserver.service

vnc有安装,iOS,Windows,Mac和Linux客户端,连接服务器,端口为5901。

6、文件共享,简单的可以搭建ftp

apt isntall vsftpd

也可以用chfs,也是很简单很方便,不用客户端,浏览器即可共享文件:

https://zsxwz.com/2020/03/05/

7、安装一些常用软件,wps可以到官网下载deb包:https://linux.wps.cn/

qq也一样:https://im.qq.com/linuxqq/index.html

百度网盘:https://pan.baidu.com/download/

即使用百度云百度网盘也不能加速。。。

wget -O bdpc.deb http://wppkg.baidupcs.com/issue/netdisk/LinuxGuanjia/3.0.1/baidunetdisk_linux_3.0.1.2.deb
dpkg -i bdpc.deb

wget -O wps.deb https://wdl1.cache.wps.cn/wps/download/ep/Linux2019/9522/wps-office_11.1.0.9522_amd64.deb
dpkg -i wps.deb

wget -O qq.deb http://down.qq.com/qqweb/LinuxQQ_1/linuxqq_2.0.0-b2-1082_amd64.deb
dpkg -i qq.deb

rm -rf bdpc.deb wps.deb qq.deb

8、简单的美化一下,图标主题下载:https://www.xfce-look.org/

图标放在:/usr/share/icons

壁纸放在:/usr/share/backgrounds/xfce/

#papirus这个图标还行
wget -O papirus-icon-theme.tar.xz http://16220046.d.cturls.net/down/16220046/other/papirus-icon-theme.tar.xz
xz -d papirus-icon-theme.tar.xz
tar xvf papirus-icon-theme.tar
cp -r ePapirus /usr/share/icons
cp -r Papirus-Light /usr/share/icons
cp -r Papirus-Dark /usr/share/icons
cp -r Papirus /usr/share/icons

#一张滑稽壁纸
wget http://16220046.d.cturls.net/down/16220046/other/bz.jpg
cp -r bz.jpg /usr/share/backgrounds/xfce/

留言

* - 必填