Xfce4-panel not starting with eror

Hello, I am new to LXC, I came across this on Kali Linux and spend the weekend, wiping off my fedora and putting Ubuntu on my laptop and installed LXC. I’ve tested the GUI on the Kali container. xclock, zapproxy, and Burp works. xfce4-panel is throwing an error, I am thinking it may be related to xfce4-panel and not LXC. but I would like to hear what others think about the error.

cmd: “lxc exec gui-kali – sudo -u kali xfce4-panel”

(xfce4-panel:883): dbind-WARNING **: 17:16:34.038: Couldn’t connect to accessibility bus: Failed to connect to socket /tmp/dbus-ZzdhSAPJXN: Connection refused
Gtk-Message: 17:16:34.079: Failed to load module “canberra-gtk-module”
Gtk-Message: 17:16:34.081: Failed to load module “canberra-gtk-module”

(xfce4-panel:883): xfce4-panel-WARNING **: 17:16:34.085: Failed to connect to the D-BUS session bus: Failed to execute child process “dbus-launch” (No such file or directory)
xfce4-panel: There is already a running instance


The dbus-launch command is missing in your container, you’ll need to install whatever package provides that.

The other problem is that you apparently can only have one instance of xfce4-panel per X server and you already have one of those running (presumably your main desktop session).

I think you have followed the tutorial at https://www.kali.org/docs/containers/kalilinux-lxc-images/
I did not know about this tutorial, thanks for bringing it to our attention.

Indeed, xfce-panel (a window manager) should not be able to work on an X server because you are already a window manager for your desktop. Perhaps @re4ason is running a desktop with Wayland, hence it is possible to launch an X11 window manager?
Normally, you can run individual graphics applications from within the container (with hardware acceleration) using the instructions in the tutorial.

See also https://blog.simos.info/using-the-lxd-kali-container-image/ on how to attach USB devices like WiFi adapters to the LXD container.

See also https://blog.simos.info/how-to-use-the-x2go-remote-desktop-with-lxd-containers/ which shows how to setup X2Go on the host and in the container (the Kali container in your case). By doing so, you can definitely have an X desktop session running in the container, and the desktop will appear in a window (like with Remote Desktop). The only downside is that there is no hardware acceleration, though few security tools would require such a feature.

edit: here is the source of the Kali LXD tutorial, https://gitlab.com/kalilinux/documentation/kali-docs/-/tree/master/containers/kalilinux-lxc-images