Emulating the XO/lang-ja

From OLPC
< Emulating the XO
Revision as of 21:15, 21 August 2007 by Spiky (talk | contribs) (おすすめ)
Jump to: navigation, search
  翻訳された Emulating the XO 原文  
  english | español日本語한국어portuguêsрусский   +/- 変更  
This is an on-going translation


ラップトップの中にラップトップが


{{anchor|Quick Start - [[LiveCd|LiveCD]}}

クイックスタート - LiveCD

多くの人にとっては、LiveCDを使う方法がSugarを試してみるのに最も簡単な方法です。最も簡単なのですが、リブートするとあなたが行った作業が消えてしまいます。

2007年7月の段階では、Live CDは3ヶ月以上も更新されていませんでした。その間ソフトウェアは大幅に進歩してしまったので、果たしてLive CDが更新されるまで役立つものかどうか定かではありません。

For many, the LiveCD is the easiest way to try Sugar. It's easy to do, but your work is lost when you reboot.

As of July 2007, the Live CD hasn't been updated in more than 3 months. The software has advanced greatly during that time, so it's not clear the Live CD is of much use until it gets updated.

クイックスタート - エミュレーション

エミュレーションSugarを試すもう一つの方法です。セットアップがやっかいですが、しかし作業の内容が維持されます。

現在、TamTamのサウンドがうまく機能しないみたいです。MitchellNCharity 13:16, 5 June 2007 (EDT)

Emulation is the other way to try Sugar. It can be harder to set up,, but work is preserved.

Sound in TamTam may not be working at the moment. MitchellNCharity 13:16, 5 June 2007 (EDT)

クイックスタート(開発者向け)

エミュレーションでの開発はソフトウェア開発のための一つの代替手段です。

ここから最新イメージを入手してください。(add link to tinderbox) Emulating the XO/Quick Startに書かれているようにQEMUとカーネルアクセラレーションをインストールしてください。/Help_and_tipsの"Development"の項も参照のこと。

505が現在動作確認済みの最新版です。541以降のビルドも動きますが、しかしコラボレーション機能が壊れています(他のラップトップをブラウズすることができません)。
541と505の間の多くのビルド、例えば531, 529, そして525はブートしません。しかしながら50x以降のいくつかは動くみたいです。

Developing on emulation is one alternative for developing software.

Get the latest image from here. (add link to tinderbox) Install QEMU and kernel acceleration as described in Emulating the XO/Quick Start. See the /Help_and_tips "Development" section.

505 is the most recent build known to work. Builds after 541 run, but collaboration is broken (you can'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.

概要

OLPCのソフトウェアを走らせる一つの方法はあなたのPCでエミュレータ(と呼ばれる種類のソフト)を使うことです。その他の方法についてはプログラミングを始めようをご覧下さい。

ノート:Category:Emulation and Help and tips

遊ぶだけなら、LiveCdを使うのもいいですし、クイックスタートも参考になります。

開発をするには、LiveCdやQEMU(クイックスタートにありますが、別のイメージを使います)、あるいはLiveDC以外の開発用イメージの一つを使うのも良いでしょう。その他の方法については、 Sugarをインストールするを試してみてください。プログラミングを始めようにそのあたりの比較が書いてあります。


一般的な開発手法はkqemuアクセラレータと共にQEMUを使うことです。基本的な事柄についてはクイックスタートをご覧下さい。 ちなみに私たちが開発をするときは、2,3のユーティリティプログラムと共に異なる.imgを用います。最新安定版が書かれているOS imagesのページをご覧下さい。


qemuの替わりに、VMwareを走らせることもできますし、Macではその他のやり方もあります。


イメージについてのユーザフィードバックにあなたの体験談をお寄せください。そこに一般的な仮想化に関する部屋というのがあります。


XOディスクイメージにおける制限があります。


LATEST-STABLE-BUILD(最新案定版)と最新のビルドとの違いは本物のXOを走らせている人々にとってしばしば話題の中心となります。エミュレーションでは、開発者は普通LATEST-STABLE-BUILDを使います。そして安定化版が古くなると、開発者以外もおそらくそれを使うべきでしょう。

One way to run oplc software is using an emulator on your pc. See Getting started programming for other options.

Note Category:Emulation and Help and tips.

For play, you can use LiveCd or Quick Start.

For development, you can use LiveCd, or qemu (as in quick start, but with a different image), or perhaps one of the Developer Images other than the LiveCd. An alternate approach is to attempt installing sugar. See Getting started programming for a comparison.

A common development approach is to use QEMU with kqemu acceleration. See Quick Start for the basics. Though for development, we will use a different .img, one with a few extra utility programs. See OS images, including latest stable build.

Instead of qemu, you can run VMware, and there are additional options on a Mac.

Please report your experiences in User Feedback on Images. There is a Virtualization Common Room.

There are limitations with XO disk images.

The LATEST-STABLE-BUILD versus LATEST build distinction is mostly of interest to people running on actual XO's. In emulation, developers should usually use LATEST. And when STABLE is old, non-developers probably should too.

XOと代替環境との比較

OLPCラップトップ(XOのことです)は特殊なハードウェアで、Sugarの走るスリム化されたRed Hat linuxを走らせます。しかしもしあなたがXOを持ってなかったら?その場合は2~3の方法と共に使える、いくつかの方法があります。

An OLPC laptop is custom hardware, running a stripped-down Red Hat linux, running Sugar. But what if you don't have a real olpc laptop? There are a several options, which can each be used in a couple of ways.

おすすめ

プラットフォーム 目的 お勧め
Windows 開発 emulated xo disk image; or emulated Ubuntu with sugar-jhbuild; (or develoepr CD or LiveCD)?. (need your reports)
Mac 開発 emulated xo disk image; or emulated Ubuntu with sugar-jhbuild; (or developer CD or LiveCD)?. (need your reports)
Mac with Parallels 開発 Ubuntu 32-bitをインストールし, そしてUbuntu Linuxの上でSugarを動かす。/Macを参照のこと.
Ubuntu 32-bit 開発 Sugar with sugar-jhbuildUbuntu Linuxの上でSugar
32-bit linux 開発 Sugar with sugar-jhbuild
64-bit linux 開発 qemu下でxoディスクイメージ; もしくはLiveCd once it gets updated (currently it's April)
Windows/Macの開発者の選択肢としてのlive CDというのは私は懐疑的です。実際それが開発に使われいているというのをいまだ聞いたことがありません。それらのCDはすでに数ヶ月も前(4月から)のものです。しかしMcfletchが(5月に)言ってますが、それも一つの選択肢だ、ということなのでとりあえず追加しています。MitchellNCharity 09:19, 23 June 2007 (EDT)

Mcfletch おそらくLive CDはもはや選択肢ではないでしょう。Red Hatはリリースを停止しているようですし。開発者CDですら、すでに古くなりすぎています。

{

背景

選択肢 更新状況 サウンド機能? カメラ? ライブラリ? Etoys? 読み/書き? 開発ソフトウェアの有無? ネット? その他
Sugarをインストールする 継続的 yes yes? yes? yes yes your own yes On some platforms, it takes time and space (hours and ~3GB), but "just works". On others, it is quite difficult to install.
Installing Sugar, on a virtual 32-bit Ubuntu, running in an emulator (qemu, parallels, or vmware)
LiveCd 4月 yes(boot) yes?(qemu) yes?(boot) no(qemu) no yes no toolchain, Gnome yes? Alternative Quick Start. Can both be booted from, and used in qemu. Problems: A.
XO disk images:
最新安定板 http://olpc.download.redhat.com/olpc/streams/development/LATEST-STABLE-BUILD/
...development-ext3.img ~毎月 yes/B no yes yes yes no after config Quick Start for getting a look at Sugar.
...development-devel_ext3.img ~毎月 yes/B no no yes yes a little after config
最新版 http://olpc.download.redhat.com/olpc/streams/development/LATEST/
...development-ext3.img ~毎日 yes/B no yes yes yes no after config
...development-devel_ext3.img ~毎日 yes/B no no yes yes a little after config Good for new developers (requires some command-line comfort).
その他
FC6+Sugar April yes? ? ? no yes Full Fedora Softare Dev. yes 6GB (April version: no etoys)

凡例:

ライブラリ: サンプルコンテンツのライブラリ(ただし英語版)が含まれている。例えばネットワークにつながってないときにwebブラウザでいることのできるナイスなテキストが含まれているか、とか。
読み/書き (書き込み可): .imgを使った場合に、セッションの間あなたが作業状況を保存できるかどうか。.isoイメージを使った場合、毎回スタートするたびに同じ状態から始まります。
開発ソフトウェア: 開発ソフトウェアが含まれているかどうか?
ネット(ネットワーク): ネットワーク機能が"あるべき姿でちゃんと動く"か、それとも"手動で"動かす手続きが必要か?

問題:

A: fc6 x86_64上のLiveCD(4月版)では、kqemu下でカーネルパニックを起こします。A squashfs problem
B: Tam Tamが鳴りません。(EToysはノイズは出力するのですが。。。)原因不明

ノート:

  • 改めて"sugar-jhbuildはカメラ/マイクをサポートしてるんですか?": "はい、カメラでv412で640x480を使えば。多分それでいけると思います" これについてどなたか確認してもらえませんか? (#olpc, now) MitchellNCharity 00:16, 2 June 2007 (EDT)

Doables:

  • 上記LiveCdの"?"を削除する
  • Tam Tamのサウンド関係で何がおきているのか究明する。XOディスクイメージを使う分には全てサウンドはOKなんですが。
  • マイクのカラムを追加する?サウンド/カメラ/マイクの項目をH/Wの項目としたほうがいいか?
{

ステップバイステップでインストールする

ここには、あなたがXOのエミュレーション環境を動かせるようにするための情報が集められています。あなたはすでにLinuxを走らせ、そしてqemuとkqemuをインストール済みであることを想定しています。

仮想のxo環境ではサウンドとカメラが動きません。一番目の理由は、いったいなぜ動かないのかいまだに誰も解明できてないからです[1]。二番目の理由として、qemuがまだそれらをサポートしていないからです。

http://olpc.download.redhat.com/olpc/streams/development/LATEST/devel_ext3/ に行って、-devel_ext3.img.bz2という番号の付いているイメージとそのmd5を入手してください。ここの例ではビルド485を使っています。

md5sum -c olpc-redhat-stream-development-build-485-20070703_0249-devel_ext3.img.bz2.md5

bzcat olpc-redhat-stream-development-build-485-20070703_0249-devel_ext3.img.bz2 > xo-485a.img

これで1GBほどのファイルができます。

export PORT=2221
qemu-system-x86_64  -soundhw es1370 -serial `tty` -kernel-kqemu -redir tcp:$PORT::22 -hda xo-485a.img

x86_64 cpuを持っていないならば、qemu-system-x86_64の代わりにqemuを使ってください。

スクリーンがすぐに真っ暗になるでしょう。そして青い"GNU GRUB"スクリーンが表示されます。もし暗いままならば、qemuのバグです。qemuをキルして再度立ち上げてください。

The boot messages will scroll by, and you should eventually see the normal XO first-time login. We'll save that for later.

In the window where you started qemu, you should now see a login: prompt.

  1. Enter root
  2. Then:
/etc/rc5.d/S98NetworkManager stop
mv /etc/rc3.d/S98NetworkManager /etc/rc3.d/DISABLED-S98NetworkManager
mv /etc/rc5.d/S98NetworkManager /etc/rc5.d/DISABLED-S98NetworkManager
echo ifup eth0 >> /etc/rc.local

ifup eth0 
killall X

Killing X should restart sugar.

If you want to enter a name with diacritics, you need to wait for X to restart, and then do:

su olpc -c"DISPLAY=:0 xmodmap -e 'keycode  77 = Multi_key'"

This sets up Num_lock as Multi_key. Unfortunately, the next time X is restarted, you will lose it. A better solution is needed.

At this point you could just proceed to use your new XO. However, the screen resolution is wrong (1024x768). So for development, or to get a more accurate feel for how things really look, some extra steps are required.

Once you reach the main sugar screen, you should check the Neighborhood view (F1). If you can't see other people, either the we are having problems with the presence server, you are behind an unusually picky firewall, or networking on qemu is broken again in the build number you are using. (Remember that ping doesn't work inside of qemu).

While this next step is not strictly required, it will enable you to use ssh and scp, which can be handy to move stuff back and forth between your host and xo.

Still as root on the xo,

1. Change the root password.

passwd

Don't worry if it says something like "BAD PASSWORD: ", and complains about the password you picked. It will still work.

2. Change the olpc password.

passwd olpc

Now you can use ssh and scp.


The current released version of QEMU doesn't support 1200x900, so we use a Xephyr remote X server. Each time you boot the xo, if you want 1200x900, you'll need to do these next steps again, except for the ones marked "(First time only)".

1. 引き続きxo上でrootのまま以下を実行:

init 3
sleep 5
ifup eth0

su olpc
grep export /usr/bin/sugar > ~/env
source ~/env

If the ifup eth0 fails with an "already running" message, that's ok. Perhaps it is no longer needed.

2. ホストOSに戻って, Xephyrの準備 (初回のみです)

mcookie > xephyr-cookie
export COOKIE=`cat xephyr-cookie`
rm -f xephyr-xauth; echo "add :1 . $COOKIE" | xauth -f xephyr-xauth
echo $COOKIE

3. XO上で: "su olpc"でolpcユーザにて以下を実施, クッキーを保存します: (初回のみです)

echo "add 10.0.2.2:1 . " PUT-THE-COOKIE-HERE | xauth

4. ホストOSに戻ってXephyrをスタートさせます:

Xephyr :1 -auth xephyr-xauth -reset -screen 1200x900x16 -dpi 200

You will probably want to do this in its own window, as it periodically dies and needs to be restarted.

5. xo上で、引き続き"su olpc"にてolpcユーザのまま, sugarをスタート:

DISPLAY=10.0.2.2:1 sugar

実際には、私はホストOSからsshして、そして以下のようにsugarを走らせています: Actually, I usually ssh in from the host, and run sugar that way:

a. ホストOS上で,

ssh -o NoHostAuthenticationForLocalhost=yes -p 2222 olpc@localhost

b. 表示されたシェルで,

source ~/env
export DISPLAY=10.0.2.2:1
sugar

以下も一緒に走らせるといいでしょう

xmodmap -e 'keycode  77 = Multi_key'

これで大文字小文字を無視するモードにNum_lockキーを使って入れます。 しかしこれを最初にやるとXephyrが死んでしまうようです(涙)

これであなたは正しい解像度にてXOの最初のログイン画面を見ることができるはずです。 大文字小文字を無視するためにNum_lockキーを使えます。おめでとう!でも手順がやっかいでごめんなさい。

To run multiple xo's (to play with collaboration, for instance), you can repeat the above steps. Create a xo-485b.img, and use a different PORT number (like 2222). If you are using Xephyr, start a second Xephyr, which will be 10.0.2.2:2, use that instead of ...:1 in the instructions. You should now be able to see yourself, and collaborate in Write.

The following will save you having to periodically type your xo password, but is optional, and can just as easily be done later.

Back on the host,

1. Create an ssh key if you don't already have one. See /Help_and_tips#SSH into qemu, using a key.

2. Copy it to the xo,

scp -o NoHostAuthenticationForLocalhost=yes -P $PORT ~/.ssh/id_rsa.pub root@localhost:~/

3. On the xo, as root, spread the key around:

mkdir ~root/.ssh
mkdir ~olpc/.ssh
cat ~root/id_rsa.pub >> ~root/.ssh/authorized_keys
cat ~root/id_rsa.pub >> ~olpc/.ssh/authorized_keys

You can now ssh and scp without retyping your password.

xauth -f xephyr-xauth
echo $COOKIE

3. On the xo, still as "su olpc", record the cookie: (First time only)

echo "add 10.0.2.2:1 . " PUT-THE-COOKIE-HERE

リンク集

  • Tutorial Written by IBM on how to get this working.