<p>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.</p>

CC BY-SA 4.0
2018-11-19T09:46:42.513Z
a VM is a good idea, any more info on how to do?
Alexander Mills
CC BY-SA 4.0
2018-11-19T22:02:47.427Z
Looks like these instructions to compile Swift code on Linux should suffice? https://www.raywenderlich.com/1448-introduction-to-open-source-swift-on-linux
Alexander Mills
CC BY-SA 4.0
2018-11-19T09:24:39.150Z
2018-11-19T09:24:39.150Z
Brandon Helwig
<p>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:</p>

<p><a href="https://www.raywenderlich.com/1448-introduction-to-open-source-swift-on-linux" rel="nofollow noreferrer">https://www.raywenderlich.com/1448-introduction-to-open-source-swift-on-linux</a></p>

CC BY-SA 4.0
2018-11-19T22:03:25.137Z
2018-11-19T22:03:25.137Z
Alexander Mills
<p>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 <code>chroot</code>? Can someone explain exactly instead of just saying "use chroot"?</p>

<containers><macos>
Create clean/blank MacOS fs on MacOS or Linux
Alexander Mills
# Create clean/blank MacOS fs on MacOS or Linux

(Asked by: username_0 on 2018-11-18)

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"?

**Tags:** containers, macos


---

## 2 answers

### Answer by username_1 on 2018-11-19. Score: 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.

> **Comments:**
> **username_0**: a VM is a good idea, any more info on how to do?  
> **username_0**: Looks like these instructions to compile Swift code on Linux should suffice? https://www.raywenderlich.com/1448-introduction-to-open-source-swift-on-linux  

---

### Answer by username_0 on 2018-11-19. Score: 0

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:

<https://www.raywenderlich.com/1448-introduction-to-open-source-swift-on-linux>


---

