はじめに
YoctoProjectではqemuのイメージをビルドした場合、runqemuコマンドで実行することができる。 基本的には、ウィンドウが生成されその中に画面が表示される。 sshなどで接続したりして、qemuの画面表示をコンソールに出力したい場合などの方法を調査した。
runqemuのオプション
runqemuに指定できるオプション。
$ runqemu -h Usage: you can run this script with any valid combination of the following environment variables (in any order): KERNEL - the kernel image file to use BIOS - the bios image file to use ROOTFS - the rootfs image file or nfsroot directory to use DEVICE_TREE - the device tree blob to use MACHINE - the machine name (optional, autodetected from KERNEL filename if unspecified) Simplified QEMU command-line options can be passed with: nographic - disable video console novga - Disable VGA emulation completely sdl - choose the SDL UI frontend gtk - choose the Gtk UI frontend gl - enable virgl-based GL acceleration (also needs gtk or sdl options) gl-es - enable virgl-based GL acceleration, using OpenGL ES (also needs gtk or sdl options) egl-headless - enable headless EGL output; use vnc (via publicvnc option) or spice to see it (hint: if /dev/dri/renderD* is absent due to lack of suitable GPU, 'modprobe vgem' will create one suitable for mesa llvmpipe software renderer) serial - enable a serial console on /dev/ttyS0 serialstdio - enable a serial console on the console (regardless of graphics mode) slirp - enable user networking, no root privilege is required snapshot - don't write changes back to images kvm - enable KVM when running x86/x86_64 (VT-capable CPU required) kvm-vhost - enable KVM with vhost when running x86/x86_64 (VT-capable CPU required) publicvnc - enable a VNC server open to all hosts audio - enable audio [*/]ovmf* - OVMF firmware file or base name for booting with UEFI tcpserial=<port> - specify tcp serial port number qemuparams=<xyz> - specify custom parameters to QEMU bootparams=<xyz> - specify custom kernel parameters during boot help, -h, --help: print this text -d, --debug: Enable debug output -q, --quiet: Hide most output except error messages
最初は「Simplified QEMU command-line options can be passed with:」のあたりを読み飛ばして、
qemuparams
にqemuのパラメータをちまちま渡していたが、実行されるqemuのコマンドラインを見ると、
同じオプションがすでに設定されており、qemuparamsで渡したパラメータが無効化されていることに気づいた。
nographicとserialstdio
nographic
ウィンドウによる画面表示が全く不要な場合は、下記のようにnographic
を指定する。
$ runqemu nographic
画面表示用のウィンドウが生成されずに、シリアルコンソール出力がターミナル上に出力される。
serialstdio
シリアル出力をstdioに流すための設定であるserialstdio
を指定した場合は、画面表示用のウィンドウが生成された上で、
シリアルコンソール出力がターミナル上に出力される。
$ runqemu serialstdio
まとめ
ssh接続している環境でrunqemuしたい場合はnographicが便利。 実機に左右されないYoctoProjectの機能を試したい場合はこれで十分行ける。