LXD container on remote Unix server, trying to get gui on my laptop


I am able to login into a remote UNIX server using ssh -Y <username>@<IP> and then I can execute xclock in the terminal and I see a clock on my personal laptop. I checked that echo ${DISPLAY} returns localhost:10.0, and using netstat -l -n, I figured that this corresponds to Note that I do not have root access to the Unix server.

Now want to see a clock on my laptop when I create an LXD container inside the remote Unix server.

After searching on this topic, and after reading this, I used the following profile:

config: {}
description: X11 Unix Socket for X11 Forwarding
    bind: container
    connect: tcp:
    listen: unix:@/tmp/.X11-unix/X0
    security.gid: "1008"
    security.uid: "1008"
    type: proxy
name: x11-socket

Note: I made minimal changes to the blog post here. Also, my user id is 1008, so I used that instead of 1000. Then I create a container, add this x11-socket profile, and execute it. Now inside the container, when I call xclock, I get the message:

X11 connection rejected because of wrong authentication.
Error: Can't open display: :0

I followed the documentation thoroughly; but I am unable to figure out what is wrong.