To set up x11vnc on Ubuntu 22.04, you can follow these steps:
- Install x11vnc: Open a terminal window and run the following command to install x11vnc:
sqlsudo apt-get update
sudo apt-get install x11vnc sudo apt install lightdm
- Generate a password file: Run the following command to generate a password file:
x11vnc -storepasswd
This will prompt you to enter a password and save it in a file named ".vnc/passwd" in your home directory. Ex: /home/thin/.vnc/passwd
- Create a systemd service file: Create a new file named "x11vnc.service" in the "/etc/systemd/system/" directory with the following content:
makefile[Unit] Description=x11vnc service After=display-manager.service network.target syslog.target [Service] Type=simple ExecStart=/usr/bin/x11vnc -auth /home/thin/.Xauthority -forever -loop -noxdamage -repeat -rfbauth /home/thin/.vnc/passwd -rfbport 5900 -shared ExecStop=/usr/bin/killall x11vnc Restart=on-failure [Install] WantedBy=multi-user.target
This will create a systemd service file to start x11vnc at boot time and stop it when the system shuts down.
- Reload the systemd daemon: Run the following command to reload the systemd daemon and load the new service file:
sudo systemctl daemon-reload
- Enable and start the service: Run the following commands to enable and start the x11vnc service:
bashsudo systemctl enable x11vnc.service
sudo systemctl start x11vnc.service
- Verify that x11vnc is running: Run the following command to verify that x11vnc is running:
luasudo systemctl status x11vnc.service
This should show you the status of the x11vnc service and indicate that it is running.
- Connect to x11vnc: Use a VNC viewer application to connect to your Ubuntu system using the IP address and password you specified earlier.
إرسال تعليق