Su Tech Ennui: June 2009

Thursday, June 4, 2009

CoLinux has come a long way

Some time ago I used to do all my 'real' computing on my home linux; it was also my main web server and I had a painfully expensive business cable connection at home that it was served over. When I reduced my networking bill by about 90% by switching to a domestic DSL connection, I moved my web site off to a hosted service elsewhere.

Then my unix died, and I didn't feel the pressure I used to feel to get it back online again. I did eventually, but by then I had also set up a unix system on my portable computer and it has turned out that this was a real improvement in my computing environment, so that's what I'm going to tell you about today...

My portable is a cheap Acer that I got from Walmart on Black Friday for around $250. It runs Windows XP and I didn't want to give that up, so I looked at options to run Linux as well as XP on the same machine.

I immediately ruled out Dual Boot, as I frequently want to switch from one to the other; I considered VMWare, which I've had a lot of benefit from in the past, but it's a heavyweight way to run a second O/S and this cheap portable doesn't have enough RAM to do it well.

What I finally chose - at first as a trial - was a technology that I'd looked at several years ago but dropped back then as 'not yet ready for prime time'. With a few years under its belt, I decided to have another look at CoLinux and see how well much it had progressed. CoLinux is a system somewhat similar to User Mode Linux, except that it lets you run a linux under Windows whereas UML is for linux under linux. There are some minor differences in implementation (that the CoLinux people will tell you are crucial), but they're basically the same thing. And I've used UML's for years, I like the concept.

Well, it turns out that there are now a couple of CoLinux implementations to choose from - Portable Ubuntu, and AndLinux. Being lightweight solutions (and having a 400Gb drive on the portable), I decided to try them both.

Bottom line first: neither is quite perfect; I generally work in AndLinux more but pubuntu has some useful features that are enough for me to keep it around.

Andlinux handles networking the way you expect, very similar to VMware. pubuntu does something funny that I haven't quite figured out, but which is actually damn useful. The difference being in how listening services are handled. In AndLinux, the port is opened on the linux's private address, and you have to call from the Windows PC to the Linux to get access. Someone on another machine would therefore have to call your Windows PC first and use some sort of relay that you would have to set up, to get through to the linux.

However when you run a service on pubuntu, the listening port is actually on the Windows XP system and an external machine calling the Windows address connects straight through to the linux, no proxy required.

Which for me, being a heavy user of ssh and scp and sshfs, is a real convenience.

So I generally use pubuntu as my gateway and then ssh from the pubuntu command line to the AndLinux shell, as that's a whole lot easier than setting up an SSH tunnel on XP using something like Putty.

The next big difference is in how these systems integrate with Windows. Both run an X server so that you open X windows on top of your Windows desktop - you never see the Unix desktop. AndLinux runs KDE and has a menu in the icon tray to start commands; pubuntu runs Gnome and has a bar at the top of the screen to run commands. AndLinux also installs easily with right-click handlers enabled for several Linux programs. The AndLinux installation as a system service beats the pubuntu installation hands down for convenience.

Both mount the Windows filing system inside linux, but only the drive that the O/S is installed on. The integration isn't perfect for ether; I actually run FreeSSHD on my windows - two copies, on different ports, and export one drive from each using ssh which I mount using fuse's sshfs. This seems to work better than the built-in access in either of the coLinux systems. Likewise I export the linux filing systems via sshd and mount them on Windows using DokanSSHFS. To make things a little neater I aggregate all my virtual drives under one letter using a commercial product called Virtual Disk which was given away free at the site GiveawayofTheDay.com recently. It's not perfect as you can't use the root of the virtual drive in all contexts, but it's good enough for a lot of things - especially re-exporting a lot of drives via Windows file sharing.

So instead of now needing a network connection to get to my development environment, I take it with me whereever I go, and synch up with my home server whenever it is convenient. This is pretty much an ideal environment for me, and I think I'll stick with it at least until I can get something as powerful in a netbook format. But that's a post for another day...