Change "ignore ownership on this volume" from the command line for Mac OS X volume
You use diskutil for that. See diskutil(1) under enableOwnership and disableOwnership. Note that this setting is specific to a particular operating system installation, since it is stored in /var/db/volinfo.database. I.e., if you copy the disk image to a new computer the setting won't persist, but it does persist across reboots, mounts, umounts, etc. all on a single computer.

Use diskutil to find the identifier, then change the option:

$ diskutil list
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                            Disk Image             *41.0 MB    disk2
$ sudo diskutil enableOwnership disk2
File system user/group ownership enabled