This is a tutorial of tigervnc
You cant't use xvnc and x0vncserver simultaneously.
Used in headless mode (沒有連接螢幕)
If you need to connect to the monitor, you must kill this process.
Control your physical monitor directly.
apt install tigervnc-standalone-server # for xvnc
apt install tigervnc-scraping-server # for x0vncserver
dnf install tigervnc-server
- Set the vnc password by
vncpasswd
- Follow the instructions below
Set $localhost = "no"
in custom configuration
Start a session by vncserver -rfbport 5903
List all sessions by vncserver -list
Close this session by vncserver -kill :3
You can start the session either in shell or by a service file
Start a session by x0vncserver -display :0 -rfbauth ~/.vnc/passwd -rfbport 5903
Create the service file by systemctl edit --user --force --full x0vncserver.service
or simply create the file at ~/.config/systemd/user/x0vncserver.service
Start this service by systemctl --user start x0vncserver
Autostart this service at login by systemctl --user enable x0vncserver
-display
: display number, normally :0-rfbauth
: password file-rfbport
: service port
[Unit]
Description=Remote desktop service (VNC)
[Service]
Type=simple
# wait for Xorg started by ${USER}
ExecStartPre=/bin/sh -c 'while ! pgrep -U "$USER" Xorg; do sleep 2; done'
ExecStart=/usr/bin/x0vncserver -display :0 -rfbauth %h/.vnc/passwd -rfbport 5903
# or login with your username & password
#ExecStart=/usr/bin/x0vncserver -PAMService=login -PlainUsers=${USER} -SecurityTypes=TLSPlain
[Install]
WantedBy=default.target
- Global configuration:
/etc/vnc.conf
- Custom configuration:
~/.vnc/vnc.conf
Add this file /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf
and set owner root:root, mod 644
polkit.addRule(function(action, subject) {
if ((action.id == "org.freedesktop.color-manager.create-device" ||
action.id == "org.freedesktop.color-manager.create-profile" ||
action.id == "org.freedesktop.color-manager.delete-device" ||
action.id == "org.freedesktop.color-manager.delete-profile" ||
action.id == "org.freedesktop.color-manager.modify-device" ||
action.id == "org.freedesktop.color-manager.modify-profile"
)
)
{
return polkit.Result.YES;
}
});