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

[Feature]: For China Users Internet Problems! 安装时出现网络错误的方案 #135

Open
tylzh97 opened this issue Nov 17, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@tylzh97
Copy link

tylzh97 commented Nov 17, 2024

Is your proposal related to a problem?

This is an excellent project; however, due to China's internet restrictions, we cannot easily use this project to complete macOS installations. Through my testing, I found that during installation, it is not possible to use Alibaba's DNS service (223.5.5.5). This is because Alibaba DNS redirects swcdn.apple.com to swcdn.apple.com.w.alikunlun.com, which prevents the installation from completing. Whether downloading directly or via a VPN (many VPN providers default to using this DNS), this DNS cannot be used!
A solution is as follows(Using Google DNS by):

这是一个非常好的项目, 但是由于中国网络的原因, 我们无法简单的使用此项目完成苹果系统的安装. 经过我的测试, 发现安装此项目时, 不能够使用alibaba提供的dns服务, (223.5.5.5). 因为alibaba dns 会将 swcdn.apple.com 重定向到 swcdn.apple.com.w.alikunlun.com, 这会导致无法完成系统的安装. 不论是直接下载还是通过VPN下载(很多VPN服务提供商都会默认使用该dns), 都不能够使用此dns!
一个比较好的解决方法如下(即在 docker-compose 中指定 DNS 为 Google DNS):

Describe the solution you'd like.

Specified DNS:

services:
  macos:
    image: dockurr/macos
    container_name: macos
    environment:
      VERSION: "15"
      RAM_SIZE: "16G"
      CPU_CORES: "8"
      DISK_SIZE: "256G"
    dns:
      # 不能够使用阿里 DNS, 阿里会莫名其妙的将 swcdn.apple.com 重定向到 swcdn.apple.com.w.alikunlun.com, 后者会导致 reinstall 系统失败
      - 8.8.8.8
      - 8.8.4.4
    volumes:
      - ./osx/v15/:/storage
    devices:
      - /dev/kvm
    cap_add:
      - NET_ADMIN
    ports:
      - 8006:8006
      - 5900:5900/tcp
      - 5900:5900/udp
    stop_grace_period: 2m

Describe alternatives you've considered.

None

Additional context

No response

@tylzh97 tylzh97 added the enhancement New feature or request label Nov 17, 2024
@GGbongb
Copy link

GGbongb commented Dec 2, 2024

但是还是不能下载下来这个macos.
当我运行docker-compose up -d。
会出现:
[+] Running 1/1
✘ macos Error Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting fo... 14.7s
Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)。
大哥,这怎么解决的啊?

@tylzh97
Copy link
Author

tylzh97 commented Dec 2, 2024

但是还是不能下载下来这个macos. 当我运行docker-compose up -d。 会出现: [+] Running 1/1 ✘ macos Error Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting fo... 14.7s Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)。 大哥,这怎么解决的啊?

It seems like that your cannot access dockerhub, which is also block by GFW. I guess you need to use web proxy... Try curl https://registry-1.docker.io/v2/, if you got {"errors":[{"code":"UNAUTHORIZED","message":"authentication required","detail":null}]} means you network is corrrect, otherwise it will timeout (or have no response).

Set enviroment variables HTTP_PROXY and HTTPS_PROXY to your proxy address, like export HTTP_PROXY=http://127.0.0.1:8000 (if you have proxy like clash). For all-well-known reason, I cannot tell you more about how to using network proxy.


docker 的仓库也被墙了, 你没有代理的话没办法访问docker仓库. 你看看你电脑能不能上 https://registry-1.docker.io/v2/ 能上就设置一下 HTTP_PROXY, 不能上就没办法了.

@GGbongb
Copy link

GGbongb commented Dec 2, 2024

thanks,非常感谢,但是大哥,我运行后,日志显示
2024-12-02 22:27:39 macos | ❯ Starting macOS for Docker v1.16...
2024-12-02 22:27:39 macos | ❯ For support visit https://github.com/dockur/macos
2024-12-02 22:27:39 macos | ❯ CPU: AMD Ryzen 7 7735HS | RAM: 5/7 GB | DISK: 526 GB (v9fs) | KERNEL: 5.15.167.4-microsoft-standard-WSL2...
2024-12-02 22:27:39 macos |
2024-12-02 22:27:39 macos | ❯ Downloading macOS 13 recovery image...
2024-12-02 22:27:45 macos | Downloading 042-23155...
2024-12-02 22:27:45 macos | Saving http://oscdn.apple.com/content/downloads/28/14/042-23155/4rscm4lvp3084gutfgpkwj5eex0yyxmzkt/RecoveryImage/BaseSystem.chunklist to /storage/tmp/BaseSystem.chunklist...

然后我手动访问了:http://oscdn.apple.com/content/downloads/28/14/042-23155/4rscm4lvp3084gutfgpkwj5eex0yyxmzkt/RecoveryImage/BaseSystem.chunklist
出现:Access Denied
You don't have permission to access "http://oscdn.apple.com/content/downloads/28/14/042-23155/4rscm4lvp3084gutfgpkwj5eex0yyxmzkt/RecoveryImage/BaseSystem.chunklist" on this server.
Reference #18.17c40f17.1733150287.56676349
https://errors.edgesuite.net/18.17c40f17.1733150287.56676349。

我的配置如下:
services:
macos:
image: dockurr/macos
container_name: macos
environment:
VERSION: "13"
dns:
- 8.8.8.8
- 8.8.4.4
volumes:
- ./osx/v15/:/storage
devices:
- /dev/kvm
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 5900:5900/tcp
- 5900:5900/udp
stop_grace_period: 2m

@tylzh97
Copy link
Author

tylzh97 commented Dec 2, 2024

http://oscdn.apple.com/content/downloads/28/14/042-23155/4rscm4lvp3084gutfgpkwj5eex0yyxmzkt/RecoveryImage/BaseSystem.chunklist

你手动访问 http://oscdn.apple.com/content/downloads/28/14/042-23155/4rscm4lvp3084gutfgpkwj5eex0yyxmzkt/RecoveryImage/BaseSystem.chunklist 被拒绝是符合预期行为的, 我简单看了一下这个项目的代码, 它在dockur/macos/blob/master/src/fetch.py 中构造了一些特殊的请求头, 所以才能够从这个页面下载内容.

我在使用这个项目的时候, 也同样遇到了报错, 但是事件有带你就, 不太确定和你的错误是否是同一个. 但是这个报错并不影响执行. 你可以通过http访问你设备上的8006端口(如果你在本机运行 就在浏览器粘贴 http://127.0.0.1:8006/), 检查 novnc 是否启动成功.

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

No branches or pull requests

2 participants