Adventures with OpenSolaris

So… some colleagues have been experimenting with DTrace a bit, and I’ve been (for a while now) wanting to experiment with it.

The challenge now, instead of in the past, is that I’m setting up a Solaris based system – not getting one premade.

I chose OpenSolaris as I’d previously tried Solaris 10 and just sunk too much time trying to get updates and a development environment installed (another colleague could get the opposite to me going: he got devtools but no updates. at least mine was up to date and secure… but without a compiler).

So… OpenSolaris. It isn’t 100% open, there’s binary only drivers and such… but compared to previous Solaris, a whole lot better. Now, if only it was GPL licensed so we could have cross-pollination with Linux.

I grabbed the 2008.05 ISO as soon (in fact, slightly before) it was released and installed it in VirtualBox.

The installation was shiny – one of the best OS installs I’ve seen in a while. It set up nice things (zfs, X) and (an improvement on the previous release) even managed to get all the hardware going (not sound though).

However, on first reboot, nasty surprise. DNS isn’t enabled by default.

I found out why DNS isn’t enabled by default – and (as usual) this comes down to hysterical raisins. Back in what we laughingly call the past, during install Solaris would ask you what services you wanted to use for name resolution (which I guess made sense when people used yp/NIS more often than DNS). The default didn’t include DNS.

In the graphical installer, it just chose the default without asking… which is no DNS. So my mother would be able to install OpenSolaris, but once done, she’d have to know to type in 150.101.98.214 instead of www.google.com.au into Firefox. However, I swallowed my pride, edited /etc/nsswitch.conf and went along my business (I wonder the percentage of users who would actually go from “hrrm, internet not working” to editing /etc/nsswitch.conf without intense googling).

The UI did look nice though. Nice looking GDM, GNOME desktop looked nice. You could tell that whoever did the theme had spent too much time near MacOS X, but I’ll forgive them for that. The default shell is remotely sane and even though the bash completions aren’t as funky as on Ubuntu, I managed (unlike sitting at cmd.exe, where somebody is likely to die each time my keystrokes end up there).

I even had a look at the graphical package management tool – which looked quite nice. I even tried to do an update via it… which ended in what seemed to be a locked package manager and general amounts of fail. To see if it had just stopped or was chewing up my CPU or memory, I opened a terminal and ran ‘top’.

I then found out that top isn’t installed by default. It’s 57kb on my Ubuntu 8.04 laptop so disk space couldn’t be the reason why it’s not installed. It’s certainly not a “it’s a minimal install” argument, there’s lots of other things there by default.

Next step, let’s get updates (some time had elapsed between first install and now).

Seeing as I hadn’t met too much success with the graphical utility (it was at version 0.0000001 or something, so I don’t lay blame there). I find out that ‘pkg image-update’ is what you want to run. So I do.

It chugs for a while and says there’s 1GB of updates. That’s okay, I (where I=Sun) pay for what here on the arse end of the Internet is considered a decent link to my home office. About 20-30minutes later, having downloaded about 600MB, it goes “url timedout error” and aborts. Oh well I think, that’s easy – i’ll run it again and it’ll just resume downloading (remember the revolution when that started working, you know, in 1997).

I then discovered that pkg doesn’t resume downloads. It creates a snapshot using ZFS and puts the updates in it. If anything goes wrong, it just deletes the snapshot. This is a huge benefit over (say) dpkg, which if you press the reset button at the right time will leave your system very, very fucked (magic incantations can revive it, but it’s not fun – and the dpkg developers don’t think it’s a problem – come to my “Eat My Data” talk at OSCON to find out the full story). So OpenSolaris pkg wins on the “don’t ruin my working OS install already” front, but fails on resuming downloads.

I try again. Same story.

It’s now wasted a bit over 1GB of downloads… which equates to a couple of dollars.

I wait a few days, a week, and try again. Same story. I even try with a few hints found online that should fix things (well.. they did let another 100MB on average download before dying with the same story).

I then decided to just try and do the minimal – I wanted a development environment so I could build a MySQL Server with NDB and then play with DTrace to help nut out a performance problem or two.

So i tell pkg to install SunStudio Express. I’m even using instructions off sun.com, so it has to work.

It’s only ~500MB now (IIRC). Fails with exactly the same error as before (url timedout). Gah!

So, this brings us to today. I head into the Sun office.

I figure “this just has to work from a Sun office… ” and I was right!

It got through the (now) 1500MB download of updates!

It even applied them!

Success!

Win!

Well, no, – FAIL.

It now refused to boot with the updates. Or rather, it just rebooted soon after having started booting. No panic, no error screen, no “will reboot in 120 seconds” or anything useful. Instead, you just saw a flicker of the error message before it rebooted.

So… with some very careful pause/unpause of the VM (thanks VirtualBox… I also have a feature request now – pause before reboot :) I got this:

Aparrently the successful update, not so much.

Hrrm… perhaps select the known good one from the GRUB menu? It did actually boot! But this wasn’t just the old kernel, it was the whole older system. I guess that’s a possible upside of ZFS snapshots…. but oh my, that could be sooooo subtle and lead to data loss that it’s really quite dangerous.

I was still no closer to getting an up to date opensolaris system with enough developer tools to build a MySQL Server and use dtrace.

And this was enough. It’s now gone and I get my 10GB of disk back.

Maybe I’ll try again later… but I’m finding the google-perftools to be rather exciting and they’re really satisfying shiny thing urges at the moment.

6 thoughts on “Adventures with OpenSolaris

  1. http://mail.opensolaris.org/pipermail/indiana-discuss/2008-July/007664.html is a useful link to have if you’re interested in updating your set of packages (to track the unstable builds leading up to 2008.11). Unfortunately a few pretty critical bugs showed up in 2008.05 (around package management in general) which is causing a less than pleasing user experience. Will likely have ‘top’ available soon, it’s one of the top failed searches at pkg.opensolaris.org.

    For those wanting to try OpenSolaris, it may well be better to skip 2008.05 (at least until a re-spin ISO is created), and jump to the following –

    Primary Languages, gzip compression, 735 MB
    http://dlc.sun.com/torrents/info/osol-0811-93.iso.torrent
    (if burned to media, image should be burned to a DVD)

    All Languages, LZMA compression, 652 MB
    http://dlc.sun.com/torrents/info/osol-0811-93-global.iso.torrent
    (if burned to media, image can be burned to a CD)

    MD5 checksums for these images
    http://www.opensolaris.org/os/project/indiana/files/md5sums_93.txt

  2. Top not being there is because the solaris equivalent is prstat or some shit. DNS not working is because it defaults to NWAM which does that for you, except it didn’t for you? Possibly because you’re running in a VM. The upgrade dataloss thing is something live upgrade already did, just cleaner (snapshots instead of copying things around). Sol 10 isn’t worth bothering with, the last SXDE might be recent enough for you, if not SXCE will be but has a lot more of Solaris’ sharp edges.

  3. James is right about top… For several weeks pulled top out of blastwave (a repository of free software), but eventually I read about prstat and found it did 90% of what top did, and was more light weight.

    prstat -a is particurlalry cool. Check the man page for more options.

  4. Not having top threw me too… For the first few weeks I used top, which is available from blastwave.org.

    Later on I found some references to prstat, and discovered it was a good replacement:
    – Comes standard with (open)solaris.
    – Is more lightweight than top.

    Try prstat -a, and see the man page for more options.

    Cheers

  5. The next Google patch will include Google perftools with all of the build changes required to link with it on demand. Because of oprofile, I haven’t had to use the CPU profiling that much. tcmalloc and the heap profiler have been a huge help.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.