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 user@192.168.0.100 '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 user@192.168.0.100 ~/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.
Quite sad that you would choose to do this with a proprietary iDevice instead of a decent tablet running Linux with Android or Ubuntu. Not only would it give you a much better experience, it would save you 7€ as well! I guess I shouldn’t be surprised since you are insisting on running proprietary Windows software as well. You might as well just get a Windows tablet in that case! Please keep all this closed-source B.S. off Planet Ubuntu.
@Someone Well you’re entitled to your opinion, of course. Personally I think it’s quite sad that you are so blinkered that you don’t see the beauty of getting these disparate technologies to work with a Linux-based solution.
But you’re right, of course, as the self-appointed policeman of blog syndication. It’s quite wrong to demonstrate how Linux helps different technologies work together. I presume that you’ve also complained about the Canonical Design team’s blog posts about cake?
It’s fun to do but there may be a more graceful way to achieve what you want (e.: transdroid / torrentfu for transmission etc). VLC also has a web UI which there are many remote aps for, rather than running X apps over SSH. Its fun to explore what your technology can and cannot achieve though
I’ll take a look, thanks for that
it’s always interesting to try new things and see what I can achieve with Linux, that’s why I like tinkering with it so much
Kim can just surf over to http://wol.jw.org
True & thanks for the comment
that may be an option in future, but right now it only has 10 years of back publications. Most of Kim’s study projects go back further than that.
Very interesting piece to read, thanks for writing it. I didn’t even know that you can do something like this. Is it difficult to have X Server running on CLI-server without enabling DE? Do you know about what security problems X may pose on a server?
Thanks again for your comment. You raise an interesting question, and I’ll have a CLI-only server to play with on Monday, so I’ll give it a try then