Personally, I'd suggest using something like Vagrant instead - more lightweight in my opinion, in terms of being able to instantly destroy & create a new one with 2 commands.
Although, saying this, there's no reason the OP can't just install Linux over (or alongside) OS X.
Although, saying this, there's no reason the OP can't just install Linux over (or alongside) OS X.