完善 Ubuntu20 开启 VNC 服务.
Signed-off-by: lion.chan <cy187lion@sina.com>
This commit is contained in:
parent
7c05bc2b0f
commit
46abf05bd8
|
@ -6,12 +6,18 @@
|
||||||
# VNC Server
|
# VNC Server
|
||||||
apt-get install vnc4server
|
apt-get install vnc4server
|
||||||
# Xfce4
|
# Xfce4
|
||||||
apt-get install xinit lightdm xubuntu-desktop xubuntu-default-settings xubuntu-artwork xubuntu-icon-theme
|
apt-get install xinit lightdm xubuntu-desktop
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2.配置
|
## 2.配置
|
||||||
|
|
||||||
可通过编辑 ~/.vnc/xstartup 文件实现对 vnc 服务的配置。
|
首先确保 ~/.vnc/xstartup 文件具有可执行权限:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod u+x ~/.vnc/xstartup
|
||||||
|
```
|
||||||
|
|
||||||
|
然后可通过编辑 ~/.vnc/xstartup 文件实现对 vnc 服务的配置。
|
||||||
|
|
||||||
### 2.1.Xfce4
|
### 2.1.Xfce4
|
||||||
|
|
||||||
|
@ -36,6 +42,7 @@ x-session-manager & xfdesktop & xfce4-panel & xfsettingsd & xfwm4 &
|
||||||
# 设置 VNC 访问密码
|
# 设置 VNC 访问密码
|
||||||
vncpasswd
|
vncpasswd
|
||||||
# 开启 VNC 服务
|
# 开启 VNC 服务
|
||||||
|
export USER=<user name>
|
||||||
vncserver :1 -geometry 1920x1080 -depth 24
|
vncserver :1 -geometry 1920x1080 -depth 24
|
||||||
# 停止 VNC 服务
|
# 停止 VNC 服务
|
||||||
vncserver -kill :1
|
vncserver -kill :1
|
||||||
|
|
|
@ -1,35 +1,49 @@
|
||||||
# Ubuntu20 开启 VNC 服务
|
# Ubuntu20 开启 VNC 服务
|
||||||
|
|
||||||
TODO: 还没有验证通过
|
|
||||||
|
|
||||||
## 1.安装
|
## 1.安装
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# VNC Server
|
# VNC Server
|
||||||
apt-get install tigervnc-standalone-server
|
apt install tightvncserver
|
||||||
# Cinnamon
|
# Mate
|
||||||
apt-get install xinit lightdm cinnamon cinnamon-common cinnamon-control-center cinnamon-core cinnamon-session
|
apt install ubuntu-mate-desktop
|
||||||
|
# Xfce
|
||||||
|
apt install xubuntu-desktop
|
||||||
```
|
```
|
||||||
|
|
||||||
## 2.配置
|
## 2.配置
|
||||||
|
|
||||||
可通过编辑 ~/.vnc/xstartup 文件实现对 vnc 服务的配置。
|
首先确保 ~/.vnc/xstartup 文件具有可执行权限:
|
||||||
|
|
||||||
### 2.1.Cinnamon
|
```bash
|
||||||
|
chmod u+x ~/.vnc/xstartup
|
||||||
|
```
|
||||||
|
|
||||||
针对 Cinnamon 的配置如下:
|
然后可通过编辑 ~/.vnc/xstartup 文件实现对 vnc 服务的配置。
|
||||||
|
|
||||||
|
### 2.1.Mate
|
||||||
|
|
||||||
|
针对 Mate 的配置如下:
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
unset SESSION_MANAGER
|
unset SESSION_MANAGER
|
||||||
unset DBUS_SESSION_BUS_ADDRESS
|
unset DBUS_SESSION_BUS_ADDRESS
|
||||||
# For Cinnamon
|
# For Mate Desktop
|
||||||
exec dbus-launch cinnamon-session
|
exec mate-session &
|
||||||
# For Xfce
|
# For Cinnamon Desktop
|
||||||
#exec dbus-launch xfce4-session
|
#exec cinnamon-session &
|
||||||
# For GNOME
|
# For Xfce Desktop
|
||||||
#exec dbus-launch gnome-session
|
#exec xfce4-session &
|
||||||
|
# For GNOME Desktop
|
||||||
|
#exec gnome-session &
|
||||||
|
```
|
||||||
|
|
||||||
|
使用 VNC 远程连接到 Mate 桌面后,由于无法渲染阴影导致窗口边缘区域存在黑边,此时通过 Mate Tweak 工具修改下设置就好。
|
||||||
|
|
||||||
|
```blk
|
||||||
|
Mate Tweak->Windows->Window manager->Marco(No Compositor)
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3.使用
|
## 3.使用
|
||||||
|
@ -38,6 +52,7 @@ exec dbus-launch cinnamon-session
|
||||||
# 设置 VNC 访问密码
|
# 设置 VNC 访问密码
|
||||||
vncpasswd
|
vncpasswd
|
||||||
# 开启 VNC 服务
|
# 开启 VNC 服务
|
||||||
|
export USER=<user name>
|
||||||
vncserver :1 -geometry 1920x1080 -depth 24
|
vncserver :1 -geometry 1920x1080 -depth 24
|
||||||
# 停止 VNC 服务
|
# 停止 VNC 服务
|
||||||
vncserver -kill :1
|
vncserver -kill :1
|
||||||
|
|
Loading…
Reference in New Issue