14 Aug 2005
(updated 14 Aug 2005 at 16:55 UTC) »
2 Linux Boxes - One Monitor
I have 2 Linux boxes. One runs Fedora 4 [closet.squeezel.com] and the other Fedora 3 [squeezel.squeezel.com]. The monitor is physically attached to FC3.
It's convienent to run both, yes both, gnome and kde on the same monitor, in the same window. The menu bar for the FC3 is at the top, and FC4 is at the bottom of the screen. Here's how I set this up. This setup is run from [squeezel.squeezel.com]
, the computer with FC3, in a gnome-terminal:
$ ssh -Y closet.squeezel.com
By default FC3 and FC4 are configured for X11 forwarding. The ``-Y'' option is for trust forwarding. After running the command above, I'm connected to closet.squeezel.com. Next, I just load the KDE session.
Or, if you want gnome instead.
You may get a few errors above on sound cards. On my configuration, I had to setup the monitor for the correct resolution. But, that was pretty straight forward.
Also, you'll want to set the menu bar for each computer for different parts of the screen. That was it. You can do this through firewalls as well - reference ``Breaking Firewalls with OpenSSH''
Ctl-Alt-F12 (What if you wanted FC4 on vt12?)
Well, of course you can have your cake and eat it too. Even with the above configuration, it's possible to run a complete session on vt12. Above, I chose startkde for the second session, but sometimes I like the gnome-session on a complete terminal, so I put that (the gnome-session) on virtual terminal 12.
The following commands are executed from the computer with the physical monitor in an xterm, which is squeezel.squeezel.com. Do it in an xterm, so you can lock the display should you walk away from it.
$ xinit -- :1 vt12
Note above that's ``xinit [space] -- [space] :1 [space] vt12''. If you want to add even more virtual terminals, execute the command above with :2 and the desired vt[number]. Now, the screen get's a little funky, but you want to type in the following comand: ``ssh -Y [remote server]''. This is the command I use.
$ ssh -Y closet.squeezle.com
After it logs in.
The above will take a few second to load. Now you just switch to the correct virtaul terminal. In my case it was as follows:
Switch to the new virtual terminal
To get back
If I've missed anything, I'll update it in Linux Tips (TIP 195 - Trusted X11 Forwarding).
I do this with computers across the Internet as well. If you're doing the same you may want to reference (TIP 13 - Securing sshd), which shows you how to limit only certain accounts access to ssh. Also, block IP address with iptables for locations that you will never connect from..
Why do this?
The biggest advantage of this setup - you save money. No expensive KVM switches, no additional monitors. Save your money for faster hardware. The boxes can mount NFS over OpenVPN so that files are accessible from both computers.
Want more ideas?
If you comb through the more than 100 pages of Linux Tips, you'll see tips for setting up OpenVPN, NFS, securing ssh and a lot of other stuff...free of course.
Hope this helps...