Video Training
Prerequisites
To follow this guide, you’ll need:
- An Ubuntu Server installation
- Terminal access with sudo privileges
Let’s dive into the step-by-step process of setting up a remote desktop on your Ubuntu Server.
Step 1: Update and Upgrade Your System
First, make sure your server’s packages are up to date.
Run the following command:
This will update the list of available packages and install the latest versions of those packages.
Step 2: Install XFCE Desktop Environment
Since Ubuntu Server lacks a graphical interface by default, you’ll need to install one. We’re using the lightweight XFCE desktop environment to minimize the load on server resources.
Run:
The xfce4-goodies
package includes additional features and tools that enhance the XFCE desktop experience.
Step 3: Reboot Your Server
To apply these changes, reboot your server using:
After the reboot, your system will have XFCE installed as the graphical interface.
Step 4: Install x11vnc
The x11vnc package allows you to connect remotely to your server's desktop environment. Install it by running:
Step 5: Create the x11vnc Service File
To make the x11vnc service start automatically when your server boots, create a service file.
Open the service file in a text editor:
Copy and paste the following code into the file, and modify the -passwd
field with a strong password to secure your connection:
[Unit]
Description=x11vnc service
After=display-manager.service network.target syslog.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -forever -display :0 -auth guess -passwd YourPassword
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
[Install]
WantedBy=multi-user.target
Step 6: Enable and Start the x11vnc Service
Once you’ve created the service file, enable and start the x11vnc service to allow remote connections:
Run the following commands to reload systemd, enable the service to start on boot, and start it immediately:
You can verify that the service is running correctly by checking its status:
If the service is running, you should see an output indicating that x11vnc is active.
Step 7: Connect to the Ubuntu Server from Your Local Machine
With x11vnc running, you can now connect remotely. Open a VNC viewer application on your local machine (such as RealVNC or TigerVNC) and enter your server’s IP address along with the password you set in the service file.
Conclusion
By following these steps, you’ve set up remote desktop access to your Ubuntu Server, allowing you to manage it through a graphical interface securely. This setup is lightweight and ensures you can access the server without needing to log in directly.
For any issues, check the x11vnc logs and adjust firewall settings if needed to ensure the connection goes through. With remote desktop configured, managing your server is simpler and more efficient!
Comments
Post a Comment