mirror of
https://github.com/sickcodes/Docker-OSX.git
synced 2024-11-27 10:45:59 +03:00
Enable interactive QEMU. Remove envsubst since we are already using bash. Add -x flag
This commit is contained in:
parent
cbb7f242d5
commit
2414f466d0
@ -1,5 +1,6 @@
|
|||||||
|Version|Date|Notes|
|
|Version|Date|Notes|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|
|4.3|2021-03-24|Enable interactive QEMU again. Remove envsubst since we are already using bash... Add set -x flag|
|
||||||
|4.2|2021-03-24|Add all ENV variables to each dockerfile for readability. Add RAM allocation buffer and cache drop bug fix. Add kvm and libvirt groups. Add `IMAGE_FORMAT=qcow2` to allow `IMAGE_FORMAT=raw` too.|
|
|4.2|2021-03-24|Add all ENV variables to each dockerfile for readability. Add RAM allocation buffer and cache drop bug fix. Add kvm and libvirt groups. Add `IMAGE_FORMAT=qcow2` to allow `IMAGE_FORMAT=raw` too.|
|
||||||
| |2021-03-19|Use RAM=3 as the default RAM allocation. Add instructions to clear buff/cache.|
|
| |2021-03-19|Use RAM=3 as the default RAM allocation. Add instructions to clear buff/cache.|
|
||||||
| |2021-03-17|Add RAM=max and RAM=half to dynamically select ram at runtime (DEFAULT).|
|
| |2021-03-17|Add RAM=max and RAM=half to dynamically select ram at runtime (DEFAULT).|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Title: Docker-OSX (Mac on Docker)
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
# Author: Sick.Codes https://twitter.com/sickcodes
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
# Version: 4.2
|
# Version: 4.3
|
||||||
# License: GPLv3+
|
# License: GPLv3+
|
||||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
# Website: https://sick.codes
|
# Website: https://sick.codes
|
||||||
@ -205,8 +205,8 @@ RUN git clone --recurse-submodules --depth 1 --branch "${BRANCH}" "${REPO}"
|
|||||||
|
|
||||||
RUN touch Launch.sh \
|
RUN touch Launch.sh \
|
||||||
&& chmod +x ./Launch.sh \
|
&& chmod +x ./Launch.sh \
|
||||||
&& tee -a Launch.sh <<< '#!/bin/sh' \
|
&& tee -a Launch.sh <<< '#!/bin/bash' \
|
||||||
&& tee -a Launch.sh <<< 'set -eu' \
|
&& tee -a Launch.sh <<< 'set -eux' \
|
||||||
&& tee -a Launch.sh <<< 'sudo chown $(id -u):$(id -g) /dev/kvm 2>/dev/null || true' \
|
&& tee -a Launch.sh <<< 'sudo chown $(id -u):$(id -g) /dev/kvm 2>/dev/null || true' \
|
||||||
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
|
&& tee -a Launch.sh <<< 'sudo chown -R $(id -u):$(id -g) /dev/snd 2>/dev/null || true' \
|
||||||
&& tee -a Launch.sh <<< '[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"' \
|
&& tee -a Launch.sh <<< '[[ "${RAM}" = max ]] && export RAM="$(("$(head -n1 /proc/meminfo | tr -dc "[:digit:]") / 1000000"))"' \
|
||||||
@ -340,7 +340,7 @@ CMD sudo touch /dev/kvm /dev/snd "${IMAGE_PATH}" "${BOOTDISK}" "${ENV}" || true
|
|||||||
--height "${HEIGHT:-1080}" \
|
--height "${HEIGHT:-1080}" \
|
||||||
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
--output-bootdisk "${BOOTDISK:=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \
|
||||||
; } \
|
; } \
|
||||||
; ./enable-ssh.sh && envsubst < ./Launch.sh | bash
|
; ./enable-ssh.sh && ./Launch.sh
|
||||||
|
|
||||||
# virt-manager mode: eta son
|
# virt-manager mode: eta son
|
||||||
# CMD virsh define <(envsubst < Docker-OSX.xml) && virt-manager || virt-manager
|
# CMD virsh define <(envsubst < Docker-OSX.xml) && virt-manager || virt-manager
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Title: Docker-OSX (Mac on Docker)
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
# Author: Sick.Codes https://twitter.com/sickcodes
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
# Version: 4.2
|
# Version: 4.3
|
||||||
# License: GPLv3+
|
# License: GPLv3+
|
||||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
# Website: https://sick.codes
|
# Website: https://sick.codes
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#
|
#
|
||||||
# Title: Docker-OSX (Mac on Docker)
|
# Title: Docker-OSX (Mac on Docker)
|
||||||
# Author: Sick.Codes https://twitter.com/sickcodes
|
# Author: Sick.Codes https://twitter.com/sickcodes
|
||||||
# Version: 4.2
|
# Version: 4.3
|
||||||
# License: GPLv3+
|
# License: GPLv3+
|
||||||
# Repository: https://github.com/sickcodes/Docker-OSX
|
# Repository: https://github.com/sickcodes/Docker-OSX
|
||||||
# Website: https://sick.codes
|
# Website: https://sick.codes
|
||||||
|
42
README.md
42
README.md
@ -83,6 +83,7 @@ docker run -it \
|
|||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
sickcodes/docker-osx:latest
|
sickcodes/docker-osx:latest
|
||||||
|
|
||||||
|
docker pull sickcodes/docker-osx:big-sur
|
||||||
# Big Sur
|
# Big Sur
|
||||||
docker run -it \
|
docker run -it \
|
||||||
--device /dev/kvm \
|
--device /dev/kvm \
|
||||||
@ -111,7 +112,7 @@ Create your personal image using `:latest`. Then, extract the image. Afterwards,
|
|||||||
|
|
||||||
The Quick Start command should work out of the box, provided that you keep the following lines. Works in `auto` & `naked` machines:
|
The Quick Start command should work out of the box, provided that you keep the following lines. Works in `auto` & `naked` machines:
|
||||||
|
|
||||||
```dockerfile
|
```
|
||||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
-e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
```
|
```
|
||||||
@ -120,11 +121,48 @@ The Quick Start command should work out of the box, provided that you keep the f
|
|||||||
|
|
||||||
In that case, **remove** the two lines in your command:
|
In that case, **remove** the two lines in your command:
|
||||||
|
|
||||||
```dockerfile
|
```
|
||||||
# -v /tmp/.X11-unix:/tmp/.X11-unix \
|
# -v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
# -e "DISPLAY=${DISPLAY:-:0.0}" \
|
# -e "DISPLAY=${DISPLAY:-:0.0}" \
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### I need VNC to a Remote Host (Secure)
|
||||||
|
|
||||||
|
Now you can direct connect VNC to any image!
|
||||||
|
|
||||||
|
Add the following line:
|
||||||
|
|
||||||
|
`-e EXTRA="-display none -vnc 0.0.0.0:99,password"`
|
||||||
|
|
||||||
|
In the Docker terminal, press `enter` until you see `(qemu)`.
|
||||||
|
|
||||||
|
Type `change vnc password`
|
||||||
|
|
||||||
|
`ip n` will usually show the container IP first.
|
||||||
|
|
||||||
|
Port is `5999`.
|
||||||
|
|
||||||
|
Now VNC connect using the Docker container IP, for example `172.17.0.2:5999`
|
||||||
|
|
||||||
|
You can also find the container IP: `docker inspect <containerid> | jq -r '.[0].NetworkSettings.IPAddress'`
|
||||||
|
|
||||||
|
Remote VNC over SSH: `ssh -N root@1.1.1.1 -L 5999:172.17.0.2:5999`, where `1.1.1.1` is your remote server IP and `172.17.0.2` is your LAN container IP.
|
||||||
|
|
||||||
|
#### I need VNC on localhost (Local use only!)
|
||||||
|
|
||||||
|
##### VNC Insecure
|
||||||
|
|
||||||
|
**NOT TLS/HTTPS Encrypted at all!**
|
||||||
|
```
|
||||||
|
-p 5999:5999
|
||||||
|
-e EXTRA="-display none -vnc 0.0.0.0:99,password"
|
||||||
|
```
|
||||||
|
VNC Connect to `localhost:5999`.
|
||||||
|
|
||||||
|
Or `ssh -N root@1.1.1.1 -L 5999:127.0.0.1:5999`, where `1.1.1.1` is your remote server IP.
|
||||||
|
|
||||||
|
(Note: if you close port 5999 and use the SSH tunnel, this becomes secure.)
|
||||||
|
|
||||||
#### I have used Docker-OSX before and wish to extract my Mac OS X image.
|
#### I have used Docker-OSX before and wish to extract my Mac OS X image.
|
||||||
|
|
||||||
Use `docker commit`, copy the ID, and then run `docker start -ai <Replace this with your ID>`.
|
Use `docker commit`, copy the ID, and then run `docker start -ai <Replace this with your ID>`.
|
||||||
|
Loading…
Reference in New Issue
Block a user