How to Share Screens Between Two Ubuntu PCs with X11
Vincenzo Di Franco
文 (cultura), 森 (natura), 佐 (aiuto), 迪 (guida), 弗 (unicità), 朗 (luminosità), 科 (competenza)
Hey there, tech enthusiasts! ?? Looking to level up your Ubuntu game? We've got a fun and super useful guide for you today: sharing screens between two Ubuntu PCs using X11. Forget about boring, clunky setups—this one's smooth and sleek. Ready? Let’s dive in!
Why X11?
Before we jump into the nitty-gritty, why bother with X11? Well, if you're looking to control one PC from another, whether it’s for development, presentations, or just plain fun, X11 has got your back. Plus, it's open-source and packed with powerful features. Who doesn’t love a good open-source tool?
Step 1: Install X2X and X11
First things first, let’s get the essentials installed on both your primary and secondary computers.
On both computers:
sudo apt update sudo apt install x2x xorg
Easy, right? Now we’re all set to start configuring.
Step 2: Configure X11 Forwarding
Alright, let’s move on to enabling X11 forwarding. This step is crucial for making sure X2X works its magic.
On the secondary computer:
sudo nano /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
sudo systemctl restart ssh
Step 3: Set Up X Authentication
Next up, we need to make sure the primary computer can access the display of the secondary computer.
On the secondary computer:
bashxhost +<IP_of_primary_computer>
Replace <IP_of_primary_computer> with the actual IP address of your primary computer.
Step 4: Connect via SSH with X11 Forwarding
Now, let’s connect the primary computer to the secondary one using SSH.
On the primary computer:
领英推荐
ssh -X username@<IP_of_secondary_computer>
What does -X mean in ssh -X?
The -X option in the ssh command enables X11 forwarding. X11 forwarding allows you to run graphical applications on a remote machine and display them on your local machine. Here's a detailed explanation:
Why use -X?
Replace username and <IP_of_secondary_computer> with your actual username and the IP address of the secondary computer.
To check if everything is set up correctly, verify the DISPLAY environment variable:
echo $DISPLAY
You should see something like localhost:10.0.
Step 5: Test the Setup
Time for the moment of truth! Let’s see if the X11 forwarding is working.
On the primary computer:
xclock
If an X11 clock pops up, you’re golden! ??
Step 6: Launch X2X
Finally, let’s launch X2X to control the secondary computer from the primary one.
On the primary computer:
x2x -east -to :0
This command assumes the secondary computer’s display is :0. Adjust as needed if you’ve got different settings.
Troubleshooting Tips
If you hit any snags along the way, here are a few things to check:
And that’s it! You’re now ready to share screens between two Ubuntu PCs using X11 like a pro. ????? If you found this guide helpful, be sure to share it with your fellow Linux enthusiasts. Happy screen sharing!
CEO-Sonatafy | Helping Software Leaders Scale Smarter, Not Harder | 30+ Startups. 10 Wins. 20 Lessons | Forbes & Entrepreneur Author
10 个月Excited to simplify your screen-sharing experience with X11 magic. ??