LXC containers (“chroots on steroids”) need /dev/shm/ mounted read/write for user accounts.
The permissions on /dev/shm/ need to be as follows:
# ls -ld /dev/shm/ drwxrwxrwt 2 root root 40 2012-11-20 20:34 shm
To make sure the permissions are correct even after a reboot, make sure /etc/fstab contains a line similar to the following:
none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0
Note that alongside /dev/shm problems, resolving hostnames (especially localhost to 127.0.0.1, or inversely, 127.0.0.1 to localhost) have also been reported.