Use Xnest.
Use Xephyr. It's an X server whose backend is an X window.
Recommendation taken from packages.debian.org:
Use of the Xephyr X server instead of Xnest is recommended.
— https://packages.debian.org/wheezy/xnest
Xephyr is an X server that can be run inside another X server, much like Xnest. It is based on the kdrive X server, and as a result it supports newer extensions than Xnest, including render and composite.