Files

56 lines
1.8 KiB
Markdown

# macOS VM
This directory contains the `docker-compose.yaml` for running a macOS virtual machine within Podman (or Docker). This setup is highly hardware-specific due to the use of `/dev/kvm` and direct device access, making it unsuitable for a Swarm environment.
## Running with Podman Compose
To run this service using `podman-compose`:
1. **Important**: Ensure your host system meets the requirements for running KVM-accelerated VMs (e.g., `/dev/kvm` is available and configured).
2. Navigate to this directory:
```bash
cd optimized/standalone/MacOS
```
3. Start the service:
```bash
podman-compose up -d
```
## Running with Podman
You can run the macOS VM directly with Podman. Pay close attention to the device mappings and network configuration.
```bash
podman run -d \
--name macos \
--restart always \
-e VERSION="15" \
-e DISK_SIZE="50G" \
-e RAM_SIZE="6G" \
-e CPU_CORES="4" \
--device /dev/kvm \
--device /dev/net/tun \
--cap-add NET_ADMIN \
-p 8006:8006 \
-p 5900:5900/tcp \
-p 5900:5900/udp \
-v ./macos:/storage \
dockurr/macos
```
**Note**: The original `docker-compose.yaml` defines a custom network with a specific `ipv4_address`. To replicate this with `podman run`, you would first need to create the network:
```bash
podman network create --subnet 172.70.20.0/29 macos
```
Then, you would need to attach the container to this network and specify the IP:
```bash
# ... (previous podman run command parts)
--network macos --ip 172.70.20.3 \
dockurr/macos
```
## Notes
* This service requires significant host resources and direct hardware access.
* The `stop_grace_period` is important for proper VM shutdown.
* Ensure the `./macos` directory exists and has appropriate permissions for the VM storage.