@ -493,6 +493,43 @@ sudo nohup dockerd &
sudo systemctl enable docker
```
# How to Forward Additional Ports from the guest.
This is how it visually looks:
`host:10023 <-> 10023:container:10023 <-> 80:guest`
```bash
On the host
```bash
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-e ADDITIONAL_PORTS='hostfwd=tcp::10023-:80,' \
-p 10023:10023 \
sickcodes/docker-osx:auto
```
Inside the container:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install nginx
sudo sed -i -e 's/8080/80/' /usr/local/etc/nginx/nginx.confcd
# sudo nginx -s stop
sudo nginx
```
nginx should appear on the host at port 10023.
You can string multiple statements, for example:
```bash
-e ADDITIONAL_PORTS='hostfwd=tcp::10023-:80,hostfwd=tcp::10043-:443,'
-p 10023:10023 \
-p 10043:10043 \
```
# How to Enable Network Forwarding
Allow ipv4 forwarding for bridged networking connections:
@ -706,11 +743,13 @@ For serial numbers, generate them in `./custom` OR make docker generate them at
At any time, verify your serial number before logging in iCloud, etc.
```bash
# this is a quick way to check your serial number via cli inside OSX
ioreg -l | grep IOPlatformSerialNumber
# or from the host
sshpass -p alpine ssh user@localhost -p 50922 'ioreg -l | grep IOPlatformSerialNumber'
sshpass -p ' alpine' ssh user@localhost -p 50922 'ioreg -l | grep IOPlatformSerialNumber'
```
# This example generates a random set of serial numbers at runtime, headlessly
```bash
# proof of concept only, generates random serial numbers, headlessly, and quits right after.
@ -724,6 +763,8 @@ docker run --rm -it \
sickcodes/docker-osx:auto
```
# This example generates a specific set of serial numbers at runtime
```bash
# run the same as above 17gb auto image, with SSH, with nopicker, and save the bootdisk for later.
# you don't need to save the bootdisk IF you supply specific serial numbers!
@ -743,6 +784,7 @@ docker run -it \
sickcodes/docker-osx:auto
```
### This example generates a specific set of serial numbers at runtime, with your existing image, at 1000x1000 display resolution.
```bash
# run an existing image in current directory, with a screen, with SSH, with nopicker, and save the bootdisk for later.
@ -762,6 +804,8 @@ docker run -it \
-e BOARD_SERIAL="C027251024NJG36UE" \
-e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \
-e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
-e WIDTH=1000 \
-e HEIGHT=1000 \
-e BOOTDISK=/bootdisk \
-v "${PWD}/mynewbootdisk.qcow:/bootdisk" \
-v "${PWD}/mac_hdd_ng.img:/image" \
@ -876,6 +920,97 @@ generate-specific-bootdisk.sh \
--output-bootdisk OpenCore-nopicker.qcow2
```
# Change Resolution Docker-OSX - change resolution OpenCore OSX-KVM
The display resolution is controlled by this line:
https://github.com/sickcodes/Docker-OSX/blob/master/custom/config-nopicker-custom.plist#L819
Instead of mounting that disk, Docker-OSX will generate a new `OpenCore.qcow2` by using this one cool trick:
```bash
-e GENERATE_UNIQUE=true \
-e WIDTH=800 \
-e HEIGHT=600 \
```
To use `WIDTH` /`HEIGHT`, you must use with either `-e GENERATE_UNIQUE=true` or `-e GENERATE_SPECIFIC=true` .
It will take around 30 seconds longer to boot because it needs to make a new boot partition using `libguestfs` .
```bash
-e GENERATE_SPECIFIC=true \
-e WIDTH=1920 \
-e HEIGHT=1080 \
-e SERIAL="" \
-e BOARD_SERIAL="" \
-e UUID="" \
-e MAC_ADDRESS="" \
```
## Change Docker-OSX Resolution Examples
```bash
# using an image in your current directory
stat mac_hdd_ng.img
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-v "${PWD}/mac_hdd_ng.img:/image" \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
-e GENERATE_SPECIFIC=true \
-e DEVICE_MODEL="iMacPro1,1" \
-e SERIAL="C02TW0WAHX87" \
-e BOARD_SERIAL="C027251024NJG36UE" \
-e UUID="5CCB366D-9118-4C61-A00A-E5BAF3BED451" \
-e MAC_ADDRESS="A8:5C:2C:9A:46:2F" \
-e MASTER_PLIST_URL=https://raw.githubusercontent.com/sickcodes/Docker-OSX/master/custom/config-nopicker-custom.plist \
-e WIDTH=1600 \
-e HEIGHT=900 \
sickcodes/docker-osx:naked
```
```bash
# generating random serial numbers, using the DIY installer, along with the screen resolution changes.
docker run -it \
--device /dev/kvm \
-p 50922:10022 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e "DISPLAY=${DISPLAY:-:0.0}" \
-e GENERATE_UNIQUE=true \
-e WIDTH=800 \
-e HEIGHT=600 \
sickcodes/docker-osx:latest
```
Here's a few other resolutions! If you resolution is invalid, it will default to 800x600.
```
-e WIDTH=800 \
-e HEIGHT=600 \
```
```
-e WIDTH=1280 \
-e HEIGHT=768 \
```
```
-e WIDTH=1600 \
-e HEIGHT=900 \
```
```
-e WIDTH=1920 \
-e HEIGHT=1080 \
```
```
-e WIDTH=2560 \
-e HEIGHT=1600 \
```
# Allow USB passthrough
The simplest way to do this is the following: