If you're like me and this doesn't work because you've moved on to Wayland, I was able to run it as follows:
# Xwayland :2 &
# export DISPLAY=:2
# ./xantfarmCame here to reminisce about xroach.
Back in the day, it wasn't uncommon that the security configuration of an X workstation was open to external windows/display. e.g. you could run a program on your system, but target your neighbor's display.
I think universities did this to make it easier to help/troubleshoot a workstation remotely, but once you figured out the commands, xroach was one of my favorites to run on another machine.
https://acme.com/software/xantfarm/