It's been a while since I last used jails, but from what I can remember sockets are disabled be default, you can enable them by setting the sysctl
security.jail.allow_raw_sockets.
In addition, starting X by executing
/usr/local/bin/twm won't work inside or outside of a jail, use
xinit(1) and add
exec /usr/local/bin/twm to your ~/.xinitrc
You can also use
startx(1) which is a wrapper around xinit to provide
xauth(1) support.