Ubuntu (coLinux, VirtualBox, dual-boot) – Full Circle (again)

I blogged a few days back saying I was trying Ubuntu full-screen in Sun’s VirtualBox to see if I could use it to replace Windows.  The answer then was yes, pretty much.  I also found a spare 160GB SATA disk, so decided to install a fresh Ubuntu 9.10 image on that and leave Windows alone for a week or so.

Yep, that works as well.  No issues, could do everything I wanted except Lord of the Rings Online (probably works in WINE but why bother when I have an XP license).  But.

But there wasn’t any real driver for me to keep using Ubuntu.  I don’t have to give up XP (yet), after all, I paid for this license (kind of) and I can already do everything I want under XP, and use a lot of Open Source software to achieve that.  So, after being logged in to Ubuntu for a week, and fancying a quick bash on Lord of the Rings Online I rebooted back to Windows XP and realised I felt like I’d made it back home after a luxury holiday somewhere exotic.  Sure it was nice, but also, nice to be home.

Don’t get me wrong, I love Linux, I love UNIX and I can only get by day-to-day because I have Cygwin installed and can grep and awk and finger as much as I like.  But I don’t need to be using Ubuntu all day to get things done.  Maybe in a few years when I want to give up Microsoft products and stop paying their tax, but for now, no pressure.

So, here I am back in Windows.  But I miss some stuff Ubuntu, and in the short time I used Evolution and a few other things, I came to like them.  No problem I thought, let’s try coLinux again.  Surely, in 10 minutes, I can whip together a coLinux Ubuntu distribution, and be using XWindows and Gnome.

Well, not quite.  I followed most of this excellent guide to build a basic Ubuntu 9.10 coLinux image.  Really, it’s superb.  I tried booting it into coLinux – but no joy.  I hung half way through the boot.  An hour or so later and I discovered it was because Ubuntu Karmic requires some kernel features not present in the stable coLinux kernel.  No problem I thought, I’ll use their development kernel.  No joy there either.  More reading, and Karmic requires kernel stuff only found in some experimental coLinux kernels.  Essentially, I tracked down this page.

So I downloaded the relevant experimental kernel from http://www.henrynestler.com/colinux/testing/kernel-2.6.33/, followed the instructions, and sure enough, my new Ubuntu image boots quite happily.

I added a slirp interface so I could run some apt-get updates, and a TAP interface so I could connect into the coLinux instance from XP.  I also added a page file, and extended the root filesystem (you can find info on how to do those at tek:Cited as well, here and here).

So I was back to running XP, with Cygwin, and coLinux which is roughly where I was three or four weeks ago.  A quick ‘apt-get install ubuntu-desktop’ and a several hundred MB download later, and I can run gnome applications (using Cygwin/X).  But, they’re not quite perfect.  They forget my font settings.  Because I’m running them stand-alone (rather than as part of the whole gnome desktop setup) they don’t always work perfectly, etc., etc.

And so, three or four weeks into this whole thing, I’m coming to the conclusion my best bet, would be to run Ubuntu under VirtualBox.

Which really, is where I started in the first place.

Cygwin and rsync and all things nice

I wrote a little while ago that I was running Linux (Ubuntu in this case) inside a VirtualBox virtual machine, and it was all good.  Before that I’ve played with lots of methods of getting my favourite unix utilities (like rsync) working under Windows.  I’ve used Cygwin, and pre-compiled Windows versions and stripped-down Cygwin versions, and second machines running Linux and VM’s.

One of the main drivers for getting those things working is to back up my websites, held on my hosting account.  I can ssh into my hosting account, and that means if I can get rsync going locally, I can use it with ssh to copy all changes to my local machine.  It’s efficient (rsync only copies changes) and it’s easy.  The pain is always finding a decent compliant version of rsync.

Anyway, I already said that when I started using the Linux VM I ported my script across to that, and along with the VirtualBox shared folders, I could backup my websites and they were visible under XP.  It wasn’t pretty but it worked, and it meant I had to start up the VM.  At the start that wasn’t a problem because I was using it quite a bit but as the days went on and I stopped launching it, backups were less frequent.

And then today – random disaster.  I crashed the VirtualBox VM image, and after a couple of restarts it eventually stopped booting.  This wasn’t a great problem as I had snapshots of working images, so I just rolled back to one of those with two clicks.  Two clicks which took less time than the following thought took to get from one end of my brain to the other ‘I made the snapshots weeks ago, and since then I’ve written a lot of scripts and downloaded a lot of files and you just erased them all you idiot’.

So, I set about repatching Ubuntu and setting up various settings that I’d lost and made a few more snapshots.  But I needed a more permanent, reliable website backup solution.

Which means I’ve installed Cygwin again.  I know there are Windows binaries for rsync, and I know there are other apps which claim to do the same thing, but you can’t (in my view) beat the simplicity of Cygwin and the unix binaries.   Now I have a working cron daemon, ssh configured, rsync installed, and my little script which does all the work.  The rsync command is pretty simple,

rsync –recursive –links –safe-links –rsh=ssh –stats –human-readable me@mywebhost:/myhomedir/ /path/to/local/copy/

Then I just tar up the resulting files, compress them, make sure the filename has a date in it, and I can be confident I’ve got copies of everything I need.  Since most of my sites rely on mysql for their data, I also run some jobs on my webhost to mysqldump all the data into files three times a week, and I then back those files up locally.  I could mysqldump the content remotely, but it’s a hell of a lot quicker to do it on their system, compress them, and then rsync the compressed files.

Installing ssmtp lets me send mail from the Cygwin command line, so the script can send me a mail when it’s finished, and I’ll schedule it in cron to run once a week or something.  Much better.

Plus, I get all the fun of vi, grep and awk 🙂

Windows 7 Beta – file sharing

I suspect it’s because of how I’m running Windows 7 beta under Sun’s VirtualBox, but I can’t at the moment get file sharing working working between the beta and my XP machine.  That’s not an issue in it’s own right (I suspect I know why it doesn’t work), but it does highlight an area that frustrates me.  In their effort to simplify the sharing of files on Windows, Microsoft just confuses the hell out of me.  Three different types of network connection (Home, Work, Public), different behaviour in each, some new (maybe it was in Vista?) network sharing thing that’s not Workgroups, but it might kinda support workgroups as well.

I just wanted a single network options dialog with clearly explained options I can tick or cross.  Where’s the ‘trust me’ option?

Windows 7 Beta in Sun’s xVM VirtualBox

Windows 7 Beta System Information dialogSo I never used Vista.  I heard too much negative press before it was released and too many negative comments from people who did use it after it was released.  Our PC’s came with XP and we were quite happy thank you very much.

But I’m not an out and out Microsoft hater.  They get a lot wrong, but on the other hand, XP does what I want it to do.  I wish it was more secure, but when you’re a target the size of Microsoft with the install base it has you’re going to be under constant attack anyway.  They could be better, but I’m not sure the products are as bad as some haters claim.  Yeh, the company has some terrible practices, but the product isn’t the worst.

I was amused at how quickly news about Windows 7 turned up, it really looks like Vista failed, and I wanted to get a look at it and see if it was something I could move to in the future.  I managed to nab the public beta this morning, and although I doubted it would work I tried installing it into Sun’s xVM VirtualBox – and lo and behold it works fine.

Windows 7 Beta Performance RatingsAnd despite only having 768MB of memory it’s actually pretty usable.  I’d get naffed off if it performed like this all the time on my main machine, but I should imagine given it’s full complement of CPU and another 1.2GB of memory it’ll perform pretty well.

I had one problem installing it into VirtualBox, initially I created the virtual disk as an auto-expanding one and the install crashed half way through (taking out the install, VirtualBox, my machine, three quarters of my desk and creating a small worm hole).  Creating the disk at the full size before installing fixed that and it went on pretty quickly.  You can install the VirtualBox extensions by running them in XP Compatability mode, and you can install the network by telling Windows 7 to look at the VirtualBox extensions CD.  Once the network is up and running, Windows 7 chugs out to the ‘net on it’s own and grabs the sound drivers (as part of windows update).  It was pretty slick.

I’m writing this from Firefox running on the Windows 7 VM (Firefox installed fine, regular version).  There’s a free version of AVG which runs on Windows 7 which is running (link checker turned off).

Clearly I’ve not had a chance to really use any major applications, or push the OS hard, but I have to say Microsoft may have learned the Vista lesson.  I’ll play with it a lot more, maybe see if OpenOffice installs, and let you know.

Sun xVM VirtualBox + Ubuntu

So even though I was initially seeing if I could run an XP sandbox inside Sun’s VirtualBox, I’ve ended up using the Ubuntu VM more than I thought I would.  I know I already said this but I really am impressed with the performance.  I’ve got it installed on my main machine and on a laptop.  They’re both decent machines (4-core or 2-core Pentiums), but I didn’t expect flicking between the VM and XP to be so smooth and for the operation of the VM to be so quick.

Yeh I’m gushing, but there you go.

I ended up re-working a bunch of Linux scripts I already had for backing up my websites locally, which I’d originally written when I was using a Debian machine, then changed to work under Cygwin, migrating that to an XP batch file using a different version of rsync.  So now I back the files up to a filesystem inside the VM, tar them up and move them to a directory outside of the VM (using the Shared Folders feature, which works really well).

I have some weird issues with permissions on the Shared Folder, the ‘root’ directory permissions of the mount point are r-xr-xr-x, subdirectories are fine (rwxrwxrwx).  Can’t work out if that’s me being dumb, Ubuntu being annoying or VirtualBox being crazy.

I wonder what performance would be like if I changed to Ubuntu as the host OS, with XP as the guest.  I wonder if Lord of the Rings Online (the only real game I play) would run smoothly.

I’ve messed with a straight Debian VM (using the latest test version of Debian) and that runs pretty well, but since Ubuntu is Debian under the covers, with a better look (the default Debian fonts are ugly compared to Ubuntu) I don’t think I’ll be keeping it.

So far the VM’s been pretty stable, I managed to crash it running dosemu inside it when I started Wing Commander II.  But I guess I can live without that 😉

Virtual Geekery – Sun xVM VirtualBox

Been playing with Sun’s xVM VirtualBox software again for a couple of days.  I find virtual machines fascinating.  Clearly emulators have been around since the dawn of computing, and in fact, the whole concept of writing software is in some ways emulation.  But the complexity of emulating an entire PC, within a PC, just makes me giggle.

In the daylight hours that I’m obliged to work I spend a lot of time dealing with virtualisation as it’s an increasingly popular technology, and I’ve messed around with virtual machines at home, but VirtualBox really is pretty smooth.

And I’m using it to satisfy my other geekery interest – Linux.  Anyone unlucky enough to have read this blog for a few years will know that I used to have much more Linux in the house, handling web, mail and a bunch of other things.  Over time it became clear that I was just doing it for the sake of it and that open source and free Windows software really was enough to get me by.  This was even more true when we bought new PC’s with XP licenses (I’ll leave that statement hanging, so you get the implication).

I’d messed with Linux desktops for quite a while, originally with SUSE and a little Red Hat, but I’d never gotten on very well with the X Windows environment, it was always too painful to me.  So for a long time I stuck to a server implementation of Debian (never got X working on the graphics card that I used in that machine) and stuck to the server side.  Lately however the desktop distributions have come on in leaps and bounds and coupled with Linux versions of Firefox and Open Office, they really do provide a significant amount of functionality that I use day to day at home.

So I stuck Ubuntu on a virtual machine and it runs really well, very impressed.  Despite the fact that it’s a VM it runs pretty quickly, more than useable.  I suspect other than games I could quite easily live with Ubuntu as my main OS and these days WINE is pretty good at supporting most games (if I understand it correctly).  The reason I won’t move fully is that I have a legit version of XP on this machine, it works fine, does everything I need it to do and plays games.  Which is exactly why Linux is still the underdog in the desktop wars and why you find people so upset about the bundling of OS’s with hardware.

The reason I started looking at VirtualBox again was actually nothing to do with Linux, I wanted to see if I could build a little sandbox running XP, in which I could install and run software that I’d downloaded to make sure it worked as expected and didn’t cause any issues, before installing it on the real image.  VirtualBox provides really nice snapshotting which can ‘roll back’ any malicious installs.  I’m really not sure how the XP licensing works though.  Can I run the same licensed version of XP on my machine, and inside a VM on the same machine legitimately?