Skip to main content

Emulating the latest stable OLPC XO software

Even with XO laptops readily available now there are quite a lot of reasons why one would want to emulate it on another machine. One being to hook up a projector. Unfortunately there are quite a number of hoops (*) one has to jump through to make it work.

Anyway, I made a virtual machine that allows me to emulate the XO in VMWare on my Mac, running Sugar in the XO's native 1200x900 resolution, scaled down to a nice physical size in a window on my regular screen (fullscreen works, too). Sound works (even Tam Tam), Browse works (so networking is good), and after setting a working Jabber server I do see other XOs in the neighborhood view (Chat worked fine). Camera and mic are half working (Measure crashes, Record shows blank picture, but reportedly does record video), and a "Sugar restart" does not actually restart Sugar, but apart from that it seems fully functional, and much nicer than the emulations I had used to date.

Click to see actual screenshots (calibrated to match the XO's physical extent using the Ruler activity on my MBP's 110 ppi screen):



And here you can get that virtual machine (665 MB, 2 GB unzipped): VMWare-8.2-767-bf.zip

I made this using VMWare Fusion, which I found to be much better at running Linux clients than Parallels Desktop (I had been using that for 2 years). Give it a try, it's free as in beer for 30 days. No, I don't get paid if you buy it.

Update: Reportedly it does work in VMWare Player on Windows and Linux, too (see comments). And maybe someone can make an appliance for even easier use?

(*) Now to the hoops:
  • I started with the 767/ext3 image from http://download.laptop.org/xo-1/os/official/
  • extended to 2 GB by appending /dev/zero
    (jffs2 compression gives roughly 2 GB too)
  • enlarged the partition to full 2 GB
    (using fdisk and ext2resize)
  • mounted that in a Fedora 10 virtual machine
  • copied over the F10 kernel, initrd, and modules
    (olpc kernel wanted AMD instructions)
  • edited grub.conf to use that kernel
  • and appended a root=/dev/sda1 kernel arg
    (the fedora kernel wants to use LVM otherwise)
  • unmounted
  • created new virtual machine
    (that disk, 1 CPU, 256 MB RAM, NAT networking)
  • booted into that new system
  • installed Perl
    (for vmware tools installer)
  • installed vmware tools
    (to get the X driver)
    (but none of the kernel modules, would need make/gcc/etc.)
  • deleted Perl
    (to restore the default sw environment)
  • copied the existing xorg-vmware.conf to xorg.conf
    (to get 1200x900 resolution w/ 200 dpi)
  • booted into Sugar
    (looks really nice so scaled down)
  • installed activities
    (took a long time, maybe it's my DSL)
  • tested a bit
  • rm -r ~olpc/.sugar
    (to remove my personal data)
  • should have deleted sshd host keys, too, but didn't
  • shut down
  • zip
  • upload
  • ...
  • ...
  • ...
  • still no profit? ;)
Enjoy.

Comments

Anonymous said…
Thanks for sharing this.

It runs perfectly in VMware Player on Windows. Simply download, unzip, double-click the .vmx file

Cheers,
Andy Tween
Vanessa said…
Thanks Andy, I've updated the post.
Anonymous said…
Thanks a lot Dr. Freudenberg.

Great work.
Anonymous said…
Hey Andy,

Were you able to get screen resizing working in VMWare on Windows?

Thanks,
Brian Jordan
Anonymous said…
How do i resize it in Windows?thx
Vanessa said…
Apparently, the window scaling/resizing only works on the Mac.
In other news, this image has been confirmed to work in VMWare Server and Player for Linux (see Emulating the XO).
Miles Berry said…
Many thanks for creating this; glad to be able to try Sugar out properly at last.
Abel Cheung said…
The problem that Sugar fail to shutdown or restart can be circumvented. While it looks stuck in console mode after clicking shutdown/restart, press Ctrl-Alt-F2 at that time and shutdown sequence would go on normally. Don't know why. :)

Besides, another confirmation that your VM works fine with VMware server 2.0 on Windows.
Davide Zerrilli said…
Hi Dr. Bert I'm an italian student.
Thanks for your work.
I have one question:
In this days I'm testing your image on my two laptop with VMware Player. The image works fine and with my WiFi Router setted to an open network without protection I see each laptop.
With one laptop I can invite a second to an activity, but the condivision of the activity don't works, do you know why?
Vanessa said…
Davide, it should work. Please ask for help on IRC or the forums.
Kashi said…
Bert! Bert! Could you do it again for the 802 XO-1 OS release pretty please? I'm trying to use your 767 image on VMware Fusion 3.01, but it isn't too happy, it's telling me that the VMware tools are out of date so it won't have anything to do with the network. I wouldn't know how to go about installing perl etc. and it would be pretty much going back to the beginning anyway, so it seems to make more sense to just start again with the 802 release...
Vanessa said…
Kashi, I don't think I will have time to do this again for 802. If you want to run Sugar on a non-XO machine, you should use Sugar on a Stick. You can get help on the Sugar mailing list.
HuskyDev said…
Thanks a lot for posting these instructions and making your image available. It definitely would be great to have this for 802. Maybe I'll take a stab at it and upload the result if I'm successful.

Did you ever try using the directions on the OLPC wiki? (http://wiki.laptop.org/go/VMware/Convert)
Vanessa said…
HuskyDev, I did not try those instructions but they do look reasonable - provided that the kernel does work in VMWare (old ones did not). Also, they don't install the VMWare tools so you won't get the 1200x900 resolution (which may be fine depending on your intentions).
HuskyDev said…
Yep, the BIOS can't find the OS on the vmdk virtual disk that I made from the 802 image. So why did you use the FC10 kernel? Did you just need a newer one than what came on the OLPC image? Feel free to email me if you get a spare moment: slipstick86(at)gmail.com. Thanks!

Popular posts from this blog

Frontend-only Multi-Player. Unlimited Bandwidth. Or: What is Croquet.io, really?

A multi-player web app needs a backend, right? What if I told you, it doesn’t? Read on for how Croquet gets rid of servers. No, really . Instantaneous Shared Experiences  is how we describe Croquet on our website. And while that excellently describes What Croquet does, as Croquet's Chief Architect, I wanted to share a bit about How we do that. So I wrote a Twitter thread . Here it is in blog form, slightly extended. Click the animation above if it does not play automatically Croquet lets you build completely client-side multi-user web apps. Read that again. Client-side. Multi-user. No I’m not kidding. I built it, I know it works. 😁  Croquet apps run completely client-side: can be hosted as a static web site no server-side code needed no networking code needed  Croquet is literally virtualizing the server: Instead of running code on a server (or in a serverless function) we run it as a virtual machine (VM) on each client.  Croquet carefully controls the inputs to these identi

Deconstructing Floats: frexp() and ldexp() in JavaScript

While working on my  SqueakJS VM, it became necessary to deconstruct floating point numbers into their mantissa and exponent parts, and assembling them again. Peeking into the C sources of the regular VM, I saw they use the  frexp ()   and ldexp () functions found in the standard C math library. Unfortunately, JavaScript does not provide these two functions. But surely there must have been someone who needed these before me, right? Sure enough, a Google search came up with a few implementations. However, an hour later I was convinced none of them actually are fully equivalent to the C functions. They were imprecise, that is, deconstructing a float using frexp() and reconstructing it with ldexp() did not result in the original value. But that is the basic use case: for all float values, if [ mantissa , exponent ] = frexp (value) then value = ldexp ( mantissa , exponent ) even if the value is subnormal . None of the implementations (even the complex ones) really worked. I

Emulating Smalltalk-76

If you got as excited as me about Dan Ingalls' live Smalltalk-76 demo on an actual 1970's Xerox Alto, you may have wanted to try it yourself.  For one, you could try my Smalltalk-78 VM. Smalltalk-78 is a leaner version of Smalltalk-76 but very much identical in syntax semantics.  It is also possible to run the full Smalltalk-76 environment, and here is how: First, you need an emulator for the Alto computer. Ken Shiriff posted a nice piece on how to run ContrAlto on Windows . It is written in C# and I got it to work on my Mac using Mono. So here's a step-by-step: Install Mono from  http://www.mono-project.com/download/ Download ContrAlto-mono.zip from https://github.com/livingcomputermuseum/ContrAlto/releases Download this Smalltalk-76 disk image: http://www.bitsavers.org/bits/Xerox/Alto/disk_images/chm/xmsmall.zip Unzip both  ContrAlto-mono.zip  and  xmsmall.zip  in the same folder. In a terminal, change to the ContrAlto directory and run mono Contralto.exe .