In developing/testing OSS libraries I can replicate a clean Linux fs using containers. However, if I want to test oss libs for MacOS end users, I seem to be in a bit of a quandary. Is there any way to create a clean fs on MacOS that I can test libraries with? Perhaps using chroot? Can someone explain exactly instead of just saying "use chroot"?

2 Answers 2


I don't think you can containerize MacOS, but you could create a Mac OS VM and snapshot it, that way you can easily restore to the same exact Mac OS version for each test.

  • 1
    a VM is a good idea, any more info on how to do? Commented Nov 19, 2018 at 9:46
  • Looks like these instructions to compile Swift code on Linux should suffice? raywenderlich.com/… Commented Nov 19, 2018 at 22:02

From what I can tell so far, the best way to replicate a clean MacOS fs on Linux is to use a VM. These instructions should suffice:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.