the lazy cheater’s guide to solaris
October 14th, 2008Yes, it’s true. I haven’t blogged for a LONG time. Sometimes I find blogging to be a harmless way to vent my annoyances, and I guess I haven’t been all that annoyed lately.
Well this week I started using Solaris.
We are getting set to test LINA on some new platforms - branching out into other ‘nix’s, starting with BSD and Solaris. So I’m setting up test machines, and I’m thinking it’s all UNIX, right? I mean, how hard can it be?
To digress a little… This blog is addressed to a very small audience. As far as I can tell, lazy cheaters simply don’t use Solaris, unless, like me, they find themselves thrown together with it through some cruel twist of fate. If that is the case for you, you may find the following tips useful, if you’re running OpenSolaris 2008.05 anyway.
Installing OpenSolaris is actually quite pleasant, a huge step forward in usability from a Solaris 9 install I did a couple years back. A few nice click-throughs and it’s up, with a pretty Gnome interface and everything. I’m amazed. I begin to wonder if Solaris could possibly have become a lovely GUI-guided experience with plenty of back-patting and hand-holding. Would I be forced to retract all the snarky comments I’ve made lately about the non-usability that seems to permeate all things Sun?
So I go to set up the network.
Exploring the drop-down menus I find System-Administration-Network. Cool! I click on it, and it gives me this:

Okey dokey. I like the handy link, especially useful because the whole point is that networking is actually NOTworking. So I guess I need to figure out what NWAM is, or at least how to disable it. This brings us to our first lesson:
-
Starting and stopping services
Yes, there is a menu item called “Services” under System-Administration. Unfortunately, it does not appear to offer a complete list of services. I could find nothing that might be our friend NWAM. So the next stop is /etc/init.d. This directory is oddly vacant, save for some legacy scraps, and luckily a README file. This is the first breadcrumb on the trail. And this is the where the trail leads, in a nutshell.
To see all services and their status, type:
svcs -a
Aha! There’s nwam, as svc:/network/physical:nwam. So how do we temporarily disable it,whatever it is, just until the next boot? Simple. Just type:
svcadm disable -t network/physical:nwam
And there you have it!
Now, going back to System/Administration/Network, we get:

Sweet! A few clicks and I have the network up and running in DHCP mode.
And then I go to test it. I type ‘ping openlina.com‘ at the command line. And I get: ‘ping: unknown host openlina.com‘. Drat! -
Oh, you wanted DNS with that network?
As a first shot at debugging, I try ‘ping 209.85.26.3‘. Success! So it’s just not resolving domain names. I guess that kind of thing is considered a bonus in Solaris land. What, don’t you know the IP address? You must be a lazy cheater.
Why, yes I am. So I figured out how to make DNS work, as a service to my fellow sloths:- As root, edit the file /etc/nsswitch.conf
- Change the line that says ‘hosts: files‘ to ‘hosts: files dns‘
And there you have it. No need to even restart the network. See how friendly Solaris is!
-
Installing packages
So by now you may have noticed that the only available console text editor is vi. If you’re a lazy cheater like me, you may find this unacceptable. So you open the package manager by going to System/Administration/Package Manager and hunt around a little. The only available text editor is something called SUNW-gnome-text-editor, which turns out to be gedit. Yuck. What if you want something simple and friendly, like nano? Are more repositories available?
The answer lies at sunfreeware.com. Clearly by and for geeks, this website is nonetheless home to all manner of interesting and useful little Solaris apps. To find the right ones, just choose your Solaris version and hardware from the list on the right. So can this repository be added to the Package Manager? I couldn’t find a way to do this, but perhaps someone with a longer attention span could. Luckily, it turns out that installing packages by hand is not quite rocket science, once you know how. This is how it’s done:- Select the package you want from the download page for your system. The relevant page for Solaris10 on Intel is www.sunfreeware.com/indexintel10.html. Warning - do NOT try to make sense of this page. Simply observe that there is a list of applications at the right. Choose one, say nano-2.09, and click on it.
- Now click on the link that appears at the top of the page and download the corresponding gzipped package file to your desktop. In the case of nano, the file is nano-2.0.9-sol10-x86-local.gz.
- Open a terminal and go to your desktop by typing “cd /export/home/username/Desktop“.
- Uncompress the package by typing “gunzip nano-2.0.9-sol10-x86-local.gz“
- Install by changing to root (”su”) and typing “pkgadd -d nano-2.0.9-sol10-x86-local“.
- Now type “nano” at the command line and note that you get the response “bash: nano: command not found“. This is because the default sunfreeware install location is /usr/local/bin, and this is not on your path.
- Remedy this by editing the file /export/home/username/.bashrc. Add ‘:/usr/local/bin‘ to the end of the line that starts with ‘export PATH‘. After you do this close your terminal window and open a new one in order to set the new path.
- Now type “nano” at the command line and note that you will get a response complaining about the fact that ncurses is not installed. Remedy this by downloading and installing ncurses-5.6 from sunfreeware.com, as above.
- Now, type “nano” at the command line, and it will work!
See, Solaris is not that bad!




