Business Internet and Telephony, since 1985

Adding Convenient Layers of Persistent Abstraction to Simplify Remote Administration

Printer-friendly versionPrinter-friendly versionSend by emailSend by email Share this

So you've been searching for a tool that you can group and pile a bunch of your live work into, providing continuous access when you want it, and available from anywhere you need it, when you need it.

Something that can manage several remote sessions at once, and something you don't really ever have to close down. Something that works with or without a mouse. Something that works equally well in a simple console, or under X and your favorite window manager. i.e., KDE, XFCE, Fluxbox, etc.

Enter twin. A seasoned and stable software offering that can greatly impact your productivity and organize the multitudes of local and remote sessions you typically manage. With twin, you don't have to continuously launch several Xterm windows, or open a bunch of tabs you can't see all at once in an Xterm window, or keep switching around from one virtual console to another - you can keep everything all nice and neat in one, single toybox, and you can access it from anywhere, at anytime...

If you're like me, you often find yourself cleaning up and closing handfuls of terminal sessions that your not using, after opening one up for a task, and then moving back to another application or task, and in the process, inadvertently forgetting that your Xterm window has gotten buried somewhere deep beneath other windows on your desktop.

Or perhaps you open an Xterm so you can ssh into another machine, run screen or tmux and many hours later find yourself hunting down that particular window, so as not to duplicate the session you know is already running, or violating some policy regarding the number of simultaneous processes permitted on a single remote host.

Considering how the readers here seem to be generally adventurous, I figured I would share a little bit about I keep my login sessions from degrading into a disarray of almost insurmountable, incomprehensible, anarchy.

Think of twin as a unique window manager like you've never seen before, partly because there really isn't anything else like it, and partly because you probably never have.

From within twin, you can run several *twinterms*. When you're ready to leave work and go home you can merely detach your twin session by closing the window and resume where you left off at home - and your twin sessions at home or on your other multiple workstations at the office can be left running all the time if you wish. There's no need to detach if you don't want to.

Let's talk about that.

I typically like to tile and layer/stack my remote sessions out into around 6 or 7 twinterms within each of my twin session windows, but sometimes many more (twin has nice window stacking/layering capabilities and can be used as a desktop/window manager inside of your default desktop/window manager).

Since I'm constantly actively engaged in the operations of many machines in many places, I ssh into say, a particular host and start or attach to a running tmux session.

Many of us are already familiar with opening up an Xterm, ssh'ing into a remote host, and starting a screen or tmux session to control several tasks on that host, but when you multiply this by a dozen or so hosts all at once it increasingly becomes a daunting task in and of itself just to keep track of all those windows containing your ssh sessions.

From within a single twin session, however, we can have a myriad of screens/windows with options making it easy to manage, and if the twin session is running on another host, you can simply disconnect (detach) and bag up your laptop, and reconnect (attach) to it at will, keeping all other types of sessions and local applications running in other pager windows, for example.

I personally like to run twin sessions full screen, and dedicate it to some particular pager window on my XFCE desktop. It makes it like a completely different desktop all its own, and really, it is.

How does this enable us more than other solutions?

Well, twin is a text-based graphical window manager, and you can display on X11, the Linux console, and inside of itself.

twin can be used in the same manner as X, whereby it is your server managing remote clients.

  • Installing and running twin for the first time:

Installing twin is a snap. a simple...


# sbopkg -i twin

and it's installed and ready to go in a few seconds. You can create a menu item for it in your favorite window manager, or you simply invoke twin from your console or from an Xterm.

NOTE: a/o this writing, using your favorite package manager above will yield an installation of twin version 0.6.1

You can download a copy of the latest package (version 0.6.2) at: gopher://gopher.northtech.us/9/software/distro/Slackware/packages/twin-0...

Then, simply use your native local package manager and...


# installpkg twin-0.6.2-x86_64-1_SBo.tgz

and in about two seconds your all set to fire up twin for the first time!

Now Let's give this puppy a whirl for the first time in an Xterm...


$ twin &

Now from within that window you have an entire other environment to work with, locally or remote, so let's continue by opening up a twinterm window session inside of twin.

While holding down the right mouse button over the menu bar in the upper left of the window and choose New Term.

If you don't have a mouse your *pause* key will bring up the menu which you can navigate manually, and you can move, stack, and layer the windows any way you like with your keyboard.

Now try out an ssh session or what-ev ;)

And now for the *real kicker* - twin supports multiple simultaneous instances and can attach/detach any display on the fly. Talk about versatile!

I'll write more about this later in a tutorial covering the usage of twin in an upcoming HowTo, but for the meantime you should be off to a good start with whetted appetite for more. Explore. Enjoy.

twin has a plethora of features, as well as a myriad of ways it can be utilized - just remember though, that not unlike tmux or screen, you should bear in mind that simply closing the window of your twin session leaves your disconnected session running - which might be why you should be so interested in this small and powerful window manager in the first place.

  • twin in the real world:

The typical usage of a single twin session might look something like this. six twinterms running ssh to six different remote hosts. Each ssh session inside the twinterms is running an instance of either tmux or screen, which in turn have a few windows running other jobs on those hosts.

If you're a script kiddie, twin could make you an Irssi botgod (not really, coz you already suck). If you're a systems administrator, you can use twin like a virtual briefcase of live, running jobs - attaching to it at anytime, from any location, from just about any machine (all while the particular twin session is simultaneously attached to displays on other machines).

To take this a step further, you can have several other twin sessions attached and displaying inside of a twin session, each with say 10 twinterm sessions one twin session for twinterms containing logfile tails, another twin session containing several twinterms of jobs you just didn't want to run in the background, and yet another twin session containing a calculator, a lynx session running on a remote machine, top on your local machine, and an Xmms session playing your favorite Rob Zombie tunes.

  • Wrapping it all up with a pretty blue bow:

All in all, twin is easy to install, intuitive in nature, and provides a tiered layer of abstraction that provides for a level of administration that is both convenient, and portable.

A twin session is easily accessed from anywhere, without complicating the users local environment by having you open several Xterms, ssh into a remote host, and then reattach to tmux or screen sessions - you simply attach to your twin session, and everything is right there inside that window, already running. Right where you left off.

There are also other complimentary packages as well, including the source for twin itself, an Xmms applet and other various tools and accessories for twin at Sourceforge

Best of all, it's true FOSS licensed under the GPL :)