Thursday February 19, 2009 Starting With Solaris From A Linux Point of View
A few weeks ago, Arun wrote in his blog about how to install OpenSolaris on Virtual Box. Let me add some OpenSolaris usage tips that I collected over time (so if I forget them, I can go back to my blog). ;) They are intended for users who already have prior experience with Linux and the command line in general.
When I say "Solaris" below, I mean OpenSolaris 2008.11, here is how to upgrade from OpenSolaris 2008.05 to 2008.11.*
The Linux top command displays the list of running processes. On Solaris this command is called prstat.
If you're looking for one particular process (e.g. firefox), use pgrep -l firefox; if looking for processes by one user (joe), use pgrep -l -u joe. If looking for both, combine them to a quick pgrep -lu joe firefox.
Solaris has no sudo command like Linux's "substitute user do" to execute one-off commands with admin permissions. On Solaris, use su to 'assume the identity' of another local user, including the root user, if you know the password. In contrast to sudo, you're responsible for exiting back to your own identity. So, before changing config files, type su - to become root. Including the dash argument will also update your shell environment (most visibly, the commandline prompt will say 'root' so you can actually tell which of your shells is the root shell).
You install a .pkg file with the pkgadd -d name command (usually as the superuser).
One tip (luckily) not from personal experience: On Linux, you kill an amock running process by killing its process ID (pid); if the Linux user doesn't want to look up the pid(s), she can use killall name to kill all processes with that name: Basically a handy shorthand for grepping the process list and killing them individually.
On Solaris, this "kill by name" command is called pkill. The Solaris killall command however, well, kills all processes, period. You might as well shutdown and discard all unsaved changes...! You have been warned. :-p
If you "insert a DVD" (using Virtual Box's ability to mount disks from the host drive, or ISO images) it will show up under /media/CDROM. I haven't tried USB media yet (probably not supported?)
You can get an overview of devices and drivers (disk drives, mice, network and graphic cards) from the main menu: System > About OpenSolaris > Devices. E.g. my network card driver is e1000g, so I know in the file system, my first network interface will be represented as /dev/e1000g0 (see "ipconfig" tip below).
I don't suggest to mess around with device tables, it's just good to know files like /etc/mnttab and /etc/vfstab in case you want to look up a device path for another config file. (Strangely I don't see my hard drive's /dev path though, is that because it's virtual...?)
If your audio (e.g. on a MacBook, Core Audio + ICH driver) doesn't work, get drivers from Open Sound.
The shared folders feature is not available for the Mac/Solaris host/guest combo. I use the network (ftp, scp, or simply mail) to get files out or in of the VirtualBox.
Another way to get files from the Mac Finder to Solaris: Put the files in a folder, use the Apple Disk Utility to create a disk image (.dmg) from the folder, use the same utility to convert the .dmg to a DVD master image (.cdr), rename .cdr to .iso, then use VirtualBox's Virtual Media Manager menu mount the disk image as a Solaris medium, and access it from the /media directory. Phew... If you know an easier way, please leave a comment. =-)
If Solaris does not seem to use the network interface, check whether Virtual Box is set to use the "host interface" (for me the setting defaulted to NAT).
Solaris uses the nwamd demon to auto-detect and use DHCP on your network, and it even detects wireless networks, very useful. There is a Network control panel, but if you're just a user running Solaris on a notebook or PC, look for other sources of the problem before you fiddle with nwamd:
Use the command ifconfig -a to see whether the DHCP server assigned you an IP address. (Hint: Look up the name in the device list (see above), e.g. e1000g0. The IP address stands next to the word 'inet'. LOOPBACK and 127.0.0.1 don't count!) If not, check the cables and whether other PCs can access the same DHCP network.
If you do have an IP address but still cannot open any web pages, test whether you can browse to a web page by its IP address: Use the host command on another machine to obtain a test address. (E.g. typing host www.sun.com returns 72.5.124.61.) If the browser is able to open the web page by its IP address (e.g. http://72.5.124.61) then you know you are online - but your name servers are not configured!
In this case, open the file /etc/resolve.conf and add entries for name servers. (You need to be the superuser to edit the file, see su above.) Copy the name servers' IP addresses from another machine (I got them from the Mac's Network System Preferences), or ask your admins.
More about using and configuring Solaris, for example installing it on a Virtual Box and more info on nwamd.
Read the OpenSolaris Observatory blog to stay up-to-date.
*) This method seems to have worked for many, it trashed my VirtualBox though. If you want to save time and already have an OpenSolaris 2008.11 DVD, use that, upgrading is not faster than a fresh install.
Posted by seapegasus ( Feb 19 2009, 05:28:02 PM CET ) Permalink Comments [3]Figuring Out Battlestar Galactica
(... ... ... Spoiler warning, don't read if you haven't watched at least s04e13... ... ...)
I was thinking about the scene were the four Cylons reminisce about their past. Anders says something like "I used to play this song for a girl I loved" and Tory says "You played it for all of us".
So either Anders just had a whole lot of girlfriends. Or...
He was the Cylon Bob Dylon!
Let's follow this line of thought through: First add resurection technology to the picture (assuming the 13th tribe had it). And second, doesn't hearing the words "Cylon Dylon" make you wonder what became of Aylon and Bylon...? If you combine all of that, what do you get?
Yes. Samuel Anders was a Cylon boygroup!
(I think that was about when I woke up. But it all made sense for a moment!!!1!!1!)
Posted by seapegasus ( Feb 08 2009, 01:30:28 PM CET ) Permalink Comments [1]NetBeans in Wonderland (Part 2)
In part one, I talked about what project Wonderland is and where you can try out a live demo of version 0.4. Much like SecondLife, Wonderland is a 3D world with avatars and audio/text chat. But unlike SecondLife, Wonderland is open-source and more business-oriented, for instance there's live application sharing. You can use it to collaborate on projects with your team of developers in a private 3D world.
Part two is about how to set up your own Wonderland server and client. I will share an instance of NetBeans in this example, but of course you can share any Xwindows application, including the Terminal.
Prerequisites: Solaris/Linux
Windows and Mac versions of the Wonderland 0.4 server don't seem to be available yet, so presently Solaris or Linux are a prerequisite. Note that Wonderland clients (including a webstartable one) are available for all operating systems. In this example I use OpenSolaris, and the instructions should be identical for Linux.
Prerequisites: Java
Before running Wonderland, make sure you have JDK 6 installed. (Use the terminal commands javac -version to check). If you don't have javac, install the JDK 6. On Solaris, go to the main menu, choose System > Administration > Package Manager, and install the java-dev package from the Development category.
Prerequisites: Installing the Shared Application
Obviously the application that you want to share must be correctly installed and on your PATH. In this example I downloaded and installed NetBeans. Check whether NetBeans is in your PATH by typing which netbeans at a fresh Terminal prompt. If the command returns empty, you need to add NetBeans to your PATH before proceeding. Find out where the NetBeans binaries were installed -- in my system, it's in the /opt/netbeans-6.5/bin/ directory. Remember this path and add it to your config file (I use the bash shell, so for me the file is .bashrc).
ruth@sonnig:~$ gedit ~/.bashrc
Add your netbeans binary path in the following way and save the file.
export PATH=$PATH:/opt/netbeans-6.5/bin/
Reload the .bashrc configuration (in every open Terminal window).
ruth@sonnig:~$ source .bashrc
Test whether NetBeans was successfully included in your PATH.
ruth@sonnig:~$ which netbeans /opt/netbeans-6.5/bin/netbeans
Installing Wonderland
Now it's time to install Wonderland. Go to lg3d-wonderland.dev.java.net and download the binary build (for example wonderland-0-4-0-solaris-i86pc.zip), and extract the archive.
ruth@sonnig:~$ unzip wonderland-0-4-0-solaris-i86pc.zip
Change into the wonderland directory and edit the settings.
ruth@sonnig:~$ cd lg3d-wonderland/bin/ ruth@sonnig:~$ gedit ../my.run.properties
Modify the following lines to include your host name and IP address, and save the file. (You will have to redo that if you use DHCP and are assigned a new IP address.)
wonderland.local.hostAddress=123.454.32.1 sgs.server=sonnig sgs.port=1139
Starting the Wonderland Server
OK, you're all set! Now it's time to start the server. According to the instructions, you run the binaries as follows:
ruth@sonnig:~$ ./wonderland-bridge.sh ruth@sonnig:~$ ./wonderland-server.sh ruth@sonnig:~$ ./wonderland-smc.sh
Starting the Wonderland Client
Finally, start a Wonderland client and connect to your server. The client can run on any operating system, on the same host or on a different one, webstart or desktop app, it's up to you. The only requirement is that the host must support 3D graphics. (Since my OpenSolaris runs in a virtual machine and VirtualBox cannot handle 3D graphics, I use the Mac client.) When the login dialog appears, enter the IP address that you specified above, pick any username, and connect.
Welcome to your very own Wonderland. :-) You walk around using the arrow keys. Select Netbeans from the Shared Apps submenu and find the window floating in the room. Gain/release control of an application by Shift-Left_clicking the window title. Tip: I don't know what Solaris thinks ctrl-space is, but it didn't trigger code-completion; so I'm using ctrl-\ instead.

A shared application (here NetBeans) in 3rd-person view and in Best View (Shift-Right_click)
Now it's time to invite some friends over: Ask them to webstart the client, give them the Wonderland server's IP address, and have a little chat around the campfi-- um, around the IDE. Hmm. Around the IDE...? Well, it is a 3D world... What if I walk around the IDE and look at it from behind?

Behold. The far side of NetBeans! :D
The next step is to load custom 3D models (more documentation is here). But I'll wait until I migrated my stuff to a Linux machine -- VirtualBox is nice, but seeing that it takes up way over 50% of my RAM gives me fits of claustropobia. ;)
Posted by seapegasus ( Feb 05 2009, 04:33:39 PM CET ) Permalink Comments [4]NetBeans in Wonderland (Part 1)
Getting to Know Wonderland - Cybertech news reviewed Sun's Wonderland: A free open-source toolkit for building virtual 3D worlds in pure Java. Access a public Wonderland server or set up your own as a meeting point for your distributed team. Wonderland is based on Project Darkstar, a multi-user 3D world server.
Accessing the Wonderland Demo - To see for yourself, go to the education grid and click Enter the Grid, then click Sun Microsystems.
The browser opens a Java Web Start (JNLP) file. When the Java plugin asks about signatures, click Run (or Trust respectively) to continue. Your browser then downloads the Wonderland application to your desktop. (In my case the app detected an outdated Java3D installation, and gave me instructions how to remove them. I then double clicked the Wonderland app to continue.)
At the login dialog, type in any name (the demo does not require any registration), and create an avatar. The avatar is way less detailed than the ones in SecondLife, basically just hair and cloths colors.

Navigating in Wonderland - Note the View menu (1st/3rd/orbit view) and Placemarks (quick navigation). Walk and turn with the arrow keys, sidestep with Z/X, fly by pressing Q. Also try pressing numbers to trigger gestures like nodding and waving. Keep the right mouse button pressed to look up, down, left and right. The middle mouse button controls the right arm, and you use it to point at things. Walk around a bit and don't miss reading the crazy posters in the conference room!
Listening to Wonderland - The main means of communication in Wonderland is audio chat, but there is also a text chat interface. Invite a friend to webstart the client and log on simultaneously, and have a chat with him. A cool feature that you will immediately notice is 3D audio: Approach talking avatars, and their volume increases, and sounds from further away fade out. In case nobody is "home", the demo includes a couple of bots who talk about nothing but Darkstars and Blackboxes all day. :-)
The freely available Wonderland server supports interactive objects such as microphone stands (for room-wide announcements), telephones (think Skype), a cone of silence (for private conversations), and answering machines (to record and play audio). People who call into the world by phone are represented by floating spheres. Since a caller cannot navigate the 3D world (they wouldn't see where they are going), avatars in-world can help out by carrying the caller's sphere to another room, or by placing them in the Cone of Silence or in front of microphones. Pretty neat stuff. :-)

Sharing Applications - Wonderland allows you to share Xwindows applications from your desktop with other avatars. Log on to the public demo, walk around in the Demo Room, and try out the red-framed windows -- e.g. there's a whiteboard for drawing and a photo browser. Shift-left_click the frame to gain control over the application, then shift-right_click to move the camera to an optimal position. All keyboard input will now be sent to the shared application. Shift-left_click the frame again to release the application, and press escape or C to reset the camera position. Live application sharing, now that's something that Second Life doesn't have, eh? :)
Sharing NetBeans? - Why am I posting this in the NetBeans category? Can I stick my instance of the IDE to a wall in the 3D world, and my colleagues' avatars can use it as if they were standing right next to me?
Yes! Note however, although there is a NetBeans menu item in this demo, it is not active. Bummer. Those heartless people run the Wonderland server on a machine with no NetBeans installed! :-/ But setting up a local instance of the Wonderland server is easy, and if I run the server on Solaris or Linux, I can share apps such as NetBeans myself... Hm...
What will NetBeans be like in 3D? Will I be able to do code completion and window undocking? And will I be able to see NetBeans from behind? :-o Read part two of this blog entry to find out!
