2019-11-11 15:18:55 +08:00
|
|
|
|
# Manjaro 安装图形界面及开启 VNC
|
|
|
|
|
|
2019-11-12 17:28:12 +08:00
|
|
|
|
## 安装 Xorg 和 lightDM
|
2019-11-11 15:18:55 +08:00
|
|
|
|
|
|
|
|
|
```sh
|
2019-11-12 17:28:12 +08:00
|
|
|
|
pacman -S xorg xorg-xinit lightdm lightdm-gtk-greeter
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 安装 xfce4 或 cinnamon
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
pacman -S xfce4 xfce4-goodies
|
|
|
|
|
# 或
|
|
|
|
|
pacman -S cinnamon
|
2019-11-11 15:18:55 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 使能 lightDM 登陆管理器
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
systemctl enable lightdm.service
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-12 17:28:12 +08:00
|
|
|
|
## 安装和开启 tigervnc
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
pacman -S tigervnc
|
|
|
|
|
vncserver
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-13 11:59:28 +08:00
|
|
|
|
第一次使用需要按提示输入密码,开启后会提示一个 \<num\> 号,num 与 VNC 的默认监听端口有一定对应关系,一般 num=0 时 VNC 默认监听 5900,num=1 时 VNC 默认监听 5901,以此类推。如果要关闭 vnc 可使用如下命令:
|
2019-11-11 15:18:55 +08:00
|
|
|
|
|
|
|
|
|
```sh
|
2019-11-12 17:28:12 +08:00
|
|
|
|
vncserver -kill :<num>
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 配置 VNC
|
|
|
|
|
|
|
|
|
|
修改 ~/.vnc/xstartup 文件如下:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
unset SESSION_MANAGER
|
|
|
|
|
unset DBUS_SESSION_BUS_ADDRESS
|
2019-11-12 17:49:54 +08:00
|
|
|
|
# For Cinnamon
|
2019-11-12 17:28:12 +08:00
|
|
|
|
#exec dbus-launch cinnamon-session
|
2019-11-12 17:49:54 +08:00
|
|
|
|
# For Xfce
|
2019-11-12 17:28:12 +08:00
|
|
|
|
exec dbus-launch xfce4-session
|
2019-11-11 15:18:55 +08:00
|
|
|
|
```
|
2019-11-12 17:40:16 +08:00
|
|
|
|
|
|
|
|
|
## 远程访问
|
|
|
|
|
|
|
|
|
|
使用 [VNC Viewer](https://www.realvnc.com) 进行远程访问,该软件支持 Windows、Linux、Android、iOS 等系统。输入:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
<服务器 IP>:<num>
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
然后键入密码即可。
|
|
|
|
|
|
2019-11-13 11:59:28 +08:00
|
|
|
|
## 通过 SSH 隧道进行连接
|
|
|
|
|
|
|
|
|
|
在服务器端:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
vncserver -localhost
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
在客户端:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
ssh <user name>@<vnc server ip> -L <local port>:localhost:<vnc port>
|
|
|
|
|
```
|
|
|
|
|
|
2019-11-12 17:40:16 +08:00
|
|
|
|
## 参考资料
|
|
|
|
|
|
|
|
|
|
[Archlinux Wiki TigerVNC](https://wiki.archlinux.org/index.php/TigerVNC)
|
|
|
|
|
[Archlinux Wiki Xorg](https://wiki.archlinux.org/index.php/Xorg)
|
|
|
|
|
[Archlinux Wiki Xfce](https://wiki.archlinux.org/index.php/Xfce)
|
|
|
|
|
[Archlinux Wiki Cinnamon](https://wiki.archlinux.org/index.php/Cinnamon)
|
|
|
|
|
[server-world Desktop Environment : Install Xfce](https://www.server-world.info/en/note?os=CentOS_7&p=x&f=8)
|
|
|
|
|
[server-world Desktop Environment : Install Cinnamon](https://www.server-world.info/en/note?os=CentOS_7&p=x&f=6)
|
|
|
|
|
[VNC+xfce4 远程桌面及公网访问](https://blog.csdn.net/qq_22918577/article/details/69817646)
|
|
|
|
|
[ubuntu16.04安装VNC+xfce 的方法](https://blog.csdn.net/m0_37041325/article/details/80516041)
|