Emulating the XO/Quick Start/Linux

From OLPC
Jump to: navigation, search

Fedora

1 - Unpack the image

bzcat olpc-redhat-stream-development-ext3.img.bz2 > laptop.img

2 - Obtain qemu

yum install qemu

3 - Run qemu on the image

qemu -soundhw es1370 -serial `tty` -net user -net nic,model=rtl8139 -hda laptop.img

Please check for the required arguments to qemu as explained on Emulating_the_XO/Quick_Start. At the time of writing, the arguments are as shown above, but this can change/evolve, so please check the Quick Start page for the latest recommended arguments first! Do NOT add the '-kernel-kqemu' argument at this point though, you'll first need to do step 4 before you add that one.

Then see Running for the first time.

4 - (optional, but recommended) Make qemu run faster

If you have an x86 or x86_64 cpu, you can use kqemu to speed up the emulation several 100%.

4 a - Obtain kqemu

On Fedora x86,

Add the ATRpms repository to /etc/yum.repos.d and then "yum install kqemu". It will install kqemu and kmdl-kqemu. On Fedora 7, this "just works" for me. --Gregdek 08:56, 7 November 2007 (EST)

On Fedora x86_64,

as of 2007-05-13, there are no official rpms for kqemu, or the kqemu kernel module, and they are not included in the qemu rpm. atrpms.net has kqemu rpms. Or install from source.
I was successful using kqemu-1.3.0-2.fc6.i386.rpm and kqemu-kmdl-2.6.20-1.2962.fc6-1.3.0-2.fc6.x86_64.rpm from atrpms on fc6. 2962 is the kernel version (eg, ls /boot/). MitchellNCharity 19:40, 1 July 2007 (EDT)
Adding the ATRpms repository and then running "yum install kqemu" should be successful here as well, although I have not tried it. --Gregdek 08:59, 7 November 2007 (EST)

4 b - Run modprobe

sudo /sbin/modprobe kqemu major=0

This will need to be run again if the host computer is rebooted (unless noted above). If you forget, qemu will be slow again (and a one-line error message scroll by when you run qemu).

4 c - Run a qemu variant with the -kernel-kqemu option

On x86,

qemu -kernel-kqemu ...

On x86_64,

qemu-system-x86_64 -kernel-kqemu ...

If you forget and use just qemu instead, things will be slow again. If you get the error message "Could not open '/dev/kqemu' - QEMU acceleration layer not activated", run the emulation as root or by with sudo.

Debian/Ubuntu

1 - Unpack the image

bzcat olpc-redhat-stream-development-ext3.img.bz2 > laptop.img

2 - Obtain qemu

apt-get install qemu

3 - Run qemu on the image

qemu -soundhw es1370 -serial `tty` -net user -net nic,model=rtl8139 -hda laptop.img

Please check for the required arguments to qemu as explained on Emulating_the_XO/Quick_Start. At the time of writing, the arguments are as shown above, but this can change/evolve, so please check the Quick Start page for the latest recommended arguments first! Do NOT add the '-kernel-kqemu' argument at this point though, you'll first need to do step 4 before you add that one.

Then see Running for the first time.

4 - (optional, but recommended) Make qemu run faster

If you have an x86 or x86_64 cpu, you can use kqemu to speed up the emulation several 100%.

4 a - Obtain kqemu

old Ubuntu < 7.04, and Debian(?)

As root, do one of:

apt-get install kqemu-modules-2.6-486    # if you have a 486/original Pentium
apt-get install kqemu-modules-2.6-686    # if you have a later Pentium
apt-get install kqemu-modules-2.6-k7     # if you have a 32-bit AMD Duron/Athlon/AthlonXP

And then

 apt-get install kqemu-common

to add docs and have it auto-load at boot time.

Ubuntu 7.10

Follow the instructions for Ubuntu 7.04

Ubuntu 7.04

In Ubuntu 7.04, you'll have to use module-assistant to compile kqemu.

a) First, run

apt-get install kqemu-common

b) Install the program:

sudo apt-get install module-assistant

c) Download the kernel headers:

sudo module-assistant prepare kqemu

d) Download, compile and install the kqemu module package:

sudo module-assistant auto-install kqemu

e) If you wish to avoid having to modprobe kqemu each time you boot:

Due to an open bug in ubuntu's kqemu-source package, you'll need to do the following as well:

sudo nano /etc/modprobe.d/kqemu

Change the contents to be:

options kqemu major=0

Save the file and exit nano. Then do:

sudo nano /etc/udev/rules.d/60-kqemu.rules

Enter this text into the empty file:

KERNEL=="kqemu", NAME="%k", MODE="0666"

Save the file and exit nano.

f) continue with next step...

4 b - Run modprobe

sudo /sbin/modprobe kqemu major=0

This will need to be run again if the host computer is rebooted (unless noted above). If you forget, qemu will be slow again (and a one-line error message scroll by when you run qemu).

4 c - Run a qemu variant with the -kernel-kqemu option

On x86,

qemu -kernel-kqemu ...

On x86_64,

qemu-system-x86_64 -kernel-kqemu ...

If you forget and use just qemu instead, things will be slow again. If you get the error message "Could not open '/dev/kqemu' - QEMU acceleration layer not activated", run the emulation as root or by with sudo.


FreeBSD

Install qemu from ports:

cd /usr/ports/emulators/qemu && make install clean

or as a package

pkg_add -r qemu

Then load kqemu and aio kernel modules:

kldload kqemu
kldload aio

and launch the image you want:

qemu -hda olpc-stream-development-7-20060609_1600-ext3.img
Should this take the same arguments as the linux qemu invocation? MitchellNCharity 21:18, 23 May 2007 (EDT)


Yellow Dog Linux on PlayStation3

Sugar is able to run on a PS3. It can be run using the qemu emulator. Here are some directions for one way of doing this:

1. Install ydl linux for PS3

2. Log on to ydl as root user

3. Install yum (helps install other linux software)

4. Download qemu

5. Download therepos here

6. Unzip therepos.zip

7. Access yum folder (yum.repos.d)

8. Copy unzipped files to yum.repos.d

9. Follow the linux emulation instructions