sickcodes / Docker-OSX

Run macOS VM in a Docker! Run near native OSX-KVM in Docker! X11 Forwarding! CI/CD for OS X Security Research! Docker mac Containers.
https://hub.docker.com/r/sickcodes/docker-osx
GNU General Public License v3.0
36.1k stars 1.78k forks source link

Installing hangs and container becomes dead #308

Open MundaneAdvice opened 2 years ago

MundaneAdvice commented 2 years ago

Hello,

While installing the OS, after doing partition, it went smooth till "3 Min Remaining' dialogue but after that it reboots and moves no where. I have tried it multiple times suspecting docker issue and even manually updated it to latest stable above of snap with deleting the inactive containers, but nothing helps. Below are the snapshots of system and applications >

Linux declut 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux :0 [sudo] password for heyeven: 1 NAME="Ubuntu" PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_CODENAME=focal UBUNTU_CODENAME=focal Filesystem Size Used Avail Use% Mounted on /dev/nvme0n1p2 457G 69G 366G 16% / QEMU emulator version 6.0.50 (v6.0.0-2231-g73c8bf4ccf) Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers libvirtd (libvirt) 6.0.0 total used free shared buff/cache available Mem: 31Gi 1.8Gi 17Gi 100Mi 11Gi 28Gi Swap: 2.0Gi 0B 2.0Gi 6 12 crw-rw----+ 1 heyeven heyeven 10, 232 Jul 7 14:40 /dev/kvm total 32K drwxrwxrwt 2 root root 4.0K Jul 7 08:38 . drwxrwxrwt 24 root root 24K Jul 7 14:42 .. srwxrwxrwx 1 heyeven heyeven 0 Jul 7 08:38 X0 srwxrwxr-x 1 gdm gdm 0 Jul 7 08:38 X1024 srwxrwxr-x 1 gdm gdm 0 Jul 7 08:38 X1025 root 1866 0.0 0.2 1169000 90628 ? Ssl 14:08 0:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock heyeven 7683 0.0 0.0 17672 732 pts/0 S+ 14:48 0:00 grep --color=auto dockerd kvm:x:108: libvirt:x:136:heyeven libvirt-qemu:x:64055:libvirt-qemu libvirt-dnsmasq:x:137: docker:x:1001:heyeven

docker -v

Docker version 20.10.7, build f0df350

qemu-system-x86_64 --version

QEMU emulator version 6.0.50 (v6.0.0-2231-g73c8bf4ccf) Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers #

docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

docker ps --all --filter "ancestor=sickcodes/docker-osx"

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b34316a4d731 sickcodes/docker-osx "/bin/bash -c 'sudo …" 28 minutes ago Exited (0) 12 seconds ago stupefied_sutherland 669411735dfd sickcodes/docker-osx "/bin/bash -c 'sudo …" 14 hours ago Exited (0) 14 hours ago awesome_almeida

Error >

docker run --privileged --net host --cap-add=ALL -v /tmp/.X11-unix:/tmp/.X11-unix -v /dev:/dev -v /lib/modules:/lib/modules sickcodes/docker-osx

ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 ++ id -u ++ id -g

command Disk Load qemu app

MundaneAdvice commented 2 years ago

On side note couple of points >

  1. Insted of WiFi, if you use LAN cable then overall time shown after Reinstall Image comes down from 2hr 40 Mins to 16 Mins
  2. running the containers by by first listing using docker ps and then docker run starts from beginning as example format drive and reinstall
  3. No matter what which partition method one selects ( Inside Format drive before reinstall Mac OS), it shows same issue
  4. If you are getting too many drivers issues at qemu, then upgrading the version to 6 helps a lot ( download git, make, build and all and not by tarball )
  5. Close all other applications like browsers( no matter which one) or any other application before running the docker command, CPU will not hang and allow only Qemu command to run
  6. Insted of Nvidia drivers, try running on X.org Xserver drivers, this again will help in minimizing the OS hang issue
sickcodes commented 2 years ago

The reboot phase is part of the installation, I am testing installation right now anyway

linsui commented 2 years ago

I have the same issue on all of Catalina, Big Sur and Monterey.

linsui commented 2 years ago

The problem is just that the VM can't restart itself. I can close qemu and run docker start manully.

MundaneAdvice commented 2 years ago

Check your RAM. One of mine was faulty and was causing the issue. Now i did

On Fri, Oct 22, 2021, 10:35 linsui @.***> wrote:

The problem is just that the VM can't restart itself. I can close qemu and run docker start manully.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sickcodes/Docker-OSX/issues/308#issuecomment-949289871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOKR3BA54WC3DMMP3EVSSXDUIDWJZANCNFSM476IK75Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

linsui commented 2 years ago

Check your RAM.

Do you mean the RAM of the VM? How to do that? I'm not familiar with MacOS.

MundaneAdvice commented 2 years ago

No RAM of your machine. See i had 2 sticks of 16gigs each out of that one had issues and always throwed some weird memory errors on other VMs as well ( i noticed this late) so I replaced it by doing memtest86 on each individual RAM to detect which one was faulty.

In general when you install macos on any vm or standalone system, it downloads and compiles(i believe) complete OS package to check for any issues. At this time, if your RAM or any component of hardware have issues, then this will not work. The reason being when apple ships Mac's, complete hardware set is tested but again when "You" do it, the complete testing part falls on your shoulder.

Give a try to check Memory or graphic card of your system if they are working correctly(might work on Windows or Linux but not on apple).

linsui commented 2 years ago

Since I have only one RAM I believe it works well. In fact, macos works well. The only problem is that it can't reboot the VM during installation. I doubt there are some issues in qemu.

marcesengel commented 2 years ago

@linsui @sickcodes I've got the same problem - QEMU somehow seems to fail restarting the machine. Restarting manually works and the installation appears to be successful using manual restarts. However I've been suspecting one of my RAM sticks to be faulty for a long time, will check this evening and report back.

sickcodes commented 2 years ago

@linsui @sickcodes I've got the same problem - QEMU somehow seems to fail restarting the machine. Restarting manually works and the installation appears to be successful using manual restarts.

However I've been suspecting one of my RAM sticks to be faulty for a long time, will check this evening and report back.

Sometimes at the very end of the install, it's successful, but doesn't restart. Still works though, can't confirm why though 😂