From 2077c3a45354ed6beb753afaed49d789d94a25b6 Mon Sep 17 00:00:00 2001 From: sickcodes Date: Thu, 4 Mar 2021 13:22:13 +0000 Subject: [PATCH] v4.1 WIDTH/HEIGHT && move resolution README note --- CHANGELOG.md | 4 +- Dockerfile | 9 ++-- Dockerfile.auto | 9 ++-- Dockerfile.naked | 9 ++-- README.md | 123 +++++++++++++++++++++++++++++++++++------------ 5 files changed, 109 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abc2d75..5fc75bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ |Version|Date|Notes| |---|---|---| -| |2021-03-04|Add `-e MASTER_PLIST_URL` to all images to allow using your own remote plist.| -| |2021-03-03|Add WIDTH and HEIGHT to set the x and y resolutions, use in conjuction with serial numbers.| +|4.1|2021-03-04|Add `-e MASTER_PLIST_URL` to all images to allow using your own remote plist.| +| |2021-03-03|Add `WIDTH` and `HEIGHT` to set the x and y resolutions, use in conjuction with serial numbers.| | |2021-03-02|Add ADDITIONAL_PORTS, for example `-e ADDITIONAL_PORTS='hostfwd=tcp::23-:23,'`| |4.0|2021-02-27|Add big-sur support. Use `sickcodes/docker-osx:big-sur` or build using `--build-arg VERSION=11`| | |2021-02-26|Change `-e NOPICKER=true` to simply do `sed -i '/^.*InstallMedia.*/d' Launch.sh` and `export BOOTDISK=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2`.| diff --git a/Dockerfile b/Dockerfile index 61464b8..756773d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,12 @@ # / /_/ / /_/ / /__/ ,< / __/ / / /_/ /___/ / | # /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| # -# Repo: https://github.com/sickcodes/Docker-OSX/ -# Title: Mac on Docker (Docker-OSX) -# Author: Sick.Codes https://sick.codes/ -# Version: 4.0 +# Title: Docker-OSX (Mac on Docker) +# Author: Sick.Codes https://twitter.com/sickcodes +# Version: 4.1 # License: GPLv3+ +# Repository: https://github.com/sickcodes/Docker-OSX +# Website: https://sick.codes # # All credits for OSX-KVM and the rest at @Kholia's repo: https://github.com/kholia/osx-kvm # OpenCore support go to https://github.com/Leoyzen/KVM-Opencore diff --git a/Dockerfile.auto b/Dockerfile.auto index 1e0c84e..7586eee 100644 --- a/Dockerfile.auto +++ b/Dockerfile.auto @@ -3,13 +3,14 @@ # / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ / # / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| / # / /_/ / /_/ / /__/ ,< / __/ / / /_/ /___/ / | -# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| AUTOINSTALL +# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| :AUTO # -# Title: Mac on Docker (Docker-OSX) [AUTOINSTALL] -# Author: Sick.Codes https://twitter.com/sickcodes -# Version: 4.0 +# Title: Docker-OSX (Mac on Docker) +# Author: Sick.Codes https://twitter.com/sickcodes +# Version: 4.1 # License: GPLv3+ # Repository: https://github.com/sickcodes/Docker-OSX +# Website: https://sick.codes # # This Dockerfile is a pre-installed naked installation of Docker-OSX! # diff --git a/Dockerfile.naked b/Dockerfile.naked index 6ac5333..b8ffb3f 100644 --- a/Dockerfile.naked +++ b/Dockerfile.naked @@ -3,13 +3,14 @@ # / __ \____ _____/ /_____ _____/ __ \/ ___/ |/ / # / / / / __ \/ ___/ //_/ _ \/ ___/ / / /\__ \| / # / /_/ / /_/ / /__/ ,< / __/ / / /_/ /___/ / | -# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| NAKED/SUPPLY_YOUR_OWN +# /_____/\____/\___/_/|_|\___/_/ \____//____/_/|_| :NAKED # -# Title: Mac on Docker (Docker-OSX) [AUTOINSTALL] -# Author: Sick.Codes https://twitter.com/sickcodes -# Version: 4.0 +# Title: Docker-OSX (Mac on Docker) [AUTOINSTALL] +# Author: Sick.Codes https://twitter.com/sickcodes +# Version: 4.1 # License: GPLv3+ # Repository: https://github.com/sickcodes/Docker-OSX +# Website: https://sick.codes # # This image won't run unless you supply a disk image using: # -v ${PWD}/mac_hdd_ng.img:/image diff --git a/README.md b/README.md index 08cf699..9a2c07c 100644 --- a/README.md +++ b/README.md @@ -784,7 +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. +### 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. @@ -824,36 +824,6 @@ Or you can generate them inside the `./custom` folder. And then use: -e MAC_ADDRESS="" \ ``` -# Change Resolution Docker-OSX - -The display resolution is controlled by this line: - -https://github.com/sickcodes/Docker-OSX/blob/master/custom/config-nopicker-custom.plist#L819 - -However, you need to mount that disk. Boring! - -Instead, you can simply add the following to any image: - -```bash --e GENERATE_UNIQUE=true \ --e WIDTH=1920 \ --e HEIGHT=1080 \ -``` - -It will take around 1 minute longer to boot because it will make a new boot partition. - -```bash --e GENERATE_SPECIFIC=true \ --e WIDTH=1920 \ --e HEIGHT=1080 \ --e SERIAL="" \ --e BOARD_SERIAL="" \ --e UUID="" \ --e MAC_ADDRESS="" \ -``` - -Must be used with either `-e GENERATE_UNIQUE=true` or `-e GENERATE_SPECIFIC=true`. - #### Persistence from generating serial numbers is obviously ideal: ```bash @@ -950,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: