Sugar is fine and dandy, but its nice to have the option to run something a little less… sweet. Unfortunately, with a 433mhz Geode and 256mb of RAM, its kind of a stretch to run a real desktop environment like Gnome or KDE on an XO, and even XFCE is a bit heavy. Luckily, with low powered UMPCs coming out in abundance, there is a lot of development going on for these kinds of devices. Ubuntu Mobile and Embedded Edition shows a lot of promise, as you get the massive number of packages available for Ubuntu in a distro designed for low power and small screens. So, this is a guide on installing and running Ubuntu Mobile on an SD card on an OLPC XO. Ubuntu Mobile is still very much alpha software and is designed for touchscreens, but it’s generally usable and quite speedy.
This guide is based largely on the following sources. It could be useful to check them if something here doesn’t work:
- OLPC XO
- 1+GB (2 GB or more is much better) SD card or USB thumbdrive
- SD card reader if you’re using an SD, which this guide assumes
- A linux box (besides the XO). This guide assumes Ubuntu 8.04
First, download and install what you need to install Ubuntu on an SD. We’ll be using Qemu and a Hardy Heron netboot image.
sudo apt-get install qemu qemu-launcher qemuctl
Run qemu-launcher. Check “Use CD-ROM,” set Boot Disk to CD-ROM, and in the CD-ROM field open the path to the mini.iso you downloaded earlier. Set Hard disk 0 to the location of your SD card or thumbdrive, which will be something like /dev/sdb or /dev/sdc. If you aren’t sure, after inserting the card or drive, open a terminal and run dmesg. The last few lines will mention some sd* and that’s what you want to use. If it automounted, unmount it before going on. The last thing on this tab of qemu-launcher is to set RAM to 256mb.
In the Networking tab, set Number of networking interface cards to 1, and in Card 0, choose Use the user mode network stack, and set MAC address to the address of the card currently connected. To get it, open a terminal and run ifconfig; the 12 digit hexadecimal number after HWaddr is what you want to copy and paste in.
You can then hit the launch button. You want to type cli at the boot prompt, hit enter, and then just follow the usual instructions on installing Ubuntu. The actual install part is probably going to take a while, so you may want to bake a cake.
When the install is done and it reboots, close the Qemu window. In Qemu Launcher, switch Boot disk to Hard disk 0 and uncheck Use CD-ROM. Then hit launch again, wait for it to finish booting, and log in with the user/pass you created during the install.
You’re going to want accelerated video, so add the following two lines to the end of /etc/apt/sources.list with your favorite text editor and then do a sudo apt-get update.
deb http://layer-acht.org/debian etch olpc xorg
deb-src http://layer-acht.org/debian etch olpc xorg
You need to install sysvinit, video drivers, and ubuntu-mobile. I find it easier to work with GDM than manually messing with xinit, so I install that too. If you have the space, you’ll probably also want to install XFCE, since Ubuntu Mobile is somewhat incomplete for now.
sudo apt-get install sysvinit gdm xserver-xorg-video-amd ubuntu-mobile xfonts-base
You then need an xorg.conf that works for the XO. I modified one from Free Like GNU to use 120 dpi to have more reasonable font sizes.
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
sudo wget https://eclecti.cc/files/2008/03/xorg.conf -O /etc/X11/xorg.conf
To add Hildon, the Ubuntu Mobile desktop, to GDM, edit /usr/bin/start-hildon and comment out the line “export DISPLAY=:1”. Then download the xsession file.
sudo wget https://eclecti.cc/files/2008/03/hildon.desktop -O /usr/share/xsessions/hildon.desktop
You’re done with qemu, so you can close that window and pop out the SD card or thumbdrive. The XO expects the boot partition to be named OLPCRoot though, so you need to plug the thing back in. Ubuntu will detect the partitions and automount, so you’ll want to unmount it and then run the following command, replacing sdb1 with whatever you were using before with a 1 on the end of it.
sudo tune2fs /dev/sdb1 -L OLPCRoot
Then, power on your XO to boot into regular Sugar, and put the SD card into the XO. Then open up Terminal and become root. This could mean typing “su”, “sudo su”, or clicking on the become root icon, depending on your OS version. Then execute the following commands.
cp -ra /boot /media/OLPCRoot/
cp -ra /lib/modules /media/OLPCRoot/lib/
cp -ra /lib/firmware /media/OLPCRoot/lib/
cp -ra /security /media/OLPCRoot/
cp -ra /etc/modprobe.d /media/OLPCRoot/etc/modprobe.d
cp -ra /etc/fstab /media/OLPCRoot/etc/fstab
sudo wget https://eclecti.cc/files/2008/03/olpcsd.fth -O /media/OLPCRoot/boot/olpc.fth
One last thing that I like to do is disable tap to click on the touchpad, since its pretty sensitive. These instructions are from the OLPC News forums. Add the following line to the end of /media/OLPCRoot/etc/modprobe.d/modprobe.d/olpc.conf.dist
options mousedev tap_time=0
Leave the SD card in and reboot. The XO should boot straight into Ubuntu and start GDM. When the login screen comes up, go to Options, and Select Session. Choose Hildon, hit ok, and log in. Enjoy!
35 Replies to “Ubuntu Mobile on an OLPC XO”
Fyoder on the OLPCNews forums found that the installer won’t find any hard drives when using Qemu on Gutsy. The solution, from http://wiki.laptop.org/go/Ubuntu_On_OLPC_XO is to do the following:
Installed with Qemu under osx86-leopard, dd the image to SD card. Did tune2fs -L etc. with Kubuntu. Then did the rest on the XO. Had to upgrade to the Q13 rom to enable SDHC card. Can’t get different OS’s to see 2 partitions on SD card. Also hosed one SD card . Can play divx with mplayer ex. ShrekXmas plays Ok. Bonus. ! Can’t wait for custom kernel and Hildon release.
I’m stuck at qemu. When I “launch”, i get a msg, “qemu: could not open disk image /dev/sdc1”
Try running qemu-launcher as root and/or use /dev/sdc instead of /dev/sdc1.
Ok, launching as root worked perfectly. Now, completing up to shutting down of qemu, i’m stuck on I can’t change the disk volume to OLPCRoot. I get an error msg to the effect of superblock error and file format error.
ubuntu is not auto-mounting the drive nor can i manual mount it.
ok, did a work around (change disk volume earlier than indicated) and completed instructions to the end. Now I have some issues:
1)load up gives me error msg “There was an error loading the theme Human”, “Can’t open file /usr/share/gdm/themes/Human/Human.xml”
2)Mouse pad is not working, keyboard use only
3)After changing session and log in with hildon, get error msg, “No Exec line in the session file: hildon. Running the GNOME failsafe session instead”
Then system just dies.
Thanks for the very understandable howto and files!
I also had the same error with the missing Human theme. I can’t get Gnome to start up either. There is a very long wait (more than 5 min), and then there’s an error related to Network Manager being unable to start up.
There seem to be some errors related to missing GTK files:
/etc/gdm/Xsession: Beginning session setup…
/usr/bin/start-hildon: line 28: /usr/sbin/mas: No such file or directory
/usr/share/themes/mobilebasic/gtk-2.0/gtkrc:2526: file qgn_plat_check_box_selected_disabled.png previously referenced with different border or stretch values. Ignoring the new values.
There are a lot of similar messages. Then there is this one:
(hildon-desktop:1910): Gtk-CRITICAL **: gtk_icon_info_get_filename: assertion ‘icon_info != NULL’ failed
followed by several similar messages.
Trying to log into Gnome’s failsafe mode also fails because it can’t find xterm.
Maybe I’ll just try installing XFCE and see if at least I can get that to work. But I am intrigued with Hildon, and hope you’ll keep refining this howto.
Can someone publish a torrent with the resulting SD card image?
I guess this guide is no longer up to date. I’ll write up a new and maybe more thorough version of it when I get the chance. My XO no longer has Ubuntu Mobile on it, and I’m currently in a country with pretty bad internet access, so it could be a while.
Great Idea! Any way you can seed a torrent for a USB boot image of Ubuntu Mobile for the XO? We linux newbies would be very grateful!
Torrent please 🙂
Surely not from where I am, but when I get home in early August, I’ll at least write a more robust guide.
I could torrent an image or a tarball of the files, but they would quickly go out of date, and you wouldn’t learn anything about how to get things working yourself. Half the fun of starting to use linux is learning something new every day.
I might also post a guide on getting Ubuntu Netbook Remix running on an XO (if it actually would run).
Oh please. Nobody is going to fall for that preachy Linux Zealot crap. If somebody gets this working and seeds a torrent of the image, then ROCK ON for them. Thanks to APT, the image can be updated, so your argument about how it will be out of date is totally and completely moot.
The more people who can use Linux, the better. It’s up to geeks like us to make it available. Not to preach to them about how half the fun of Linux is learning. Bullsh*t. Half the fun of Linux is using Linux. The other half is being productive with it.
And to the person who seeds an image of Ubuntu Mobile for XO, here’s mad props to you.
Hey buddy, instead of (or in addition to) ranting, build the image yourself and torrent it. I have a (very) limited amount of bandwidth here, so I can’t.
Plus, by nature of what the XO is, releasing it as a torrent would only save a few steps. If I released it as an image, people would still have to dd it to an SD card or USB stick, manually expand the filesystem and partition, and copy the /security folder off of their XO. If I released it as compressed files, people would have to format their SD card or USB stick to ext2, extract the files over, and copy the /security folder off of the XO. Neither one is prettier than just installing Ubuntu to the card, and at least by doing the install, you learn about virtualization and how to do an Ubuntu install.
Anyway, I never said I wouldn’t. I would just rather not.
Hi! Thanks for this HOWTO – very clear and helpful.
Could you tell me what OLPC software build you started with? I’m having the same problems as Douglas. They seem to be the result of a floating point exception that occurs when hildon-desktop is run. Everything works fine in a VM before I copy over the files from the OLPC, so I imagine I’m starting from a different build than you did.
Its strange that it would run in VM but crash at hildon-desktop on the XO. I started with build 656 I think.
I’ve been following the instructions here and made a lot of progress but none of the desktop options actually load with menus and proper control panel.
Hildon (Ubuntu Mobile) dies with a complaint that the binary /usr/sbin/mas is missing. There’s a binary at /usr/bin/mas but changing the start-hildon script to point to this just leads to more complicated errors.
GDM only loads with a borderless xterm, and complains that all the theme files are missing (I suppose this stops most of the rest of the desktop from loading).
I’m currently trying xubuntu-desktop to see if that gives better results. I’d really like to run hildon, but I suspect I need to reverse some of your changes, and maybe point to a newer reference repository or something, as the config files and binaries for hildon that I have now are properly busted when you try to run them against Hardy Heron.
thx for the guide. here are a few things ive done:
=removed the vm.mmap…. command from /etc/sysctl.conf (since the kernel is too old to understand it)
=commented out the following lines from /etc/fstab
#devpts /dev/pts devpts gid=5,mode=620 0 0
#tmpfs /dev/shm tmpfs defaults,size=15% 0 0
#proc /proc proc defaults 0 0
#sysfs /sys sysfs defaults 0 0
=removed apparmor from bootup with update-rc.d (read the manpage)
now there are no more errors while booting. i then installed mas-server and linked it to where hildon wants it to be:
sudo aptitude install mas-server
sudo ln -sf /usr/bin/mas /usr/sbin/mas
Hudson still doesnt want to start, can anyone help me getting it to work?
ssn: you don’t want to install mas-server. Really. You want to install mobile-application-service, and then symlink /usr/lib/mobile-application-service/mas to /usr/sbin/mas.
You’ll still be stuck, though. I’m working on it, and will post here if I get it going.
to fix the problem of the missing human theme:
apt-get install feisty-gdm-themes
Everything works, except for some reason it is not recognized as a valid filesystem.
tune2fs 1.40.8 (13-Mar-2008)
tune2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn’t find valid filesystem superblock.
[4056504.348174] sdb: sdb1
[2973414.852216] sd 31:0:0:0: [sdb] Attached SCSI removable disk
[2973414.852316] sd 31:0:0:0: Attached scsi generic sg2 type 0
[2973682.914258] FAT: invalid media value (0x00)
[2973682.914271] VFS: Can’t find a valid FAT filesystem on dev sdb1.
[4056960.767428] VFS: Can’t find an ext2 filesystem on dev sdb1.
Yet despite this, it is able to launch just fine in Qemu. Is there something else I would need to do to the filesystem before running tune2fs?
Also, I should note that before installed anything using Qemu, I had created an ext2 filesystem and was able to mount the disk as such, but after installing things the filesystem is not recognized. I just checked again and qemu is able to load the os on the drive with no problem, but I can’t mount it or run tune2fs on it. fdisk sees the partition, and it is ext2.
I just noticed Jack (above) had the same problem I had at the tune2fs stage. He says he started over and did the tune2fs earlier in the process. I wonder if there is any way to get around having to start over (it took a long time to install Ubuntu using the emulator).
Please note: fsck is the solution to the above problem. But more importantly, don’t just close the emulator! As root, type “shutdown -h now” in Qemu instead of closing the window. This was what I suspected, but I stupidly had just closed the emulator and it caused damage to the filesystem.
Great instructions by the way! I recommend also installing the kqemu kernel module for speed.
I’m still having problems in which something along the way causes damage to the filesystem. It seems like everything worked and then I find out that the disk is crap. Has anyone else had the problem and figured out what causes it and when it happens? In what part of the process is it safe to close the qemu window? Does prematurely closing it cause damage?
Rob, I guess I should have been less vague. Shutting down is always a good idea to prevent filesystem corruption. Also, older versions of Sugar such as that which came with G1G1 XOs have a bug where they will corrupt ext2 and ext3 filesystems on SD cards on suspend. So, update to something newer if its getting corrupt after going into your XO.
I can’t seem to get GDM, Hildon, or anything else to start up either under QEMU or on the OLPC. Everything goes smoothly until then. GDM simply doesn’t launch during boot, it says [OK] when ‘Starting GNOME Display Manager’ during boot, but never actually succeeds in launching.
After logging in to the command line if I try to start GDM manually I get the following error:
gdm: WARNING: GDM file gdm-daemon-config.c: line 2033 (): Cannot run seteuid to 0: Operation not permitted
GDM file gdm-daemon-config.c: line 2033 (): Cannot run seteuid to 0: Operation not permitted
then kicked back to the command line. any ideas?
This is a relatively ancient HOWTO. I’d be surprised if it still functioned. One of these days, I’ll write a new one, but until then, you’re better off just using XFCE or something similar.
I followed all of these steps but when I reboot my olpc it is blocked in ” Loading ramdisk image from /pci/sd@c,1/disk:\boot\olpcrd.img…”.
please can anyone help me?
thanks a lot