Open a remote machines window on your desktop
So I found out a little while ago that the X server can do this thing where it outputs the window from the machine its running on, to a remote machine, also running an X server. I did this a few times and its pretty damn cool. Basically you simply open a console, set the DISPLAY variable to something like 10.0.0.2:0 and it will open on that IP and that display once you add your machine to that machines xhost list. You follow me? No?
Okay, here it is broken down. Lets say, you have two linux boxes, both running GUI’s, and you want to open gedit on one machine (machine1), but display it on the other machine (machine2):
Getting the info:
On machine1, open a console and do:
ifconfig eth0
This should tell you your IP address (e.g. 10.0.0.1). Now go to the other machine and do following:
xhost 10.0.0.1
ifconfig eth0
echo $DISPLAY
OK, that has added machine1 to machine2s receiving trusted list. Now grab your IP on that box (e.g. 10.0.0.2) and the DISPLAY number (e.g. :0) and go back to machine1. Do the following:
DISPLAY=10.0.0.2:0
export DISPLAY
gedit
Now with a bit a bit of luck, gedit should have opened on the other machine.
Handy for:
- Remote administration! Put the box under the stairs without a screen or anything, ssh into it and open any windows on your own desktop.
- Open stuff on other people desktops! “I swear, that porn window came out of nowhere, I clicked nothing!”
Drawbacks:
- The environment that the sent window runs in is still that of machine1. So you can’t access machine2’s files even though you are using the window on machine2 (unless you set up a samba share or something)