Emulating the XO/Help and tips/Obsolete: Difference between revisions
(+category emulation, developers) |
(→Configuring X: -> /Obsolete) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Here are sections which no longer apply to recent builds. New sections are at the top. |
|||
=== Builds between 445 and 48? -- Workaround for "Cannot find root filesystem!" preventing boot === |
|||
== Obsolete: Configuring X == |
|||
''This sounds like it hasn't been true in at least half a year. [[User:MitchellNCharity|MitchellNCharity]] 18:58, 8 November 2007 (EST)'' |
|||
* In some builds X is configured to load the Geode driver by default. You need to modify it to load the frame buffer driver instead. In '''/etc/X11/xorg.conf''', go to the "Device" section and change the Driver setting from "amd" to "fbdev" |
|||
== Obsolete: Change Keyboard Layout == |
|||
''There is now better discussion of this elsewhere. [[User:MitchellNCharity|MitchellNCharity]] 18:29, 8 November 2007 (EST)'' |
|||
* You can change '''XKbLayOut''' in the file '''/etc/X11/xorg.conf''' to ''your keyboard code'' with for example '''nano''' text editor by |
|||
nano /etc/X11/xorg.conf |
|||
== Build recommendations from around late 500's == |
|||
''Removed from [[Emulating the XO#Build recommendations]] on 2007-09-29.'' |
|||
[http://olpc.download.redhat.com/olpc/streams/development/build505-20070712_0335/devel_ext3/ 505] is the most recent build known to work in qemu. |
|||
But 557 may also. |
|||
For a time, builds after 541 ran, but collaboration was broken (you couldn't see other laptops).<br/> |
|||
Many builds between 541 and 505, including 531, 529, and 525, didn't boot. However, some of the later 50x may work. |
|||
:Actually build [http://olpc.download.redhat.com/olpc/streams/development/build542/devel_ext3/ 542], the Trial 2 build, introduced a "feature": the configuration is no longer hardcoded to use the server olpc.collabora.co.uk, and has no server prepopulated. You can set the server yourself by editing ''~olpc/.sugar/default/config'' and setting ''server = olpc.collabora.co.uk'' and restarting. This should mean that 542 is the preferred image for developing with, since 505 and other 50x are quite old. --[[User:Morgs|morgs]] 03:54, 21 August 2007 (EDT) |
|||
::I've added seting the server to the instructions below. Thanks! :) But for now, we're still stuck at 505, because the workaround for [http://dev.laptop.org/ticket/1977 #1977] stopped working. [[User:MitchellNCharity|MitchellNCharity]] 23:25, 22 August 2007 (EDT) |
|||
:: #1977 is now marked fixed. Hopefully once [http://dev.laptop.org/ticket/2981 #2981] is fixed, emulation of current builds will again work. [[User:MitchellNCharity|MitchellNCharity]] 10:33, 24 August 2007 (EDT) |
|||
:: #2981 is now marked fixed. If qemu is run with ''-net nic,model=rtl8139'', then NetworkManager no longer needs to be disabled (build 564). Presence services still doesn't seem to work (neither jabber.laptop.org, nor olpc.collabora.co.uk (registered False or True)). Cause unknown. [[User:MitchellNCharity|MitchellNCharity]] 00:39, 2 September 2007 (EDT) |
|||
:::Observations: 557 and 564 seem to behave similarly. ''wget http://SOME-IP-ADDRESS/'' fails (''Connecting to SOME-IP-ADDRESS... failed: Network is unreachable.''). ''ifup eth0'' fails (''Determining IP information for eth0... failed.''). nm-tool reports ''Gateway: 0.0.0.0 Primary DNS: 0.0.0.0 Secondary DNS: 0.0.0.0''. Hmm, how does one ''/sbin/route add -net 0.0.0.0 gw 10.0.2.2 eth0''[http://www.h7.dion.ne.jp/~qemu-win/HowToNetwork-en.html] on an xo? [[User:MitchellNCharity|MitchellNCharity]] 01:45, 2 September 2007 (EDT) |
|||
::::I probably simply misconfigured my qemu. '''''-net user''' -net nic,model=rtl8139'' is needed. [[User:MitchellNCharity|MitchellNCharity]] 13:41, 29 September 2007 (EDT) |
|||
Build [http://olpc.download.redhat.com/olpc/streams/development/build558-20070827_0241/devel_ext3/ 557] is reported to work on VirtualBox and VMWare, but not qemu. [[User:MitchellNCharity|MitchellNCharity]] 22:52, 19 September 2007 (EDT) |
|||
:But a qemu workaround is suggested above. [[User:MitchellNCharity|MitchellNCharity]] 00:51, 29 September 2007 (EDT) |
|||
Builds 578, 579, 581 are known to not boot <strike>[http://dev.laptop.org/ticket/3470 #3470]</strike> (578, 579 in VMWare, 581 in QEMU). [[User:MitchellNCharity|MitchellNCharity]] 13:55, 15 September 2007 (EDT) |
|||
:Reported fixed. Buld 593 is reported[http://dev.laptop.org/ticket/3470#comment:8] to run on VMWare. [[User:MitchellNCharity|MitchellNCharity]] 00:51, 29 September 2007 (EDT) |
|||
== Builds before around 557 -- Network setup == |
|||
''Probably fixed around 557. Definitely by 602.'' |
|||
Chances are that the network will not be enabled. Following are two possible ways to enable it. |
|||
=== Network setup === |
|||
:''(This section is linked to from elsewhere, so don't rename it casually.)'' |
|||
*[[#Change the root password]] |
|||
*As root: |
|||
To see the net: |
|||
echo ifup eth0 >> /etc/rc.local |
|||
To also see other sugar machines: |
|||
mv /etc/rc3.d/S98NetworkManager /etc/rc3.d/DISABLED-S98NetworkManager |
|||
mv /etc/rc5.d/S98NetworkManager /etc/rc5.d/DISABLED-S98NetworkManager |
|||
*Reboot the image. Simply exiting qemu and starting it again is fine. |
|||
Congratulations, your network should now be working. |
|||
Per [http://fabrice.bellard.free.fr/qemu/qemu-doc.html#SEC29 Qemu 0.9.0 FAQ] a software network card driver is needed available within the [http://openvpn.net/ OpenVPN.net] download. This finally worked for me. [[User:Grantbow|Grantbow]] 22:56, 28 August 2007 (EDT) |
|||
=== Dealing with NetworkManager === |
|||
NetworkManager is intended to make wireless networking "just work". As connectivity comes and goes, it notices and sets things up. Unfortunately, it doesn't work in xo disk images on qemu. |
|||
Logged into an image as root, you can see |
|||
ifconfig |
|||
thinks eth0 is up, as the web browers proves, but NetworkManager's |
|||
nm-tool |
|||
thinks eth0 is Active: no, and thus that you are disconnected from the net. |
|||
The problem is nm expects a modern network interface card which supports line/carrier detect. |
|||
Qemu's default emulated nic, ne2k_pci, doesn't. An alternate model=rtl8139 is reported to, and to work with nm, but the xo images don't have a driver for it. |
|||
Fortunately, inside qemu, with our hardwired eth0, we don't care about the functionality nm provides. |
|||
And also fortunately, sugar has reasonable fallbacks for when it finds nm isn't running. |
|||
So if we avoid running nm, everything works. |
|||
mv /etc/rc3.d/S98NetworkManager /etc/rc3.d/DISABLED-S98NetworkManager |
|||
mv /etc/rc5.d/S98NetworkManager /etc/rc5.d/DISABLED-S98NetworkManager |
|||
=== Enabling the Network Alternative #1 === |
|||
When the emulator is starting GRUB boot loader, press a key. |
|||
#Choose then the Qemu line with arrow keys. |
|||
#Press ''E'' |
|||
#Move to the 'Kernel' line and press ''End'' |
|||
#Add Space ''1'' to end of the line |
|||
#Press ''Enter'' |
|||
#Press ''B'' |
|||
You will be automaticaly log in as superuser in terminal (in single user mode). |
|||
You can start network and put your local keyboard layout command there like this (using tabulator key to complete the filenames): |
|||
echo ifup eth0 >> /etc/rc.local |
|||
or |
|||
#(change '''ONBOOT''' from "no" to '''"yes"''') |
|||
nano '''/etc/sysconfig/network-scripts/ifcfg-eth0''' |
|||
#(disable NetworkManager) |
|||
mv /etc/rc5.d/S98NetworkManager /etc/rc5.d/K98NetworkManager |
|||
On build 432, the following is also needed to have the network automatically started on bootup: |
|||
mv /etc/rc5.d/K90network /etc/rc5.d/S10network |
|||
It also helps sugar to find other people automatically upon startup. |
|||
Put your own keyboard layout for text terminals |
|||
echo loadkeys ''Your_two_letter_country_code'' >> /etc/rc.local |
|||
. /etc/rc.local |
|||
Type '''Ctrl-D''' to continue normal boot. |
|||
Keyboard layout and network should work automatically every time you start the QEMU image. |
|||
--[[User:Tonyv|Tonyv]] 01:52, 13 January 2007 (EST) |
|||
=== Enabling the Network Alternative #2 === |
|||
Make sure the the window has the focus (label should say <tt>QEMU - Press Ctrl-Alt to exit grab</tt>). |
|||
If the following keys do not work try pushing also the Shift key down to exit the Sugar environment. |
|||
If it does not work see the sendkey method of Alternative #3 |
|||
# |
|||
#Press <tt>Alt + Ctrl + F1</tt> to enter the terminal mode of the OLPC. |
|||
#Make sure that you're logged in. |
|||
#*If not, just hit <tt>enter</tt> and it'll ask you to. |
|||
#*Login as <tt>root</tt> (no password is required) |
|||
#Type <tt>dhclient</tt> and press return. |
|||
#Press <tt>Alt + Ctrl + F7</tt> to return to the graphical mode of the OLPC. |
|||
#Your browser / network connection should be working fine. |
|||
=== Enabling the Network Alternative #3 === |
|||
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. |
|||
[[Image:Empty_no_apps_no_frame.png|300px]] |
|||
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+7''' |
|||
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 |
|||
or |
|||
ifup eth0: |
|||
You should see the screen fill with text. |
|||
[[Image:QEmu_running_dhclent.png|400px]] |
|||
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 |
|||
[[User:Justin|Justin]]: Using the latest disk image (Build 385), I found that it was "ctrl-alt-f3" that returned to the Sugar interface. |
|||
Then using the keyboard, hold down the following keys: '''ctrl+alt+1''' |
|||
Now open the browser and you should have internet access. |
|||
[[Image:Sugar_browser_with_frame_google_home_page.png|300px]] |
|||
[[Image:OLPC_20070104.png|300px]] |
|||
== Builds between 445 and 48? -- Workaround for "Cannot find root filesystem!" preventing boot == |
|||
''Fixed by 494.'' |
|||
Build 445 was the last version which booted cleanly under qemu ([http://dev.laptop.org/ticket/1809 ticket]). |
Build 445 was the last version which booted cleanly under qemu ([http://dev.laptop.org/ticket/1809 ticket]). |
||
Line 33: | Line 213: | ||
If grub-install hangs, just kill it. It may even have worked anyway. |
If grub-install hangs, just kill it. It may even have worked anyway. |
||
''Fixed by 494.'' |
|||
== Builds between 445 and 485, non-inclusive -- Workaround for netfs preventing boot == |
|||
''Fixed in build 485.'' |
|||
*The boot currently hangs in rc netfs. So we disable it. This only needs to be done once. |
*The boot currently hangs in rc netfs. So we disable it. This only needs to be done once. |
||
*#Get a shell. Do this by following the instructions below, but add a "2" to the end of the kernel line. So it is <tt> root=/dev/hda1 2 </tt> |
*#Get a shell. Do this by following the instructions below, but add a "2" to the end of the kernel line. So it is <tt> root=/dev/hda1 2 </tt> |
||
Line 44: | Line 225: | ||
::4. Done. Now restart qemu, following the instructions below. |
::4. Done. Now restart qemu, following the instructions below. |
||
:(This workaround avoids the boot hanging after saying "Mounting other filesystems:".) |
:(This workaround avoids the boot hanging after saying "Mounting other filesystems:".) |
||
''Fixed in build 485.'' |
|||
''New sections get added to the '''top''' of the page.'' |
|||
[[Category:Emulation]] |
[[Category:Emulation]] |
Latest revision as of 23:58, 8 November 2007
Here are sections which no longer apply to recent builds. New sections are at the top.
Obsolete: Configuring X
This sounds like it hasn't been true in at least half a year. MitchellNCharity 18:58, 8 November 2007 (EST)
- In some builds X is configured to load the Geode driver by default. You need to modify it to load the frame buffer driver instead. In /etc/X11/xorg.conf, go to the "Device" section and change the Driver setting from "amd" to "fbdev"
Obsolete: Change Keyboard Layout
There is now better discussion of this elsewhere. MitchellNCharity 18:29, 8 November 2007 (EST)
- You can change XKbLayOut in the file /etc/X11/xorg.conf to your keyboard code with for example nano text editor by
nano /etc/X11/xorg.conf
Build recommendations from around late 500's
Removed from Emulating the XO#Build recommendations on 2007-09-29.
505 is the most recent build known to work in qemu. But 557 may also.
For a time, builds after 541 ran, but collaboration was broken (you couldn't see other laptops).
Many builds between 541 and 505, including 531, 529, and 525, didn't boot. However, some of the later 50x may work.
- Actually build 542, the Trial 2 build, introduced a "feature": the configuration is no longer hardcoded to use the server olpc.collabora.co.uk, and has no server prepopulated. You can set the server yourself by editing ~olpc/.sugar/default/config and setting server = olpc.collabora.co.uk and restarting. This should mean that 542 is the preferred image for developing with, since 505 and other 50x are quite old. --morgs 03:54, 21 August 2007 (EDT)
- I've added seting the server to the instructions below. Thanks! :) But for now, we're still stuck at 505, because the workaround for #1977 stopped working. MitchellNCharity 23:25, 22 August 2007 (EDT)
- #1977 is now marked fixed. Hopefully once #2981 is fixed, emulation of current builds will again work. MitchellNCharity 10:33, 24 August 2007 (EDT)
- #2981 is now marked fixed. If qemu is run with -net nic,model=rtl8139, then NetworkManager no longer needs to be disabled (build 564). Presence services still doesn't seem to work (neither jabber.laptop.org, nor olpc.collabora.co.uk (registered False or True)). Cause unknown. MitchellNCharity 00:39, 2 September 2007 (EDT)
- Observations: 557 and 564 seem to behave similarly. wget http://SOME-IP-ADDRESS/ fails (Connecting to SOME-IP-ADDRESS... failed: Network is unreachable.). ifup eth0 fails (Determining IP information for eth0... failed.). nm-tool reports Gateway: 0.0.0.0 Primary DNS: 0.0.0.0 Secondary DNS: 0.0.0.0. Hmm, how does one /sbin/route add -net 0.0.0.0 gw 10.0.2.2 eth0[1] on an xo? MitchellNCharity 01:45, 2 September 2007 (EDT)
- I probably simply misconfigured my qemu. -net user -net nic,model=rtl8139 is needed. MitchellNCharity 13:41, 29 September 2007 (EDT)
- Observations: 557 and 564 seem to behave similarly. wget http://SOME-IP-ADDRESS/ fails (Connecting to SOME-IP-ADDRESS... failed: Network is unreachable.). ifup eth0 fails (Determining IP information for eth0... failed.). nm-tool reports Gateway: 0.0.0.0 Primary DNS: 0.0.0.0 Secondary DNS: 0.0.0.0. Hmm, how does one /sbin/route add -net 0.0.0.0 gw 10.0.2.2 eth0[1] on an xo? MitchellNCharity 01:45, 2 September 2007 (EDT)
Build 557 is reported to work on VirtualBox and VMWare, but not qemu. MitchellNCharity 22:52, 19 September 2007 (EDT)
- But a qemu workaround is suggested above. MitchellNCharity 00:51, 29 September 2007 (EDT)
Builds 578, 579, 581 are known to not boot #3470 (578, 579 in VMWare, 581 in QEMU). MitchellNCharity 13:55, 15 September 2007 (EDT)
- Reported fixed. Buld 593 is reported[2] to run on VMWare. MitchellNCharity 00:51, 29 September 2007 (EDT)
Builds before around 557 -- Network setup
Probably fixed around 557. Definitely by 602.
Chances are that the network will not be enabled. Following are two possible ways to enable it.
Network setup
- (This section is linked to from elsewhere, so don't rename it casually.)
- #Change the root password
- As root:
To see the net:
echo ifup eth0 >> /etc/rc.local
To also see other sugar machines:
mv /etc/rc3.d/S98NetworkManager /etc/rc3.d/DISABLED-S98NetworkManager mv /etc/rc5.d/S98NetworkManager /etc/rc5.d/DISABLED-S98NetworkManager
- Reboot the image. Simply exiting qemu and starting it again is fine.
Congratulations, your network should now be working.
Per Qemu 0.9.0 FAQ a software network card driver is needed available within the OpenVPN.net download. This finally worked for me. Grantbow 22:56, 28 August 2007 (EDT)
Dealing with NetworkManager
NetworkManager is intended to make wireless networking "just work". As connectivity comes and goes, it notices and sets things up. Unfortunately, it doesn't work in xo disk images on qemu.
Logged into an image as root, you can see
ifconfig
thinks eth0 is up, as the web browers proves, but NetworkManager's
nm-tool
thinks eth0 is Active: no, and thus that you are disconnected from the net.
The problem is nm expects a modern network interface card which supports line/carrier detect. Qemu's default emulated nic, ne2k_pci, doesn't. An alternate model=rtl8139 is reported to, and to work with nm, but the xo images don't have a driver for it.
Fortunately, inside qemu, with our hardwired eth0, we don't care about the functionality nm provides. And also fortunately, sugar has reasonable fallbacks for when it finds nm isn't running.
So if we avoid running nm, everything works.
mv /etc/rc3.d/S98NetworkManager /etc/rc3.d/DISABLED-S98NetworkManager mv /etc/rc5.d/S98NetworkManager /etc/rc5.d/DISABLED-S98NetworkManager
Enabling the Network Alternative #1
When the emulator is starting GRUB boot loader, press a key.
- Choose then the Qemu line with arrow keys.
- Press E
- Move to the 'Kernel' line and press End
- Add Space 1 to end of the line
- Press Enter
- Press B
You will be automaticaly log in as superuser in terminal (in single user mode).
You can start network and put your local keyboard layout command there like this (using tabulator key to complete the filenames):
echo ifup eth0 >> /etc/rc.local
or
#(change ONBOOT from "no" to "yes") nano /etc/sysconfig/network-scripts/ifcfg-eth0 #(disable NetworkManager) mv /etc/rc5.d/S98NetworkManager /etc/rc5.d/K98NetworkManager
On build 432, the following is also needed to have the network automatically started on bootup:
mv /etc/rc5.d/K90network /etc/rc5.d/S10network
It also helps sugar to find other people automatically upon startup.
Put your own keyboard layout for text terminals
echo loadkeys Your_two_letter_country_code >> /etc/rc.local . /etc/rc.local
Type Ctrl-D to continue normal boot.
Keyboard layout and network should work automatically every time you start the QEMU image. --Tonyv 01:52, 13 January 2007 (EST)
Enabling the Network Alternative #2
Make sure the the window has the focus (label should say QEMU - Press Ctrl-Alt to exit grab). If the following keys do not work try pushing also the Shift key down to exit the Sugar environment. If it does not work see the sendkey method of Alternative #3
- Press Alt + Ctrl + F1 to enter the terminal mode of the OLPC.
- 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)
- Type dhclient and press return.
- Press Alt + Ctrl + F7 to return to the graphical mode of the OLPC.
- Your browser / network connection should be working fine.
Enabling the Network Alternative #3
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.
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+7
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
or
ifup eth0:
You should see the screen fill with text.
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
Justin: Using the latest disk image (Build 385), I found that it was "ctrl-alt-f3" that returned to the Sugar interface.
Then using the keyboard, hold down the following keys: ctrl+alt+1
Now open the browser and you should have internet access.
Builds between 445 and 48? -- Workaround for "Cannot find root filesystem!" preventing boot
Fixed by 494.
Build 445 was the last version which booted cleanly under qemu (ticket). More recent builds require workarounds. Build 485 resolved one problem.
- When booting on qemu, add root=/dev/hda to the grub kernel line. This needs to be done every time.
- When you start your xo disk image on qemu, you should see a blue grub screen, doing a "Booting .. in N seconds" countdown. Press space to interrupt it.
- Press e (edit). This will show you 3 lines.
- Move to the second, which begins "kernel". Press e. This will take you to the end of the kernel line.
- Add root=/dev/hda1 Then press enter.
- Press b to continue booting.
- (This workaround avoids "WARNING: Cannot find root file system!", and being dropped into an emergency shell.)
Should add instructions to modify the image's grub config, so this doesn't need to be done every time you boot. MitchellNCharity 12:04, 3 July 2007 (EDT)
It might be worth gathering the currently scattered notes, into a single list of step by step instructions, for getting from nothing, to a pair of qemu images running with Xephyr's and ssh. MitchellNCharity 12:04, 3 July 2007 (EDT)
And some related content from elsewhere:
0. Press any key to interrupt the countdown to boot. Then,
- Press e.
- Press down-arrow to get the "kernel" line.
- Press e. This takes you to the end of the kernel command line.
- Type space and root=/dev/hda1
- Press Enter.
- Press b.
mv /boot/grub/grub.conf /boot/grub/grub.conf.orig awk '/kernel/ {print $O,"root=/dev/hda1";next} {print}' < /boot/grub/grub.conf.orig > /boot/grub/grub.conf grub-install hd0
If grub-install hangs, just kill it. It may even have worked anyway.
Builds between 445 and 485, non-inclusive -- Workaround for netfs preventing boot
Fixed in build 485.
- The boot currently hangs in rc netfs. So we disable it. This only needs to be done once.
- Get a shell. Do this by following the instructions below, but add a "2" to the end of the kernel line. So it is root=/dev/hda1 2
- Log in as root, no password.
- Then:
mv /etc/rc.d/rc3.d/S25netfs /etc/rc.d/rc3.d/DISABLED-S25netfs mv /etc/rc.d/rc5.d/S25netfs /etc/rc.d/rc5.d/DISABLED-S25netfs
- 4. Done. Now restart qemu, following the instructions below.
- (This workaround avoids the boot hanging after saying "Mounting other filesystems:".)
New sections get added to the top of the page.