LinuxCommandLibrary

xephyr

Run nested X server in a window

TLDR

Create a black window with display ID ":2"

$ Xephyr -br -ac -noreset -screen [800x600] [:2]
copy

Start an X application on the new screen
$ DISPLAY=:2 [command_name]
copy

SYNOPSIS

xephyr [options] [:displaynumber]

PARAMETERS

-ac
    Disable access control restrictions. Allows any client to connect.

-screen widthxheight
    Specify the initial screen dimensions in pixels.

-br
    Creates a root window that is black (useful for testing).

-no-host-access
    Disables host-based access control (similar to -ac, but applies more broadly).

-host-access
    Enables host based access control. This is the default behavior.

:displaynumber
    Specifies the display number for the nested X server (e.g., :1).

DESCRIPTION

Xephyr is a display server implementing the X11 protocol. Unlike a traditional X server that drives a physical display, Xephyr operates within a window of an existing X server. This "nested" setup is primarily used for testing X applications in a sandboxed environment, debugging X servers, or providing virtual display environments without requiring dedicated hardware.

It's especially valuable for developing and testing X server extensions or modifications, allowing developers to experiment without impacting the primary display system. Xephyr also facilitates running X applications with different configurations or security settings, isolated from the user's main desktop. Because of its nested nature, it may not provide the same performance as a traditional X server driving a physical display.

CAVEATS

Xephyr's performance is generally lower than a traditional X server due to the overhead of the nested environment. It's not intended for everyday use as a primary display but rather for testing and development. Some applications may exhibit graphical glitches or performance issues within Xephyr.

USAGE EXAMPLE

To start Xephyr on display :2 with a screen size of 800x600, use the command:
xephyr -screen 800x600 :2
Then set the DISPLAY environment variable to ':2' (export DISPLAY=:2) to direct applications to use the nested server.

HISTORY

Xephyr was developed as a lightweight, easy-to-use nested X server, initially as a replacement for other solutions like Xnest that had limitations or were no longer actively maintained. It's been used in the X.org community for years as a standard tool for testing and development of X server components.

SEE ALSO

Xorg(1), Xvnc(1)

Copied to clipboard