How to run plasma in chroot or nspawn

I use Xnest to make a virt xorg server,and i forward startplasma_x11 to it(set the variable DISPLAY=:2)
It can load the splash screen but black sreen after a while,this might be due to the dead of kwin
Here’s my log in container

"kapplymousetheme" ("breeze_cursors", "24") exited with code 255
kdeinit5: preparing to launch '/usr/lib/kf5/klauncher'
kdeinit5: Launched KLauncher, pid = 514, result = 0
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
kdeinit5: opened connection to :2
kdeinit5: Got SETENV 'GTK_RC_FILES=/etc/gtk/gtkrc:/home/safety/.gtkrc:/home/safety/.config/gtkrc' from launcher.
kdeinit5: Got SETENV 'GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/safety/.gtkrc-2.0:/home/safety/.config/gtkrc-2.0' from launcher.
org.kde.plasma.session: process job  "kcminit_startup" finished with exit code  0
Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5089:46: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5091:48: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5093:48: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5097:47: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5099:46: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5107:48: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5111:46: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5113:46: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5117:45: this compose sequence is a duplicate of another; skipping line
kwin_xkbcommon: XKB: /usr/share/X11/locale/en_US.UTF-8/Compose:5120:46: this compose sequence is a duplicate of another; skipping line
Qt: Session management error: networkIdsList argument is NULL
kdeinit5: Got SETENV 'SESSION_MANAGER=local/manjaro:@/tmp/.ICE-unix/555,unix/manjaro:/tmp/.ICE-unix/555' from launcher.
kdeinit5: Got SETENV 'SESSION_MANAGER=local/manjaro:@/tmp/.ICE-unix/555,unix/manjaro:/tmp/.ICE-unix/555' from launcher.
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/xembedsniproxy.desktop" ("/usr/bin/xembedsniproxy")
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/baloo_file.desktop" ("/usr/lib/baloo_file")
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/org.kde.plasmashell.desktop" ("/usr/bin/plasmashell")
kwin_core: Compositing is not possible
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/gmenudbusmenuproxy.desktop" ("/usr/bin/gmenudbusmenuproxy")
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/pulseaudio.desktop" ("/usr/bin/start-pulseaudio-x11")
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/restore_kmix_volumes.desktop" ("/usr/bin/kmixctrl", "--restore")
Failed to register via dbus. Another instance is running
kwin_core: Failed to update gamma ramp for output KWin::X11PlaceholderOutput(0x7f9a000044d0, name="Placeholder-0", geometry=QRect(0,0 1440x810), scale=1)
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/org.kde.kdeconnect.daemon.desktop" ("/usr/lib/kdeconnectd")
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/org.kde.korgac.desktop" ("/usr/bin/korgac")
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/geoclue-demo-agent.desktop" ("/usr/lib/geoclue-2.0/demos/agent")
QObject::connect: No such signal QDBusAbstractInterface::StateChanged(uint)
print-manager.kded: unable to register service to dbus
Aborting shell load: The activity manager daemon (kactivitymanagerd) is not running.
If this Plasma has been installed into a custom prefix, verify that its D-Bus services dir is known to the system for the daemon to be activatable.
starting invalid corona "org.kde.plasma.desktop"
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 678, resource id: 23068677, major code: 18 (ChangeProperty), minor code: 0
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/msm_kde_notifier.desktop" ("/usr/bin/msm_kde_notifier")
org.kde.plasma.session: Starting autostart service  "/etc/xdg/autostart/kmix_autostart.desktop" ("/usr/bin/kmix", "--keepvisibility")
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
Starting accounts migration...
Registering ":1.53/StatusNotifierItem" to system tray
percent 5 -> divisor 20
kdeconnect.core: "Failed to bind UDP socket on port" 1716 "with error" "AddressInUseError"
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
Registering ":1.58/StatusNotifierItem" to system tray
Registering ":1.59/StatusNotifierItem" to system tray
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
org.kde.kmix: no mix devices and not dynamic
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 730, resource id: 4194321, major code: 18 (ChangeProperty), minor code: 0
kdeconnect.core: Could not query capabilities from notifications server
"poppler-data"
"qt5-translations"
``

Possibly related:

If it is … then I guess you can go ahead and try disabling/replacing SDDM
(though not with the instructions there as they are for ubuntu or something)

Btw i’m not using a login manager to launch my desktop


After this it dead