← 返回命令列表

Linux command

Xnest 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start nested X server on display :1

Xnest :1

Start with specific window size

Xnest :1 -geometry [800x600]

Start with multiple screens

Xnest :1 -scrns [2]

Connect to specific parent display

Xnest :1 -display [:0]

Start fullscreen

Xnest :1 -fullscreen

说明

Xnest is both an X client and an X server. It runs as a window within another X server (the parent), appearing as a regular X client to the parent while providing a complete X server environment to its own clients. Applications connect to Xnest using its display number (e.g., `:1`) and receive a fully functional X environment. Multiple screens can be referenced by the number after the dot in the display name (e.g., `xterm -display :1.1` for the second screen). This enables testing window managers, running isolated X sessions, or displaying remote X applications in a contained window. Xnest manages fonts by loading them locally and passing the font name to the real server. For better performance and modern X extension support, Xephyr is recommended as a replacement.

参数

-display _name_
Parent X server to connect to. Defaults to DISPLAY environment variable.
-geometry _WxH+X+Y_
Window geometry for the nested server.
-scrns _num_
Number of screens to create.
-depth _n_
Default color depth.
-fullscreen
Run fullscreen on the parent display.
-bw _n_
Border width in pixels.
-name _string_
Window name for the nested server.
-sss
Enable separate screen saver for each screen.
-sync
Synchronize window and graphics operations with the parent server. Useful for debugging but significantly slows performance.

FAQ

What is the Xnest command used for?

Xnest is both an X client and an X server. It runs as a window within another X server (the parent), appearing as a regular X client to the parent while providing a complete X server environment to its own clients. Applications connect to Xnest using its display number (e.g., `:1`) and receive a fully functional X environment. Multiple screens can be referenced by the number after the dot in the display name (e.g., `xterm -display :1.1` for the second screen). This enables testing window managers, running isolated X sessions, or displaying remote X applications in a contained window. Xnest manages fonts by loading them locally and passing the font name to the real server. For better performance and modern X extension support, Xephyr is recommended as a replacement.

How do I run a basic Xnest example?

Run `Xnest :1` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -display _name_ do in Xnest?

Parent X server to connect to. Defaults to DISPLAY environment variable.