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
48.83k stars 2.73k forks source link

How not to get a different serial number each time I start my container ? #416

Open Subhankar2000 opened 2 years ago

Subhankar2000 commented 2 years ago

I have taken the pre-installed mac OS catalina, but as after every boot from the same container, I am having different serial numbers as a result, I am getting kicked out of my icloud account, is there any way to get a static serial number one which will not change on every boot ?

mitchellkrogza commented 2 years ago

Did you find a solution to this?

Subhankar2000 commented 2 years ago

yes, I remember it vaguely but I as far I remember, you will need to stop the docker service, go to the folder where the files are stored(you can search using the id), there will be a config file, there you need to edit it, there will be something that generate Random Serial everytime equals true, that you need to make it false

mitchellkrogza commented 2 years ago

yes, I remember it vaguely but I as far I remember, you will need to stop the docker service, go to the folder where the files are stored(you can search using the id), there will be a config file, there you need to edit it, there will be something that generate Random Serial everytime equals true, that you need to make it false

Thanks very much I sorted it out this morning. For others who run into this.

sudo systemctl stop docker
sudo jq . /docker/containers/[FULL-CONTAINER-ID]/config.v2.json > ~/config.v2.json
sudo mv ~/config.v2.json /docker/containers/[FULL-CONTAINER-ID]/config.v2.json
sudo nano /docker/containers/[FULL-CONTAINER-ID]/config.v2.json

Either delete the two following lines in the ENV section or set them to false

     "GENERATE_SPECIFIC=true",
     "GENERATE_UNIQUE=true",

then restart docker

sudo systemctl restart docker

Your serial should now be fixed, confirm this by rebooting the container at least 2 times each time checking the SERIAL and UUID from System Report