NotePublic/Software/System/Linux/Manjaro/Manjaro_安装图形界面及开启_VNC.md

85 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Manjaro 安装图形界面及开启 VNC
## 安装 Xorg 和 lightDM
```sh
pacman -S xorg xorg-xinit lightdm lightdm-gtk-greeter
```
## 安装 xfce4 或 cinnamon
```sh
pacman -S xfce4 xfce4-goodies
# 或
pacman -S cinnamon
```
## 使能 lightDM 登陆管理器
```sh
systemctl enable lightdm.service
```
## 安装和开启 tigervnc
```sh
pacman -S tigervnc
vncserver
```
第一次使用需要按提示输入密码,开启后会提示一个 \<num\> 号num 与 VNC 的默认监听端口有一定对应关系,一般 num=0 时 VNC 默认监听 5900num=1 时 VNC 默认监听 5901以此类推。如果要关闭 vnc 可使用如下命令:
```sh
vncserver -kill :<num>
```
## 配置 VNC
修改 ~/.vnc/xstartup 文件如下:
```sh
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
# For Cinnamon
#exec dbus-launch cinnamon-session
# For Xfce
exec dbus-launch xfce4-session
```
## 远程访问
使用 [VNC Viewer](https://www.realvnc.com) 进行远程访问,该软件支持 Windows、Linux、Android、iOS 等系统。输入:
```sh
<服务器 IP>:<num>
```
然后键入密码即可。
## 通过 SSH 隧道进行连接
在服务器端:
```sh
vncserver -localhost
```
在客户端:
```sh
ssh <user name>@<vnc server ip> -L <local port>:localhost:<vnc port>
```
## 参考资料
[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)