安装 Xorg 和 lightDM
pacman -S xorg xorg-xinit xorg-server lightdm lightdm-gtk-greeter
ln -s /etc/lightdm/Xsession /etc/X11/Xsession
安装 xfce4 或 cinnamon
pacman -S xfce4 xfce4-goodies
# 或
pacman -S cinnamon
支持中文显示
首先安装中文字体:
pacman -S opendesktop-fonts wqy-microhei wqy-microhei-lite wqy-zenhei wqy-bitmapfont ttf-dejavu
不推荐全局汉化,这样可能会导致tty中无法汉化而出现乱码。最好是在用户各自的家目录下的~/.bashrc、~/.profile、~/.xinitrc或~/.xprofile中设置自己的用户环境,若文件不存在可以新建。
- .bashrc: 每次终端时读取并运用里面的设置
- .profile:每次启动系统的读取并运用里面的配置
- .xinitrc: 每次startx启动X界面时读取并运用里面的设置
- .xprofile: 每次使用lightdm等图形登录管理器时读取并运用里面的设置
从上面所说的文件中你认为合适的文件,然后将下面的命令添加到文件末尾即可。
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:en_US
使能 lightDM 登陆管理器
systemctl enable lightdm.service
systemctl start lightdm.service
安装和开启 tigervnc
# 安装
pacman -S tigervnc
编辑 /etc/tigervnc/vncserver.users 文件配置用户和 Display Number.
# /etc/tigervnc/vncserver.users
:<num>=<user name>
# 首次运行需要设置密码
vncpasswd
# 运行服务,<num> 一定要与 /etc/tigervnc/vncserver.users 文件中的配置一致
vncserver :<num>
如需指定分辨率,可通过修改 ~/.vnc/config 实现
session=<session name>
geometry=1920x1080
#localhost
#alwaysshared
<session name> 必须与 /usr/share/xsessions 下的某个文件名一致,例如文件为 cinnamon.desktop,则 session=cinnamon。
num 与 VNC 的默认监听端口有一定对应关系,一般 num=0 时 VNC 默认监听 5900,num=1 时 VNC 默认监听 5901,以此类推。
远程访问
使用 VNC Viewer 进行远程访问,该软件支持 Windows、Linux、Android、iOS 等系统。输入:
<服务器 IP>:<num>
然后键入密码即可。
通过 SSH 隧道进行连接
在服务器端:
vncserver -localhost
在客户端:
ssh <user name>@<vnc server ip> -L <local port>:localhost:<vnc port>
参考资料
Archlinux Wiki TigerVNC
Archlinux Wiki Xorg
Archlinux Wiki Xfce
Archlinux Wiki Cinnamon
server-world Desktop Environment : Install Xfce
server-world Desktop Environment : Install Cinnamon
VNC+xfce4 远程桌面及公网访问
ubuntu16.04安装VNC+xfce 的方法
「真诚赞赏,手留余香」
真诚赞赏,手留余香
使用微信扫描二维码完成支付
