Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-osx:auto ssh connection refused #330

Closed
BriniM opened this issue Aug 20, 2021 · 5 comments
Closed

Docker-osx:auto ssh connection refused #330

BriniM opened this issue Aug 20, 2021 · 5 comments

Comments

@BriniM
Copy link

BriniM commented Aug 20, 2021

I have pulled the docker-osx:auto, and installed the tools mentioned in the initial setup section of the readme. Ran it with:

docker run -it \
    --device /dev/kvm \
    -p 50922:10022 \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e "DISPLAY=${DISPLAY:-:0.0}" \
    -e "OSX_COMMANDS=/bin/bash -c \"pwd && uname -a\"" \
    sickcodes/docker-osx:auto

Outputs this indefinitely:

By using this Dockerfile, you hereby agree that you are a security reseacher or developer and agree to use this Dockerfile to make the world a safer place. Examples include: making your apps safer, finding your mobile phone, compiling security products, etc. You understand that Docker-OSX is an Open Source project, which is released to the public under the GNU Pulic License version 3 and above. You acknowledge that the Open Source project is absolutely unaffiliated with any third party, in any form whatsoever. Any trademarks or intelectual property which happen to be mentioned anywhere in or around the project are owned by their respective owners. By using this Dockerfile, you agree to agree to the EULA of each piece of upstream or downstream software. The following code is released for the sole purpose of security research, under the GNU Public License version 3. If you are concerned about the licensing, please note that this project is not AGPL. A copy of the license is available online: https://github.com/sickcodes/Docker-OSX/blob/master/LICENSE. In order to use the following Dockerfile you must read and understand the terms. Once you have read the terms, use the -e TERMS_OF_USE=i_agree or -e TERMS_OF_USE=i_disagree
Disk is being copied between layers... Please wait a minute...
  File: /home/arch/OSX-KVM/mac_hdd_ng.img
  Size: 19139461120	Blocks: 37381768   IO Block: 4096   regular file
Device: 38h/56d	Inode: 7212318     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/    arch)   Gid: ( 1000/    arch)
Access: 2021-08-20 20:02:30.548687427 +0000
Modify: 2021-08-20 20:02:30.548687427 +0000
Change: 2021-08-20 20:02:31.152686571 +0000
 Birth: 2021-08-20 19:56:26.141125831 +0000
Large image is being copied between layers, please wait a minute...
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 
nohup: appending output to 'nohup.out'
Booting Docker-OSX in the background. Please wait...
++ id -u
++ id -g
+ sudo chown 1000:1000 /dev/kvm
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ [[ 3 = max ]]
+ [[ 3 = half ]]
++ id -u
++ id -g
+ sudo chown -R 1000:1000 /dev/snd
+ exec qemu-system-x86_64 -m 3000 -cpu Penryn,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check, -machine q35,accel=kvm:tcg -smp 4,cores=4 -usb -device usb-kbd -device usb-tablet -device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' -drive if=pflash,format=raw,readonly,file=/home/arch/OSX-KVM/OVMF_CODE.fd -drive if=pflash,format=raw,file=/home/arch/OSX-KVM/OVMF_VARS-1024x768.fd -smbios type=2 -audiodev alsa,id=hda -device ich9-intel-hda -device hda-duplex,audiodev=hda -device ich9-ahci,id=sata -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore-nopicker.qcow2 -device ide-hd,bus=sata.2,drive=OpenCoreBoot -drive id=MacHDD,if=none,file=/home/arch/OSX-KVM/mac_hdd_ng.img,format=qcow2 -device ide-hd,bus=sata.4,drive=MacHDD -netdev user,id=net0,hostfwd=tcp::10022-:22,hostfwd=tcp::5900-:5900, -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:09:49:17 -monitor stdio -vga vmware
/usr/sbin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/arch/.ssh/id_docker_osx.pub"
ssh: connect to host 127.0.0.1 port 10022: Connection refused
Disk is being copied between layers. Repeating until able to copy SSH key into OSX...

Help wanted

@BriniM
Copy link
Author

BriniM commented Aug 20, 2021

Similar to #174

@sickcodes
Copy link
Owner

Disk is being copied between layers. Repeating until able to copy SSH key into OSX...

https://github.com/sickcodes/Docker-OSX/blob/master/Dockerfile.auto#L239-L242

until [[ "$(sshpass -palpine ssh-copy-id -f -i ~/.ssh/id_docker_osx.pub -p 10022 [email protected])" ]]; do \
        echo "Disk is being copied between layers. Repeating until able to copy SSH key into OSX..." \
        ; sleep 1 \
    ; done

It keeps trying to put the key in until it's done, you'll get errors until it's fully booted

@BriniM
Copy link
Author

BriniM commented Aug 20, 2021

It's taking quite some time, I'll leave it running overnight and get back to you with results.

Thanks 😁

@BriniM
Copy link
Author

BriniM commented Aug 31, 2021

Had it run for an entire night, didn't boot up. Will maybe give the project another shot when I switch to another distro.

@BriniM BriniM closed this as completed Aug 31, 2021
@ZGuQing
Copy link

ZGuQing commented Jun 7, 2022

This error also occurs when running multiple containers locally, perhaps because port 10022 is already occupied. How to solve this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants