My dad had his sub in a cabinet in his built-into-the-wall entertainment center. Sounded really bad at first as the whole entertainment center was vibrating and rattling. As the books, components, etc went in, most of the vibrations and rattling went away (or was greatly reduced) and the sound improved a good deal. Not great, but better than when the entertainment center was empty.
If you need to put it in another enclosure then I'd try and make that sucker fairly dense to keep resonances to a minimum. Won't be optimal, but better than no sub at all.