Advanced QEMU Options

This section contains advanced and less frequently used QEMU options.
Before using these options, make sure you are familiar with the QEMU Options and Commands section.



Display Options

QEMU can provide a virtual monitor for display applications.

This virtual monitor can display using curses, GTK (GNOME ToolKit), or SDL (Simple DirectMedia Layer), libraries.
More information on these libraries can be found using the links above.

When using display options to create a display, do not pass the -nographic option in the command line.

Petalinux QEMU does not include SDL support for display emulation. It is recommended that you build QEMU from source with SDL enabled.


OptionDescriptionExample
-display gtk
Creates a display output in a GTK window.
-display gtk
-display sdl
Creates a display output via SDL, usually in another window.
-display sdl
-display curses

Creates a display output via curses.

Note: Nothing is displayed when the graphics device is in graphical mode, or if the graphics device does not support a text mode.

-display curses
-vnc <hostname>:<display ID>
Creates a VNC session on hostname through which you can view the display display ID.
The VNC session will listen on port 5900+X, where X is the display ID.
-vnc localhost:1

Creates a VNC session on localhost for display 1.  The VNC port is 5901.

-vnc <hostname>:<TCP port>,reverse

Creates a listening VNC session for host hostname on port TCP port.
The port should be 5500+X to listen for a session with display ID X.

-vnc localhost:5501,reverse

Listens for a VNC session on localhost with display 1.

Connecting to a VNC session

The following section can be done with either TightVNC or RealVNC.

To connect to the monitor on localhost, use the command:

vncviewer localhost:<display ID>

To connect to the monitor for a different server, enable port forwarding using the command:

ssh <target-host> -L <localhost-port>:localhost:<target-host-port>

For example, if the display ID passed into QEMU is 1, the TCP port is 5901.  This makes the port forwarding command:

ssh qemu-host -L 5901:localhost:5901

Now the previous vncviewer command can be used to open the display.

© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy