Set up x11vnc on Ubuntu 22.04

 To set up x11vnc on Ubuntu 22.04, you can follow these steps:

  1. Install x11vnc: Open a terminal window and run the following command to install x11vnc:
sudo apt-get update sudo apt-get install x11vnc sudo apt install lightdm
  1. 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

  1. Create a systemd service file: Create a new file named "x11vnc.service" in the "/etc/systemd/system/" directory with the following content:

[Unit] Description=x11vnc service After=display-manager.service [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]

This will create a systemd service file to start x11vnc at boot time and stop it when the system shuts down.

  1. Reload the systemd daemon: Run the following command to reload the systemd daemon and load the new service file:
sudo systemctl daemon-reload
  1. Enable and start the service: Run the following commands to enable and start the x11vnc service:
sudo systemctl enable x11vnc.service sudo systemctl start x11vnc.service
  1. Verify that x11vnc is running: Run the following command to verify that x11vnc is running:
sudo systemctl status x11vnc.service

This should show you the status of the x11vnc service and indicate that it is running.

  1. Connect to x11vnc: Use a VNC viewer application to connect to your Ubuntu system using the IP address and password you specified earlier.

Post a Comment

Previous Post Next Post