Sunday, April 26, 2009

Sugar OS Neighbourhood (F1 key):
2 VirtualBoxes running Sugar on the Same Network appear as one to jabber.sugarlabs.org


As I plan to plan to play with Squeak interface to Sugar / OLPC Low Level Activity API , which includes things like Journal interface (Datastor API), Security, and Sharing (Presence API), I wanted to first test how it works with existing Sugar Activities.

I should have really started with the Journal Datastore stuff, as it does not require sharing to be setup. But sharing is the more exciting part, that I have been avoiding since I only have one OLPC, and failed to setup sharing under virtualization in the past. But now, with Sugar on a Stick and mainly Sugar in VirtualBox, it is easy to have two or more virtual OLPC's at home, at setup sharing. I did setup Sugar in VirtualBox , and was finally able to play with Presence and Activity sharing between my OLPC and a virtual OLPC running Sugar on Linux (same for Windows or OS X).

Well the long story above brings me to one problem I am having. Running one instance of Sugar on OLPC, and another one in VirtualBox on another system at the same network works fine. What that means is that, on either system, I can go to the Sugar "network neighborhood" (many dots button, or F1), and the systems see each other as they are announced both through jabber.sugarlabs.org . But when I create 2 Virtualboxes on my home network, each running Sugar, only one of them has the neighborhood showing other users at a time. They clearly fight with each other - they must appear as one system to the jabber.sugarlabs.org. If one of the virtual boxes asks for it's neighborhood, it "steals" it from the other which is wiped out. I tried all possibilities VirtualBox 2.2 offers: "NAT Network", "Bridge Network", "Intenal Network", "Host only Network". (Really the only reasonable alternative for what I am doing, is the "NAT Network" or "Bridge Network"). But in all cases both VirtualBox'ed Sugar OSs appear as one to jabber - even on "Bridge Network" where both VirtualBod'ed machines ifconfig shows different IPs.

I know the above is not enough info to figure out the reason, but wanted to document this in case others have the same problem and/or figured it out.

I did not try netstat or other network tools to figure it out as that is usually a recipe for a lost weekend :).

Saturday, April 11, 2009

Script which Creates Live USB from ISO
For OLPC XO or any system
(Fedora script ported to SuSE 11.1)

I wanted to run the Sugarlab's latest Sugar-on-Stick Soas2 on the OLPC using Live USB (Actually SD). There is a utility which uses syslinux to convert ISO to a live USB or SD or CR (or hard disk I guess), and is here: https://fedorahosted.org/liveusb-creator/ , but underlying is really one shell script, writen originally by Jeremy Katz from Red Hat http://people.sugarlabs.org/sdz/livecd-iso-to-disk.sh .

My goal was to convert the script livecd-iso-to-disk.sh to SuSE and it was succesful with a few changes. (Although I ended up with many more changes of cosmetic and refactoring nature).

There were some things that did not work on SuSE, a few I remember - there was a harcoded path to "parted", a hardcoded partition id=1 which did not work for my SD on SuSE (partition id=p1 e.g. /dev/mmcblk0p1). Also I neede later version of syslinux then SuSE version of syslinux, which was missing gptmbr.bin for the Extensible Firmware Interface option.

Also I added lots of comments on top. This script is amazing, it does the whole process of creating Live USB and has tons of options, including format, ability to create "home image" on the USB which is not overwritten with an update, contains the OLPC boot Forth script etc etc. Thanks Red Hat.

The script now runs on SuSE and it is on the below. I would be interested to know if it still runs on Fedora (it should) and other distros (I do not know).

Here is the version with my changes. The most significant "functional" difference is the added last parameter, partition name (which could be "1" for the USB, "p1" for SD but it will depend on the distro).