Tuesday 26 August 2008

Getting Ubuntu 'Hardy Heron' on to a VM - Part 2

New day, and armed with the download of the Desktop version of 'Hardy Heron' I'm installing it on to a Virtual PC VM following the instructions that I found here: http://blogs.technet.com/seanearp/archive/2008/05/13/installing-ubuntu-8-04-hardy-heron-in-virtual-pc-2007.aspx

After reaching the point where I have started the install on the desktop - so far so good.

installing linux on virtual pc 1

installing linux on virtual pc 2

It already is looking far more promising.

Well I've gotten through now as far as altering the audio, and all good so far! I'm holding my breath whilst it restarts (not literally - its' not that quick).

Well, I just heard some bongo like sounding noise immediately before being invited to login (and again after getting the details wrong first time).

installing linux on virtual pc success

Success!

The moral to this seems to be to use the desktop version instead of the server version. If anyone has got the server version on an MS flavour VM then I'd love to hear about it.

Next will be following the instructions to get the screen size right, templating it, and then getting Oracle installed.

Saturday 23 August 2008

Getting Ubuntu 'Hardy Heron' on to a VM - An Unhappy Saga

I've been meaning to dip my toes into the Linux water for a while now - my last exposure being a brief one about ten years ago at Uni. Yesterday evening I thought I'd actually do it. My particular motivation in this case was to run Oracle, something I'm working with a lot at work, and I figured I might as well run it on Linux as not (although we run it on Windows at work).

So, with my Ubuntu Hardy Heron downloaded, and a nice enough VM fresh and clean (2GB RAM, 16GB HDD) I naively thought I'd have it done before bed. Sadly I was wrong :(

Problem number 1 was "An unrecoverable processor error has been encountered.".

HardyHeronVirtualPCError1

After a lot of Googling I found quite a few posts on this. A number of them recommended installing it in Safe Graphics Mode. When I pressed F4 though I only got one option, Normal, so that wasn't going to help me I figured. In the end the article that I followed was this one: http://www.corey-m.com/blog/?p=326.

This recommended that I press F6 and alter the Boot Options line by adding noreplace-paravirt to the end of it (well, just before the --). This was to be done on the initial install, and then again after this but using the 'Rescue a broken system' option this time. Well I did this and then from the Shell I tried to execute the 'apt-get update' command.

This brought about problem 2.

linuxvirtualpcproblem2

Basically, a bunch of 'Could not resolve' messages. Hmmm, at this point I went to bed. This evening though when I got in from work I thought I'd have another crack at it. I tried pinging www.google.com with no joy, but then tried pinging it by IP address and that succeeded. Clearly my issue was connected with the resolution of domain names. A bit more googling later and I found this posting: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/177767. Although not specifically for my situation, it seemed to present a resolution for something close enough so I figured that I'd give it a go.

touch /etc/resolv.conf
dhclient eth0

Having entered the above the resolv.conf file was created, google could be pinged by name and best of all the apt-get update command worked.

This working I returned to the aticle I was following originally (http://www.corey-m.com/blog/?p=326) and tried the next instruction: apt-get install linux-386.

This brought me to problem 3. A series of 'dependency problems' with a variety of Linux packages were reported apparently because they were 'not configured yet', leading to a message that 'Errors were encountered while processing'.

linuxvirtualpcproblem3

Day 3... still no further...

I tried various tricks to get the packages to be configured, in particular reading and following the advice in this 'http://ubuntuforums.org/showthread.php?t=186672' post. But no matter what I tried, still no success.

So I gave up (for now at least) and thought I'd try a different tack - install Windows Server 2005 R2 and get it working on that. I remember seeing a blog post that said that Hardy installs easily onto a Virtual Server vm.

Installing Virtual Server proved to be not too much trouble. I'm running Vista Enterprise and I needed to install the CGI feature (I already had the IIS 6 Compatibility stuff), the Windows Authentication feature. This allowed the exe to run (for the admin interface) and got rid of the annonying 'An error occurred accessing the website application data folder.' message. Just remember to run the Admin interface as an Administrator (and make sure you don't have Anonymous Authentication enabled for the site).

Virtual Server 2005R2 installed and working, I created a new VM and began the install of Hardy Heron on to it. I found I still had to use the noreplace-paravirt option to get it the install to run. One install later and a screen I've unhappily seen before appeared.

linuxvirtualpcproblem4

I'd seen this screen already, when trying to let an install of Ubuntu boot.

Day 4: This is not an experience that I'm enjoying! I'm downloading the latest version of Hardy Heron, but this time the Desktop version rather than the Server version. I left my computer downloading it last night but Vista decided to restart after updating itself with only about 20MB left to go, so I've had to restart the download today. I feel as if this whole process is cursed! I have to drive to Liverpool now, so I'll post later when I've had a chance to see if this has made any difference.

NHibernate 2.0 is Finally Released

I've just read on Ayende's blog that the final release of NHibernate 2.0 is now available. I've just got the latest release and TortoiseSVN just finished getting me the latest code now.

That's my bank holiday sorted!

Thursday 21 August 2008

Simian - A Copy and Paste Code Hunter Killer!

In my new(ish) job I have to look after a legacy application with a very large code base. Over the years this has been developed with a lot of copy and paste coding practices. This is a significant contributor to our 'technical debt' and certainly increases the costs of ownership associated with the application, adversely affecting troubleshooting, maintenance, and new feature development.

I have already been making good use of NDepend and Resharper to assist with refactoring, and still have hopes that we will invest in Ants Profiler, but I was missing a tool that would nicely identify for me where copy and paste coding might have occurred. After a little Googling I discovered Simian.

This great little command prompt utility will analyse a Visual Studio solution and spot instances of the same code existing in multiple places. It was really simple to integrate in to the Visual Studio IDE and will make a big difference to my team going forward. Now when working on a piece of code we can quickly check to see if it exists else where and refactor accordingly. This new visibility is going to be invaluable as we move forward and attempt to bit by bit pay back the technical debt.

I found a great blog post by a chap from Conchango that showed how to integrate it with Visual Studio, but in the end I mainly just used the, plenty good enough, documentation that ships with it.

The line that I am currently using to have this tool scan my solution is:

-formatter=vs:c:\temp\buks_simian.log -language=cs $(ProjectDir)/../**/*.cs $(ProjectDir)/../**/*.aspx $(ProjectDir)/../**/*.js

What this does is:

-formatter=vs:c:\temp\buks_simian.log (specify that the output should be dumped to a file on my C drive and formatted for Visual Studio)

-language=cs $(ProjectDir)/../**/*.cs (specify that the all the files that are children of the parents of my current project directory should be searched (this is recursive thanks to the /**/))

$(ProjectDir)/../**/*.aspx $(ProjectDir)/../**/*.js (like above but also look at the aspx and js files too).

The reason why I am starting from the ProjectDirectory and then going up a level before initiating a recursive scan, rather than just using the Solution directory is that my Solution files live outside of the structure of the projects, ensuring that they don't end up source controlled.

Wednesday 6 August 2008

SQL Server 2008 is RTM!

So SQL Server 2008 has finally made it to RTM. I can't wait to get it installed and to start seeing how the features look now, and how the performance compares. They're available now on MSDN and TechNet.

SQL Server 2008 versions available for download.

So there they are, although I don't seem to be able to download the Developer version yet.

Expect blog posts on this before long...