OK, I’ve been using this setup for over a week. I’m a developer /sys admin who needs a Linux environment and who is stuck with just a Vista laptop. So here’s my solution. Certainly not a perfect solution but a lot better than some I’ve used in the past.
The idea is that we run Ubuntu (or any Linux disto) within a VMware machine (I assume the free VMware player would work for this, but i’m using VMware workstation). We then install the free X server Xming and use that to start X applications from the Ubuntu machine. In reality I use this for two main reasons – running Emacs with a Linux backend and controlling ssh tunnels. I can do both of these things natively in Windows or using Cygwin but both are painful in real life. And if all your live deployments have Ubuntu at the backend, you really want the same for your development environment.
First thing you need to do is install Linux on your Vmware machine. I use the Hardy Heron server install as it’s a lot lighter than the desktop and we don’t want to run a linux desktop anyway. Yes, a desktop inside a desktop could be construed as cool for the first day or so if you have never done it before but it soon becomes a pain in the arse. There are some other versions of Ubuntu which are even more stripped down but we use Ubuntu Server for our normal server installs so I went with that.
My Vista laptop has 2GB of RAM and is dual core. In the VM I assign both processors and 512MB of memory. I also preallocated the disk to try and eek some more performance out of it (60GB in this case). See my comments later on performance. For networking I used Host. If you are moving your laptop around a lot this may be a small pain as you’ll need to keep an eye on the ip address your VM is given each time. Probably better solutions for this.
Make sure you install the ssh server. On Gutsy and Hardy it’s an option you get at the end of the install process. Otherwise “apt-get install openssh-server”.
On Hardy Heron default server install, once it’s up and running, the important setting to change is
add the entry
and then do
apt-get install xauth
Now install Xming and Putty. We’ll use Putty to ssh into VMware and launch our apps. The settings you need in Putty are wonderfully described here along with other useful troubleshooting tips which may be of use if you are not going the Ubuntu route. On Ubuntu I just needed to do what I’ve described above.
Start up Xming. Now, using Putty, log into your VM. The first time you log in, if you’ve done what I’ve outlined, you’ll see a message saying words to the effect that .Xauthority is being created. Now launch an X app. You might want to “apt-get install x11-apps” and launch xclock as a test. Revel in it’s minimalistic glory. If you don’t see xclock appear then check if Xming is trying to tell you something – check if the Xming window is flashing at the bottom of the screen for example.
If that doesn’t work, check out the Xming web site or post a question here.
Now you can install anything you want to run. In practice, for me, that’s meant
I have Firefox installed, as I sometimes need to browse sites through the tunnels I create with gSTM. gSTM is a Gnome app. Here it is running, on my Vista desktop. On the right hand screen you can see the obligatory x apps running which are of little use at all. The putty session on the right screen lower is running top on the VM. The upper putty session is connected to a remote system behind a remote system via the tunnel manager.
It’s not without it’s problems. The screen shot at the start of this post shows me running Emacs and running some unit tests within Emacs which are doing a lot of python and postgres processing. Check out the cpu and RAM usage in the sidebar widget at the right. At that stage the machine was somewhat sluggish although useable. Certainly after a day of heavy development I found a good reboot of the whole setup (from Vista downwards) would help. Having more RAM in the laptop would also benefit although having a 3GB limit with 32bit Vista sucks. In short, you’re using a VM and you’ll be taking a slice (maybe I should say ‘a chunk’) off your performance compared to just running Linux directly.
Two other issues. Not major but to be kept in mind. I find that over the course of a day I end up with a lot of Putty sessions open. I might be able to manage these better if I spent some time looking at it – and it doesn’t help that I launch my X apps from Putty as well. Xming goes with a launcher program which I haven’t tried yet. That might be useful.
Final issue is copying and pasting. Sometimes this seems hit and miss but frankly that’s not a lot different from what I experience in native Ubuntu. Ctrl-Insert and Shift-Insert sometimes had to be done a few times before something would wake up to what I was doing. This is something I could improve if I had the time (so you can see it wasn’t that big a deal).
I’ve been laughed at once already today for saying this, but I’ll say it again. I like the look of Vista and I’ve grown really attached to that sidebar (can somebody recommend a Mac solution to give me similar functionality). But Ubuntu is damn pretty as well. More importantly, if you’re running Vista natively then you don’t have to sit there for HOURS on end loading up drivers to get your audio working with your webcam and – oh – that makes the wireless drop out. Hang on, I’ll recompile the wireless module – that’s better. Oh, the webcam’s gone again – and where did the memory card support go to? And don’t even BEGIN to talk to me about hibernation. God that drives me mad. Dual boot is a pain in the arse as well. I just want to sit in one environment working.
So if I need native Vista to get the most out of my laptop my two current options are Cygwin and this. Cygwin is great if all the stuff you need is available in it. It sucks like a hoover if you start having to compile stuff natively under cygwin. Does for me anyway.
Having the VM as your development environment also makes it a lot easier to move it around to new machines. We’ll see how that pans out later today when the new MacBook Pro is due to arrive.
This time last week I was wondering whether I could make this environment my full time environment. I nearly can. In the end the problems are not so much with the solution as with the laptop. It needs a bit more power and it needs more RAM (and I can only go up one more GB easily). Also (this is a Sony Vaio VGN-FE41Z) the fan is bloody loud. I usually sleep with the laptop next to my head. The noise is getting annoying.
So the MacBook Pro is arriving today. I’ll gain more power, illuminated keyboard, Mac loveliness and maybe (maybe) a quieter fan. We’ll see. But I’m intending on trying a similar setup on the Mac as well. I’ll let you know how I get on. If anybody else is running a similar setup as this on their Windows system let me know how I can improve performance.