Meego Wiki
Views

SDK/Docs/1.2/Using a MeeGo runtime with QEMU

From MeeGo wiki
< SDK | Docs | 1.2(Difference between revisions)
Jump to: navigation, search
(Shortcut button in Qt Creator)
(Starting a runtime from Qt Creator)
 
(31 intermediate revisions not shown)
Line 1: Line 1:
[[category:Meego-1.2]]
[[category:Meego-1.2]]
-
'''This page is in progress and is likely to contain incorrect instructions at present -- [[User:Elliot|Elliot Smith]] 11:25, 4 May 2011 (UTC)'''
+
== Introduction ==
[http://wiki.qemu.org/ QEMU] is a component of the MeeGo SDK. It can run handset or netbook images under an emulator, so you can test your applications on a MeeGo operating system, even if you don't have a MeeGo device.
[http://wiki.qemu.org/ QEMU] is a component of the MeeGo SDK. It can run handset or netbook images under an emulator, so you can test your applications on a MeeGo operating system, even if you don't have a MeeGo device.
 +
 +
The steps you need to follow to use a runtime with QEMU are as follows:
 +
 +
* [[#Install a runtime|Install a runtime]]
 +
* [[#Configuring access to an emulated device in Qt Creator|Configure Qt Creator for the runtime]]
 +
* Start the runtime. There are two approaches here:
 +
** The best way to start a MeeGo OS image under QEMU is to [[#Starting a runtime from Qt Creator|start it from inside Qt Creator]].
 +
** You can also [[#Starting a runtime from the command line|start a runtime from the command line]]. This can be useful to verify that a runtime is working correctly (for example, if it doesn't work from Qt Creator); and also useful for general testing of runtimes.
 +
 +
Here's what the tablet image looks like under QEMU (this is the ''Home'' zone):
 +
 +
[[File:sdk-1.2-tablet-under-qemu.png|600px]]
 +
 +
And here's what the netbook image looks like (this is ''Myzone''):
 +
 +
[[File:sdk-1.2-netbook-under-qemu.png|600px]]
 +
 +
Once you have a running image, you can deploy to it from Qt Creator (see the hello world tutorials), or [[#SSH into QEMU Image|log into it manually over SSH]].
 +
 +
== Install a runtime ==
If you haven't already installed the SDK, see:
If you haven't already installed the SDK, see:
-
* [[SDK/Docs/1.2/Installing_and_configuring_MeeGo_SDK_for_Linux|Installing the SDK on Linux]] or [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Windows|Installing the SDK on Windows ???content for Windows still to be finalised]]
+
* [[SDK/Docs/1.2/Installing_and_configuring_MeeGo_SDK_for_Linux|Installing the SDK on Linux]] or [[SDK/Docs/1.2/MeeGo_SDK_1.2_Preview_for_Windows|Installing the SDK on Windows]]
-
For QEMU, it is important to check your graphics capability. See [[SDK/Docs/1.2/MeeGo SDK Graphics Acceleration|this page about graphics acceleration]] for details. '''Please read this page carefully and follow the instructions on it if you are having issues starting runtimes under QEMU.'''
+
You will need to install at least one target with a runtime as part of this. Most MeeGo targets include a runtime: a virtual machine image to run under QEMU. See [[SDK/Docs/1.2/Installing_and_configuring_MeeGo_SDK_for_Linux#Finding_and_installing_targets|these instructions]] for details.
-
It is also possible to build and install QEMU manually: see the [[SDK/Docs/1.2/Building_QEMU_Tools|QEMU tools page]] for details.
+
For QEMU, it is also important that you check your graphics capability. See [[SDK/Docs/1.2/MeeGo SDK Graphics Acceleration|this page about graphics acceleration]] for details. '''Please read this page carefully and follow the instructions on it if you are having issues starting runtimes under QEMU.'''
-
The best and simplest way to use a MeeGo OS image with QEMU is to use <code>mad-admin</code> to download a runtime, and <code>mad</code> to run it. See the instructions below for how to do this.
+
== Configuring access to an emulated device in Qt Creator ==
-
== Install a MeeGo Runtime ==
+
[[File:sdk-1.2-configuring-qemu-with-qt-creator|thumb|600px]]
-
You can get a list of available runtimes with ???SDK maintenance tool.
+
To configure access to an emulated device:
 +
 
 +
# Open ''Tools'' > ''Options'' > ''Projects'' > ''MeeGo Device Configurations''.
 +
# In the dialog box, create a new Device Configuration by clicking on ''Add''.
 +
# Give the new device configuration a name in the ''Configuration Name'' text field, then configure it as follows:
 +
#* ''Device type'': choose '''MeeGo emulator'''
 +
#* ''Authentication type'': choose '''Password'''
 +
#* ''Host name'': '''localhost'''
 +
#* ''SSH Port'': '''6666'''
 +
#*: Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
 +
#* ''Free Ports'': '''13219,14168''' (the default)
 +
#*: '''Note:''' These ports are used to connect debuggers to the QEMU image. If these ports are not free, you can select alternatives.
 +
#* ''Connection Timeout'': '''30'''
 +
#* ''Username'': '''root'''
 +
#* ''Password'': '''meego'''
 +
# Click ''Apply''.
 +
# To test the settings, ensure that the emulated device is running, then click ''Test''.
 +
#: If successful, you'll see a dialog box with the message "Device configuration okay".
 +
#: If the message "Could not connect to host" is displayed, check your setting selections and make sure that the network is connected.
 +
# Click ''Close'' and '''OK''.
 +
 
 +
== Start the runtime ==
 +
 
 +
The following sections cover the two approaches:
 +
 
 +
# [[#Starting a runtime from Qt Creator|Starting a runtime from Qt Creator]]
 +
# [[#Starting a runtime from the command line|Starting a runtime from the command line]]
 +
 
 +
=== Starting a runtime from Qt Creator ===
-
???to install, select them in the UI
+
If you are using Qt Creator, it provides a shortcut button to start a QEMU runtime associated with a project, in the bottom left corner:
-
This will download the runtime (a ~650+ MB .bz2 file) and install it.
+
[[File:Meego-sdk-qtcreator-start-emulator-button.png]]
-
???how to check it installed
+
Clicking on this has the same effect as [[#Starting a runtime from the command line|starting the runtime from the command line]].
-
== Using a runtime ==
+
Once the emulator is running, the button shows a red square: when it is in this state, clicking on it again stops the emulator.
-
???normally you do this in Qt Creator; but here are the manual instructions
+
=== Starting a runtime from the command line ===
To start an installed runtime, use the <code>mad</code> command to boot the image inside QEMU.
To start an installed runtime, use the <code>mad</code> command to boot the image inside QEMU.
-
To start the IA32 handset runtime:
+
You can get a list of installed runtimes with:
-
$ sudo mad remote -r '''<handset runtime name>''' poweron
+
-
Here's what the handset image looks like (this is the ''Applications'' zone):
+
<pre>
 +
$ mad list runtimes
 +
meego-tablet-ia32-qemu-1.2.0.0.0.20110516.6-runtime        (installed)
 +
meego-netbook-ia32-qemu-1.2.0.0.0.20110516.6-runtime      (installed)
 +
...
 +
</pre>
-
[[File:Sdk-docs-ia32-handset-under-qemu.png|600px]] ???verify screenshot
+
(You may get different output depending on which runtimes you installed.)
-
To start the IA32 netbook runtime:
+
The <code>installed</code> runtimes are available to run. To run one, do:
-
  $ sudo mad remote -r '''<netbook runtime name>''' poweron
+
  $ sudo mad remote -r <runtime name> poweron -fg
-
Here's what the netbook image looks like (this is ''Myzone''):
+
The <code>-fg</code> flag puts the process into the foreground, which is useful for debugging.
-
[[File:Sdk-docs-ia32-netbook-under-qemu.png|600px]] ???verify screenshot
+
For example, to start the tablet runtime above, do:
 +
$ sudo mad remote -r meego-tablet-ia32-qemu-1.2.0.0.0.20110516.6-runtime poweron -fg
-
You can now use this running image as a deployment target for Qt Creator, or log into it manually over SSH (see below).
+
And to start the ia32 netbook runtime:
 +
$ sudo mad remote -r meego-netbook-ia32-qemu-1.2.0.0.0.20110516.6-runtime poweron -fg
When you've finished, use the power off icon in the emulator to switch it off (if available); or from the command line, do:
When you've finished, use the power off icon in the emulator to switch it off (if available); or from the command line, do:
  $ sudo mad remote -r '''<netbook runtime name>''' poweroff
  $ sudo mad remote -r '''<netbook runtime name>''' poweroff
-
=== Using a runtime without graphics ===
+
==== Starting a runtime without graphics ====
If you are having issues with running QEMU, you can try running the image without graphics to help isolate the problem. To do this, set <code>QEMU_NOGRAPHIC=yes</code> in the environment before running the emulator. For example:
If you are having issues with running QEMU, you can try running the image without graphics to help isolate the problem. To do this, set <code>QEMU_NOGRAPHIC=yes</code> in the environment before running the emulator. For example:
Line 70: Line 124:
# User: '''meego''', password: '''meego'''
# User: '''meego''', password: '''meego'''
# User: '''root''', password: '''meego'''
# User: '''root''', password: '''meego'''
-
 
-
== Configuring access to an emulated device in Qt Creator ==
 
-
 
-
[[File:sdk-docs-QtCreator-configuring-emulator-access.png|thumb|500px]] ???verify screenshot
 
-
 
-
To configure access to an emulated device:
 
-
 
-
# Open '''Tools''' > '''Options''' > '''Projects''' > '''MeeGo Device Configurations'''.
 
-
# In the dialog box, create a new Device Configuration by clicking on '''Add'''.
 
-
# Give the new Device Configuration a name in the Configuration Name text field, and add the following settings in the other test fields:
 
-
#* Device type: choose MeeGo emulator
 
-
#* Authentication type: Password
 
-
#* Host name: 127.0.0.1
 
-
#* Ports, SSH: 6666
 
-
#*: Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
 
-
#* Ports, Gdb Server: 13219 (the default)
 
-
#: '''Note:''' If this port is not free, you can select another one.
 
-
#* Connection Timeout: 30
 
-
#* User Name: root
 
-
#* Password: meego
 
-
# Click '''Apply'''.
 
-
# To test the settings, ensure that the emulated device is running, then click '''Test'''.
 
-
#: If successful, you'll see a dialog box with the message "Device configuration successful".
 
-
#: If the message "Could not connect to host" is displayed, check your setting selections and make sure that the network is connected.
 
-
# Click '''Close''' and '''OK'''.
 
-
 
-
=== Screen rotation ===
 
-
 
-
???check this
 
-
 
-
If you are using a handset image with QEMU, you can rotate the screen with ''Alt+Shift+R'' (???does R have to be uppercase?):
 
-
 
-
???screenshot
 

Latest revision as of 10:08, 20 May 2011


Contents

Introduction

QEMU is a component of the MeeGo SDK. It can run handset or netbook images under an emulator, so you can test your applications on a MeeGo operating system, even if you don't have a MeeGo device.

The steps you need to follow to use a runtime with QEMU are as follows:

Here's what the tablet image looks like under QEMU (this is the Home zone):

Sdk-1.2-tablet-under-qemu.png

And here's what the netbook image looks like (this is Myzone):

Sdk-1.2-netbook-under-qemu.png

Once you have a running image, you can deploy to it from Qt Creator (see the hello world tutorials), or log into it manually over SSH.

Install a runtime

If you haven't already installed the SDK, see:

You will need to install at least one target with a runtime as part of this. Most MeeGo targets include a runtime: a virtual machine image to run under QEMU. See these instructions for details.

For QEMU, it is also important that you check your graphics capability. See this page about graphics acceleration for details. Please read this page carefully and follow the instructions on it if you are having issues starting runtimes under QEMU.

Configuring access to an emulated device in Qt Creator

Sdk-1.2-configuring-qemu-with-qt-creator

To configure access to an emulated device:

  1. Open Tools > Options > Projects > MeeGo Device Configurations.
  2. In the dialog box, create a new Device Configuration by clicking on Add.
  3. Give the new device configuration a name in the Configuration Name text field, then configure it as follows:
    • Device type: choose MeeGo emulator
    • Authentication type: choose Password
    • Host name: localhost
    • SSH Port: 6666
      Note that the emulator is setup with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
    • Free Ports: 13219,14168 (the default)
      Note: These ports are used to connect debuggers to the QEMU image. If these ports are not free, you can select alternatives.
    • Connection Timeout: 30
    • Username: root
    • Password: meego
  4. Click Apply.
  5. To test the settings, ensure that the emulated device is running, then click Test.
    If successful, you'll see a dialog box with the message "Device configuration okay".
    If the message "Could not connect to host" is displayed, check your setting selections and make sure that the network is connected.
  6. Click Close and 'OK.

Start the runtime

The following sections cover the two approaches:

  1. Starting a runtime from Qt Creator
  2. Starting a runtime from the command line

Starting a runtime from Qt Creator

If you are using Qt Creator, it provides a shortcut button to start a QEMU runtime associated with a project, in the bottom left corner:

Meego-sdk-qtcreator-start-emulator-button.png

Clicking on this has the same effect as starting the runtime from the command line.

Once the emulator is running, the button shows a red square: when it is in this state, clicking on it again stops the emulator.

Starting a runtime from the command line

To start an installed runtime, use the mad command to boot the image inside QEMU.

You can get a list of installed runtimes with:

$ mad list runtimes
meego-tablet-ia32-qemu-1.2.0.0.0.20110516.6-runtime        (installed)
meego-netbook-ia32-qemu-1.2.0.0.0.20110516.6-runtime       (installed)
...

(You may get different output depending on which runtimes you installed.)

The installed runtimes are available to run. To run one, do:

$ sudo mad remote -r <runtime name> poweron -fg

The -fg flag puts the process into the foreground, which is useful for debugging.

For example, to start the tablet runtime above, do:

$ sudo mad remote -r meego-tablet-ia32-qemu-1.2.0.0.0.20110516.6-runtime poweron -fg

And to start the ia32 netbook runtime:

$ sudo mad remote -r meego-netbook-ia32-qemu-1.2.0.0.0.20110516.6-runtime poweron -fg

When you've finished, use the power off icon in the emulator to switch it off (if available); or from the command line, do:

$ sudo mad remote -r <netbook runtime name> poweroff

Starting a runtime without graphics

If you are having issues with running QEMU, you can try running the image without graphics to help isolate the problem. To do this, set QEMU_NOGRAPHIC=yes in the environment before running the emulator. For example:

$ QEMU_NOGRAPHIC=yes mad remote -r <handset runtime name> poweron

If you are then able to ssh into the running image, you can be fairly certain that your issues are graphics-related, rather than anything to do with the image itself.

SSH into QEMU Image

Any time MeeGo is running in QEMU, you can use SSH to connect to the image from a command-line terminal on the host system.

When the SDK starts QEMU, it sets up a redirect from port 6666 on the host to the SSH port (port 22) on the guest (MeeGo on QEMU). So you can log into the running QEMU image with:

$ ssh meego@127.0.0.1 -p 6666

Two user accounts are available:

  1. User: meego, password: meego
  2. User: root, password: meego
Personal tools