xo-qemu is a script for downloading, managing, and running OLPC QEMU disk images on linux. The One Laptop Per Child (OLPC) project creates a linux distribution for their laptop. It is released as numbered builds (ie, "versions"), in several streams (eg, separate streams for developers and end users). These builds are available in several forms, one of which is a disk image that can be run on the QEMU virtual machine. This script makes it easier to obtain, manage, alter, and run these disk images on linux. It provides virtual, emulated, slightly broken OLPC XO laptops. --help Shows this help. --new-user Checks that qemu and kqemu are working, and suggests how to get started. --report Summarizes the currently available streams and builds. (The report format is likely to change). --get-build STREAM BUILD DIRECTORY Downloads STREAM's BUILD disk image into DIRECTORY. The build's devel_ext3/ .img.bz2 disk image is used. If there is already a copy of the image in DIRECTORY, it is not downloaded again. The filename of the image in DIRECTORY is printed. BUILD can be "latest" instead of a number. Example: $ xo-qemu --get-build joyride latest builds/ builds/olpc-redhat-stream-joyride-build-1418-20071213_1608-devel_ext3.img.bz2 $ xo-qemu --get-build joyride 1418 builds/ builds/olpc-redhat-stream-joyride-build-1418-20071213_1608-devel_ext3.img.bz2 --make-laptop LAPTOP DISK_IMAGE Creates a new laptop named LAPTOP, from a build DISK_IMAGE. A new directory named LAPTOP is created, and must not already exist. The DISK_IMAGE is copied into it. Each laptop is about 1 GB. As part of setting up the laptop, qemu is automatically run, some configuration done, and then qemu is automatically shut down. No user action is needed. The LAPTOP/xo file is used to control it. Examples: $ xo-qemu --make-laptop laptops/one builds/olpc-redhat-stream-joyride-build-1418-20071213_1608-devel_ext3.img.bz2 $ xo-qemu --make-laptop laptops/one `xo-qemu --get-build joyride latest builds/ |tail -1` And then: $ laptops/one on --xo-api0 LAPTOP ACTION Controls the LAPTOP. This is usually called indirectly using LAPTOP/xo ACTION. Examples: $ laptops/one/xo on $ laptops/one/xo off on off is-running ssh [olpc|root] [COMMAND-LINE] scp [SCP_ARGS] FROM TO Copies FROM to TO, where both are either a local path, or [olpc|root]:path/on/the/laptop. env Prints "LAPTOP=xxx DISPLAY=xxx XAUTHORITY=xxx". These environment variables let you run X windows programs on the laptop's X server, from the host. This is mostly used for automated testing. Examples: $ bash # start up a new shell, since we're about to modifiy it $ export `laptops/one/xo env` $ xterm # somewhat useless, but illustrates the concept. $ import screenshot_of_laptop.png do COMMAND [ARGS] Sets up the same environment variables as /xo env, and then runs COMMAND. If and environment variable XO_QEMU_DO_PATH is defined, it is used instead of PATH to find COMMAND. Examples: $ laptops/one/xo do xterm $ laptops/one/xo do sh -c 'echo $DISPLAY' xephyr on|off Switches between using the laptop's normal X server, and using an external Xephyr X server. The real OLPC laptop hardware has a 1200x900 display, Until qemu supports having a 1200x900 display (the release after 0.9.0), Xephyr can be used when one is needed. Example: $ laptops/one/xo on $ laptops/one/xo xephyr on sugar restart Restarts sugar. This is needed after some configuration changes. mount [WHAT WHERE USER] | -u [WHERE] mount [WHAT WHERE USER] Mounts laptop directory WHAT on host directory WHERE, with the host user mapped to laptop USER olpc or root. If no arguments are given, / is mounted on LAPTOP/root with the user as root, and /home/olpc is mounted on LAPTOP/olpc with the user as olpc. mount -u WHERE Unmounts whatever is mounted on WHERE. Equivalent to "fusermount -u WHERE". If no WHERE is given, then LAPTOP/root and LAPTOP/olpc are unmounted. "/xo off" unmounts everything mounted. Example: $ laptops/one/xo on $ laptops/one/xo mount $ ls laptops/one/root activities bin boot dev... $ ls -a laptops/one/olpc .AbiSuite .bash_history ... .sugar ... $ laptops/one/xo mount -u --enlarge-disk-image IMAGE SIZE_MB Enlarges the LAPTOP's disk to MB megabytes. The laptop's disk is normally 1000 MB, with only 1/3 used. But when doing development, and installing lots of things like gcc, it sometimes helps to make it bigger.