Welcome to the tutorial on “How to Setup X11VNC Server on Ubuntu & LinuxMint”. In today’s increasingly remote and interconnected world, being able to access your computer remotely is more important than ever. Whether you are working from home, managing servers, or simply need to access files on a different machine, VNC (Virtual Network Computing) provides a powerful solution. X11VNC, in particular, is a VNC server that allows you to remotely control your Ubuntu or LinuxMint desktop environment.
This tutorial is designed to guide you through the process of setting up an X11VNC server on your Ubuntu or LinuxMint system. We will cover the prerequisites, step-by-step installation process, and some basic configurations to get your VNC server up and running. Let’s dive into the world of remote desktop access and enhance your computing flexibility!
- Ubuntu or Linux Mint operating system.
- Sudo privileges or access to the root account.
Step 1: Installing X11VNC
The first step is to install X11VNC. Open a terminal window (Ctrl + Alt + T) and type the following command to update your system’s repository index:
sudo apt-get update
Once your system is updated, you can install X11VNC by typing:
sudo apt-get install x11vnc
You will be asked to enter your password, and the installation will begin. Wait for the installation process to complete.
Step 2: Create a Password for VNC Server
After installation, you should set up a password for the X11VNC server. This will protect your server from unauthorized access. Use the following command to create a password:
You will be prompted to enter a password and confirm it.
Output:Enter VNC password: ********* Verify password: ********* Write password to /home/rahul/.vnc/passwd? [y]/n y Password written to: /home/rahul/.vnc/passwd
Once you’ve done this, your password will be stored in a file named `~./vnc/passwd` in your home directory.
Step 3: Start the X11VNC Server
You can now start the X11VNC server using the following command:
x11vnc -usepw -display :0
The -usepw option tells the server to use the password you’ve set, and -display :0 tells the server to share your current X11 session.
Your X11VNC server is now running and ready for connections. You can connect to it using any VNC client.
Step 4: Making X11VNC Start at Boot
If you want your X11VNC server to start automatically when your computer boots up, you need to create a systemd service for it.
First, create a new service file by typing:
sudo nano /etc/systemd/system/x11vnc.service
In the nano editor, type the following:
Replace “YOURUSERNAME” with your actual username. Once you’ve done this, press `Ctrl + X` to exit the editor, then press `Y` to save your changes.
Next, reload the systemd manager configuration with this command:
sudo systemctl daemon-reload
Now, enable the service to start on boot:
sudo systemctl enable x11vnc.service
Finally, you can start the service immediately without needing to reboot:
sudo systemctl start x11vnc.service
Your X11VNC server will now start automatically every time your computer boots up.
Let’s have a look at some common troubleshooting and usage tips:
- Unable to Connect to the Server: Ensure that the VNC client is configured to connect to the right IP address and port (the default is 5900). Also, make sure there is no firewall blocking the connection.
- Slow Connection or Lag: You can reduce the quality of the connection to speed it up. This can be done by adding the -ncache and -speeds options to the X11VNC command. For example, to set the color depth to 8 bits and the speed to modem, use the following command:
x11vnc -usepw -display :0 -ncache 10 -speeds modem
- Errors about Unrecognized Options: The version of X11VNC in the repositories might be outdated. In that case, consider installing a more recent version of X11VNC from its official website.
Useful Tips and Extras
- Secure Your Connection: To protect your VNC sessions, you should use an encrypted connection. X11VNC supports SSL/TLS encryption. You can enable it by adding the -ssl option to the command:
x11vnc -ssl -usepw -display :0
You will also need to configure your VNC client to use SSL/TLS.
- View-Only Mode: If you want to allow someone to view your screen but not interact with it, you can start X11VNC in view-only mode using the -viewonly option:
x11vnc -viewonly -usepw -display :0
- Use X11VNC with LightDM: If you’re using LightDM as your display manager and want to share the login screen, you can do so by running X11VNC as root and specifying the auth file of LightDM:
sudo x11vnc -auth /var/lib/lightdm/.Xauthority -display :0
That’s it! You now have a fully functional X11VNC server set up on your Ubuntu or Linux Mint machine. This will allow you to remotely access and control your existing X11 session from anywhere. Remember, it’s very important to set a strong password to protect your server from unauthorized access. Always make sure your system is up-to-date and monitor your system’s logs regularly for any signs of suspicious activity.
In conclusion, X11VNC is a powerful tool that can be used to share your existing X11 session over a network, making it a perfect choice for remote tech support or any other activity requiring remote access. As always, ensure you have strong security practices in place when dealing with networked services to protect your system and data.