Wine applications over SSH
The sad and rather sudden demise of Kim’s netbook has left us considering exactly what kind of device to replace it with. On the one hand, it ran extremely well for four years with a variety of *buntu installations – most recently Xubuntu; on the other hand, Kim feels that everything she wants to do could be done with a tablet – or more specifically an iPad. She does, however, need some native Windows applications, which ran under Wine on the netbook, and for which there’s no iOS equivalent.
Proving the old adage (which I just made up) of “where there’s a geek, there’s a way”, I had the idea of installing her Wine applications to our Mythbuntu-based home media centre, and letting her access them via an SSH tunnel.
On our Mythbuntu 11.10 media centre, this proved to be almost insanely easy! I already had SSH server installed, but if you don’t then open a terminal window and type:
sudo apt-get install ssh
I didn’t have Wine installed, but this is a simple case of just typing:
sudo apt-get install wine
Next, I installed the Windows applications and tested them on the media centre itself.
From my laptop, running Ubuntu 12.04, I tested to see if I could get a Wine application opening through SSH:
ssh -X email@example.com 'wine notepad'
The IP address of my media centre is 192.168.0.100. The “-X” switch enables X11 (the graphical user interface) to be forwarded, and the final part ‘wine notepad’ is the command I want to run.
After typing in my password, the Wine notepad application popped up on my screen. So far so good!
I knew that the application I wanted to launch had more complex requirements – including an “ENV” command – so I put all of this into a little shell script called wtlib in the home directory of my media centre (guess what I was wanting to run!!) and made it executable. I now ran:
ssh -X firstname.lastname@example.org ~/wtlib
Happily, after a little churning, Watchtower Library 2011 appeared and, over my home wireless network, was perfectly usable.
This works very well for Linux-based machines, since they’re already running an X Server. Most other devices (Windows PCs, Macs, iStuff) don’t have built-in X Servers, so we need to get one. There are some available for iOS, and the best of these – in my humble opinion – is iSSH.
We don’t have Kim’s new iToy yet, but I do have iSSH on my iPhone (there were an awful lot of “i”s in that sentence). For €7 from the App Store it isn’t the cheapest app in the world, but it does have a built-in X Server and DWM (dynamic window manager), so it allows X-based applications to be tunnelled over SSH.
A trivial bit of configuration later, and I had my Wine application running in an SSH tunnel to my iPhone. The iPhone’s screen size renders it almost unusable, but the speed was good. You just have to keep scrolling backwards and forwards to see anything. In a future version of iSSH they’re planning on bringing out a window resizing feature, which will be much more helpful.
Yet again I’m happy about how easy it is with Linux to implement a solution like this. The only cost was the app for the iDevice, but all of the other stuff was freely available and easy to configure.