Configuration examples

Updated: April 19, 2023

Note: See the Screen Developer's Guide for details on how Screen defines displays, including default displays.

Guest and host take turns using the default display

Using a simple configuration, you can enable a guest and host to take turns using the default display.

The following configuration sets up three MMIO input vdevs, each presenting itself as a different input device. When the guest window is in focus, the events related to these devices are passed to the guest.

vdev virtio-input
   loc 0x1c0d0000
   intr gic:43
   screen keyboard
   window *

vdev virtio-input
   loc 0x1c0e0000
   intr gic:44
   screen mouse
   window *

vdev virtio-input
   loc 0x1c0f0000
   intr gic:45
   screen multi-touch
   window *

Guest isn't on the default display

If a guest isn't on the default display, you need to create a Screen application window on the display that contains the guest. You can do this by one of the following ways:
Specify a window
An application window is associated with a window ID, which you must pass as the argument to the vdev's window option. In the following example, 1 is the window ID of the window on the display that's showing the guest system:
vdev virtio-input
   loc 0x1c0d0000
   intr gic:43
   screen keyboard
   window 1
Specify a display
A display is associated with a display ID, which you must pass as the argument to the vdev's display option. In the following example, 2 is the display ID of the the display on which Screen creates an application window:
vdev virtio-input
   loc 0x1c0d0000
   intr gic:43
   screen keyboard
   display 2