Add systemd service configurations for x11vnc and noVNC

Update README.md with detailed systemd service files for:
- x11vnc service to enable VNC server on display :0
- noVNC service to provide web-based VNC access
- Include proper service dependencies and environment settings
This commit is contained in:
Timothyxxx
2025-02-21 16:32:00 +08:00
parent 884676cebc
commit e762adea28

View File

@@ -112,6 +112,7 @@ sudo snap install novnc
Description=noVNC Service
After=x11vnc.service network.target snap.novnc.daemon.service
Wants=x11vnc.service
[Service]
Type=simple
ExecStart=/snap/bin/novnc --vnc localhost:5900 --listen 5910
@@ -122,6 +123,7 @@ Environment=XAUTHORITY=/home/user/.Xauthority
Environment=SNAP_COOKIE=/run/snap.cookie
Environment=SNAP_NAME=novnc
Environment=SNAP_REVISION=current
[Install]
WantedBy=default.target
```
@@ -131,6 +133,7 @@ Write a file `x11vnc.service` with the following content:
Description=X11 VNC Server
After=display-manager.service network.target
Wants=display-manager.service
[Service]
Type=simple
ExecStart=x11vnc -display :0 -rfbport 5900 -forever
@@ -139,6 +142,7 @@ Restart=on-failure
RestartSec=3
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/user/.Xauthority
[Install]
WantedBy=default.target
```