Using QEMU on Windows: Difference between revisions

From OLPC
Jump to navigation Jump to search
(→‎Troubleshooting: simpler (?) alternative to enable the network)
m (→‎Starting OLPC environment: emphasis and typo)
Line 36: Line 36:
== Starting OLPC environment ==
== Starting OLPC environment ==


Before you launch the emulated image, we '''strongly''' recommend reading through the '''[[Sugar Instructions]]''' on how to use the environment -- this does not look like the Windows or Mac operating systems!
Open a <tt>command prompt</tt> (aka <tt>cmd.exe</tt>) in the QEMU directory.

Open a <tt>command prompt</tt> (aka <tt>cmd.exe</tt>) in the QEMU directory and launch it using the appropriate image.
cd "\Program Files\Qemu"
cd "\Program Files\Qemu"
qemu -L . -hda ''image_name''</tt>
qemu -L . -hda ''image_name''
Where ''image_name'' is the newest version you have downloaded. For example:
Where ''image_name'' is the newest version you have downloaded. For example:
qemu -L . -hda olpc-redhat-stream-development-build-185-20061117_2030-devel_ext3.img
qemu -L . -hda olpc-redhat-stream-development-build-185-20061117_2030-devel_ext3.img
Line 45: Line 47:


Then you will see a typical Linux boot sequence ending in a dialog asking for your nickname.
Then you will see a typical Linux boot sequence ending in a dialog asking for your nickname.

We '''strongly''' recommend reading through the [[Sugar Instructions]] on how to use the emulated laptop -- this does not look like the Windows or Mac operating systems!


As a reminder: pressing <tt>Alt + Ctrl</tt> will liberate / return control to Windows.
As a reminder: pressing <tt>Alt + Ctrl</tt> will liberate / return control to Windows.

Revision as of 22:29, 3 January 2007

The step-by-step guide below has worked for builds 59 and 182, see User Feedback on Images#QEMU on Windows

Setting up QEMU

In order to use the provided OLPC images in your Windows XP box you must first install an emulator: QEMU which is an open-source processor emulator. The accelerator, not required, is recommended as a performance booster.

Note: people have converted some QEMU images to work with VMWare Player, but regular OLPC builds are for QEMU.

QEMU Emulator

  1. Download QEMU for Windows from here
  2. Since there's no installation step, just unzip it into any directory (ie: C:\Program Files\Qemu)
  3. if you want, proceed with the accelerator below, if not go to downloading the image

QEMU Accelerator

The QEMU Accelerator is a driver allowing the QEMU PC emulator to run much faster when emulating a PC on an x86 host. The latest stable is currently kqemu-1.3.0pre9.tar.gz.

  1. Download the QEMU Accelerator Module from here
  2. Unzip the kqemu-version.tar.gz file into a directory (ie: C:\Program Files\Qemu\KQemu-version)
    • may have to unzip it twice given the file format.
  3. In the target directory, locate kqemu.inf and install it (menu/right-click and select Install). Let it finish (it'll take just a couple of seconds).
  4. Open a command prompt (aka cmd.exe) and type
    • net start kqemu
    • If everything went fine, you should see the following message:
      • The KQEMU virtualisation module for QEMU service was started successfully.

Download an OLPC image

Then you need to download a drive image, so go to Latest Stable Build on the OS Images page and navigate to the ext3 subdirectory (this has images for the ext3 filesystem; if you want to use development tools, navigate to devel_ext3). The image you want will be named something like olpc-redhat-stream-development-build-num-date_ext3.img.bz2

After you've downloaded the image, you must unzip it and place the .img file in the same directory as QEMU (ie: C:\Program Files\Qemu).

Starting OLPC environment

Before you launch the emulated image, we strongly recommend reading through the Sugar Instructions on how to use the environment -- this does not look like the Windows or Mac operating systems!

Open a command prompt (aka cmd.exe) in the QEMU directory and launch it using the appropriate image.

cd "\Program Files\Qemu"
qemu -L . -hda image_name

Where image_name is the newest version you have downloaded. For example:

qemu -L . -hda olpc-redhat-stream-development-build-185-20061117_2030-devel_ext3.img

The emulator will start in a new window, and will soon display the OLPC 'XO' logo and 'Booting OLPC for qemu target in nn seconds'. (If it does not, then press any key to go to the GRUB menu and choose the 'OLPC for qemu target' option. You need to boot the emulator, not the OLPC hardware.)

Then you will see a typical Linux boot sequence ending in a dialog asking for your nickname.

As a reminder: pressing Alt + Ctrl will liberate / return control to Windows.

NOTE: There are a some issues (mainly for the first timers) on how to get the whole enchilada going.

Closing the OLPC image

To close the OLPC "window" you must first go into the QEMU monitor screen and then quit. You do that by:

  1. Make sure the the window has the focus (label should say QEMU - Press Ctrl-Alt to exit grab).
  2. Press Alt + Ctrl + 2 to enter the QEMU Monitor.
  3. Type quit or q to quit.

Please update User Feedback on Images#QEMU_on_Windows with your experience.

--Tomhannen 19:30, 13 August 2006 (EDT)

Troubleshooting

Keyboard and Mouse

A typical case (considering many who report it) is that their keyboard and mouse don't work. A solution to the problem is:

  1. Make sure the the window has the focus (label should say QEMU - Press Ctrl-Alt to exit grab).
  2. Press Alt + Ctrl + 3 to enter the terminal mode of the OLPC.
  3. Make sure that you're logged in.
    • If not, just hit enter and it'll ask you to.
    • Login as root (no password is required)
  4. Type modprobe i8042
  5. Press Alt + Ctrl + 1 to return to the graphical mode of the OLPC.
  6. Your keyboard and mouse should be working fine.
    • Usually the result is a continuous series of 1's will flow (as if the key is stuck)
    • Just hit any key (to stop it) and delete the offending 1's

Network

Chances are that the network will not be enabled. Following are two possible ways to enable it.

Enabling the Network Alternative #1

  1. Make sure the the window has the focus (label should say QEMU - Press Ctrl-Alt to exit grab).
  2. Press Alt + Ctrl + 3 to enter the terminal mode of the OLPC.
  3. Make sure that you're logged in.
    • If not, just hit enter and it'll ask you to.
    • Login as root (no password is required)
  4. Type dhclient
  5. Press Alt + Ctrl + 1 to return to the graphical mode of the OLPC.
  6. Your browser / network connection should be working fine.

Enabling the Network Alternative #2

The steps below work on QEmu regardless of which operating system you are running.

If you are having trouble getting an internet connection inside QEmu:

Get the image running in QEmu so that you can see the normal view with the XO icon in the middle. Empty no apps no frame.png

Make sure your mouse is active in QEmu, then press ctrl+alt+2 together.

This will bring up a screen like a command line, called the QEmu monitor.

Type the following:

sendkey ctrl-alt-f1

And press return.

Then with the keyboard hold down the following keys: ctrl+alt+1

Another text based screen will appear, asking you to log-in. Sometimes there can be an extra "1" after the word "Login:", just delete it. Type root and press return

Then type:

dhclient

You should see the screen fill with text.

QEmu running dhclent.png

Some of the numbers have been removed from the screenshot above - they're not important.

Then hold down the following keys on the keyboard: ctrl+alt+2

and type the following:

sendkey ctrl-alt-f7

Then using the keyboard, hold down the following keys: ctrl+alt+1

Now open the browser and you should have internet access. Sugar browser with frame google home page.png

--Tomhannen 09:14, 7 December 2006 (EST) From some info found [here.]