Meego Wiki
Views

SDK/Docs/1.1/Configuring QEMU runtimes

From MeeGo wiki
< SDK | Docs | 1.1(Difference between revisions)
Jump to: navigation, search
(Moving openSUSE instructions to the page explaining QEMU pre-requisites)
 
(25 intermediate revisions not shown)
Line 1: Line 1:
 +
[[category:Meego-1.1]]
 +
[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.
If you haven't already installed the SDK, see:
If you haven't already installed the SDK, see:
-
* [[SDK/Docs/1.1/Getting started with the MeeGo SDK for Linux|Installing the SDK on Linux]]
+
* [[SDK/Docs/1.1/Getting started with the MeeGo SDK for Linux|Installing the SDK on Linux]] or [[SDK/Docs/1.1/Getting_started_with_the_MeeGo_SDK_for_Windows|Installing the SDK on Windows]]
-
It is also possible to build and install QEMU manually: see the [[MeeGo_SDK_Building_QEMU_Tools|QEMU tools page]] for details.
+
For QEMU, it is important to check your graphics capability.  See [[SDK/Docs/1.1/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 run a MeeGo image under QEMU is to use <code>mad-admin</code> to create a runtime, and <code>mad</code> to run it. See the instructions below for how to do this.
+
It is also possible to build and install QEMU manually. See the [[SDK/Docs/1.1/Building_QEMU_Tools|QEMU tools page]] for details.
-
== Creating a runtime ==
+
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.
 +
 
 +
== Install a MeeGo Runtime ==
You can get a list of available runtimes for your version of MADDE with:
You can get a list of available runtimes for your version of MADDE with:
-
<pre>
+
$ sudo mad-admin list runtimes
-
$ mad-admin list runtimes
+
meego-handset-ia32-qemu-1.1.2-runtime                       (installable)
-
qemu-n900-pr12                                              (installable)
+
meego-netbook-ia32-qemu-1.1.2-runtime                       (installable)
-
rx48-diablo                                                (installable)
+
-
meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime       (installable)
+
-
meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime       (installable)
+
-
</pre>
+
-
To install one of the "installable" runtimes, such as the IA32 handset runtime, do:
+
Run the command below.  Replace '''<runtime name>''' with one of
-
$ sudo mad-admin create -f -e meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime
+
* '''meego-handset-ia32-qemu-1.1.2-runtime''': Run the MeeGo OS with handset UI.
 +
* '''meego-netbook-ia32-qemu-1.1.2-runtime''': Run the MeeGo OS with netbook UI.
-
This will download the runtime and install it (into MADDE's <code>runtimes</code> directory; on Linux, the default location is <code>/usr/lib/madde/linux-i686/runtimes</code>).
+
$ sudo mad-admin create -f -e '''<runtime name>'''
-
To check the runtime is installed, use <code>mad-admin list runtimes</code> again:
+
This will download the runtime (a ~650+ MB .bz2 file) into MADDE's <code>cache</code> directory and decompress it in the <code>runtimes</code> directory. If network/proxy issues prevent the image from downloading, the url for the runtime can be extracted from the MADDE's <code>cache/madde.conf.d/<runtime>.conf</code> file, downloaded manually, and copied into the <code>cache</code> directory. Re-running the above command will now bypass the download and directly decompress the runtime.
-
<pre>
+
After installing, you can check that the runtime is installed by running <code>mad-admin list</code> again.
-
$ mad-admin list runtimes
+
-
qemu-n900-pr12                                              (installable)
+
-
rx48-diablo                                                (installable)
+
-
meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime      (installed)
+
-
meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime      (installable)
+
-
</pre>
+
-
Note that '''installed''' is shown next to the handset runtime.
+
$ sudo mad-admin list runtimes
 +
meego-handset-ia32-qemu-1.1.2-runtime      (installed)
 +
meego-netbook-ia32-qemu-1.1.2-runtime      (installable)
 +
 
 +
Note that '''installed''' above indicates that the handset runtime was successfully downloaded and configured for QEMU.
== Using a runtime ==
== Using a runtime ==
Line 43: Line 42:
To start the IA32 handset runtime:
To start the IA32 handset runtime:
-
  $ mad remote -r meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime poweron
+
  $ sudo mad remote -r '''<handset runtime name>''' poweron
Here's what the handset image looks like (this is the ''Applications'' zone):
Here's what the handset image looks like (this is the ''Applications'' zone):
Line 50: Line 49:
To start the IA32 netbook runtime:
To start the IA32 netbook runtime:
-
  $ mad remote -r meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime poweron
+
  $ sudo mad remote -r '''<netbook runtime name>''' poweron
Here's what the netbook image looks like (this is ''Myzone''):
Here's what the netbook image looks like (this is ''Myzone''):
Line 59: Line 58:
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:
-
  $ mad remote -r meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime poweroff
+
  $ sudo mad remote -r '''<netbook runtime name>''' poweroff
 +
 
 +
=== Using 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:
 +
 
 +
$ 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.
 +
 
 +
=== Shortcut button in the MeeGo SDK for Windows ===
 +
 
 +
If you are using the MeeGo SDK for Windows, Qt Creator provides a shortcut button to start a QEMU runtime associated with a project, in the bottom left corner:
 +
 
 +
[[File:Meego-sdk-qtcreator-start-emulator-button.png]]
 +
 
 +
Clicking on this has the same effect as starting the QEMU runtime manually (as described above).
 +
 
 +
Once the emulator is running, the button shows a red square. When it is in this state, clicking on the button again stops the emulator.
== SSH into QEMU Image ==
== SSH into QEMU Image ==
Line 85: Line 102:
#* Host name: 127.0.0.1
#* Host name: 127.0.0.1
#* Ports, SSH: 6666
#* 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.
+
#*: Note that the emulator is set up with a redirect from port 6666 on localhost to the SSH port (22) of the emulated device.
#* Ports, Gdb Server: 13219 (the default)
#* Ports, Gdb Server: 13219 (the default)
#: '''Note:''' If this port is not free, you can select another one.
#: '''Note:''' If this port is not free, you can select another one.
Line 92: Line 109:
#* Password: meego
#* Password: meego
# Click '''Apply'''.  
# Click '''Apply'''.  
-
# To test the settings, ensure that the emulated device is running, then click '''Test'''.
+
# To test the settings, make sure that the emulated device is running, then click '''Test'''.
#: If successful, you'll see a dialog box with the message "Device configuration successful".
#: 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.
#: If the message "Could not connect to host" is displayed, check your setting selections and make sure that the network is connected.

Latest revision as of 16:18, 24 June 2011


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.

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

For QEMU, it is important to 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.

It is also possible to build and install QEMU manually. See the QEMU tools page for details.

The best and simplest way to use a MeeGo OS image with QEMU is to use mad-admin to download a runtime, and mad to run it. See the instructions below for how to do this.

Contents

Install a MeeGo Runtime

You can get a list of available runtimes for your version of MADDE with:

$ sudo mad-admin list runtimes
meego-handset-ia32-qemu-1.1.2-runtime                       (installable)
meego-netbook-ia32-qemu-1.1.2-runtime                       (installable)

Run the command below. Replace <runtime name> with one of

  • meego-handset-ia32-qemu-1.1.2-runtime: Run the MeeGo OS with handset UI.
  • meego-netbook-ia32-qemu-1.1.2-runtime: Run the MeeGo OS with netbook UI.
$ sudo mad-admin create -f -e <runtime name>

This will download the runtime (a ~650+ MB .bz2 file) into MADDE's cache directory and decompress it in the runtimes directory. If network/proxy issues prevent the image from downloading, the url for the runtime can be extracted from the MADDE's cache/madde.conf.d/<runtime>.conf file, downloaded manually, and copied into the cache directory. Re-running the above command will now bypass the download and directly decompress the runtime.

After installing, you can check that the runtime is installed by running mad-admin list again.

$ sudo mad-admin list runtimes
meego-handset-ia32-qemu-1.1.2-runtime       (installed)
meego-netbook-ia32-qemu-1.1.2-runtime       (installable)

Note that installed above indicates that the handset runtime was successfully downloaded and configured for QEMU.

Using a runtime

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

To start the IA32 handset runtime:

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

Here's what the handset image looks like (this is the Applications zone):

Sdk-docs-ia32-handset-under-qemu.png

To start the IA32 netbook runtime:

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

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

Sdk-docs-ia32-netbook-under-qemu.png

You can now use this running image as a deployment target for Qt Creator, or log into it manually over SSH (see below).

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

Using 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.

Shortcut button in the MeeGo SDK for Windows

If you are using the MeeGo SDK for Windows, Qt Creator 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 QEMU runtime manually (as described above).

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

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 MADDE 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

Configuring access to an emulated device in Qt Creator

Sdk-docs-QtCreator-configuring-emulator-access.png

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, 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 set up 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
  4. Click Apply.
  5. To test the settings, make sure 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.
  6. Click Close and OK.


Personal tools