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

当我安装macos时,提示没有连接网络 #171

Closed
virkingz opened this issue Dec 24, 2024 · 18 comments
Closed

当我安装macos时,提示没有连接网络 #171

virkingz opened this issue Dec 24, 2024 · 18 comments

Comments

@virkingz
Copy link

Operating system

ubuntu:16.04

Description

当我安装macos时,提示没有连接网络

Docker compose

version: '3.8'
services:
macos:
image: dockurr/macos
container_name: macos # 容器名称
environment:
VERSION: "13"
privileged: true
volumes:
- ./osx:/storage # 磁盘映射的本地路径,我在Portainer中讲到过
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
dns:
- 8.8.8.8
- 8.8.4.4
ports:
- 8006:8006
- "5900:5900/tcp"
- "5900:5900/udp"
stop_grace_period: 2m

Docker log

image

Screenshots (optional)

image

@puteulanus
Copy link

puteulanus commented Dec 26, 2024

I am experiencing the same issue, with symptoms identical to this comment: #173 (comment).

After manually configuring the network interface in the VM with the correct IP address, subnet mask, and gateway, I was able to ping 20.20.20.1 and ping 8.8.8.8 successfully. This indicates that basic network connectivity is working, and the problem seems to lie with the DHCP service.

To investigate further, I manually started dnsmasq with the following command:

/usr/sbin/dnsmasq --dhcp-range=20.20.20.21,20.20.20.21 --dhcp-host=00:16:CB:94:A1:60,,20.20.20.21,QEMU,infinite --dhcp-option=option:netmask,255.255.255.0 --dhcp-option=option:dns-server,20.20.20.1 --dhcp-option=option:router,20.20.20.1 --address=/host.lan/20.20.20.1 -d

This produced the following logs:

dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPDISCOVER(dockerbridge) 00:16:cb:94:a1:60
dnsmasq-dhcp: DHCPOFFER(dockerbridge) 20.20.20.21 00:16:cb:94:a1:60

Despite this, the VM still ends up with a 169.x.x.x address:

QQ_1735235202230

ifconfig en0 inet 20.20.20.21 netmask 255.255.255.0
route add default 20.20.20.1
echo nameserver 8.8.8.8 > /etc/resolv.conf

After executing these commands in the terminal on the macOS virtual machine installation screen, I was able to connect to the server and proceed with the installation.

@virkingz
Copy link
Author

@puteulanus
after using your method, I can also continue with the installation!

@virkingz
Copy link
Author

@puteulanus
When I install the system, it prompts an error occurred preparing the software update。 Have you encountered this problem?

@puteulanus
Copy link

@puteulanus When I install the system, it prompts an error occurred preparing the software update。 Have you encountered this problem?

No, I didn't encounter it, but during system initialization after the installation, DHCP still doesn't seem to work properly.

QQ_1735272703740

QQ_1735273275642

@ncheng89
Copy link

image
But the DNS still does not work, there is no problem with the gateway

@virkingz
Copy link
Author

@puteulanus我在安装系统的时候提示准备软件更新时出错。你有遇到过这个问题吗?

没有,我没有遇到过,但是在安装后的系统初始化过程中,DHCP似乎仍然无法正常工作。

QQ_1735272703740

QQ_1735273275642

Do you know how to solve it #93 (comment)

@puteulanus
Copy link

But the DNS still does not work, there is no problem with the gateway

Yes, I did encounter this issue. It feels like a DNS service needs to be restarted, but I don't know how to do that in recovery mode. After writing to /etc/resolv.conf, both ping and curl fail to resolve immediately.

What I did was close the terminal after making the changes, repeatedly entering the system installation option (the first few attempts may still show network error messages). However, after a few tries, I was able to proceed to the license agreement step. At this point, if I return to the terminal, both ping and curl resolve correctly.

@ncheng89
Copy link

But the DNS still does not work, there is no problem with the gateway

Yes, I did encounter this issue. It feels like a DNS service needs to be restarted, but I don't know how to do that in recovery mode. After writing to /etc/resolv.conf, both ping and curl fail to resolve immediately.

What I did was close the terminal after making the changes, repeatedly entering the system installation option (the first few attempts may still show network error messages). However, after a few tries, I was able to proceed to the license agreement step. At this point, if I return to the terminal, both ping and curl resolve correctly.

It is indeed true. It is very strange. The terminal cannot resolve the domain name by dns. But it works after clicking on the installation system.
image

@virkingz
Copy link
Author

但DNS还是不行,网关没有问题

是的,我确实遇到了这个问题。感觉好像需要重新启动 DNS 服务,但我不知道如何在恢复模式下执行此操作。写入后/etc/resolv.confping和都curl无法立即解析。
我所做的是在进行更改后关闭终端,反复输入系统安装选项(前几次尝试可能仍会显示网络错误消息)。但是,经过几次尝试,我能够继续进行许可协议步骤。此时,如果我返回终端,和都可以ping正确curl解析。

确实是这样的,很奇怪,终端无法通过dns解析域名,但是点击安装系统后就可以了。 图像

After you have successfully installed it, please let me know that I am currently stuck and unable to start properly
image

@ncheng89
Copy link

@virkingz
After the installation is complete, I can boot into the system normally. Did you divide too many partitions into partitions? Try dividing only one hard disk partition and then install the system.

image

@virkingz
Copy link
Author

@virkingz After the installation is complete, I can boot into the system normally. Did you divide too many partitions into partitions? Try dividing only one hard disk partition and then install the system.

image

I followed the process:
Choose Disk Utility and then select the largest Apple Inc. VirtIO Block Media disk.
Click the Erase button to format the disk to APFS, and give it any recognizable name you like.
Close the current window and proceed the installation by clicking Reinstall macOS.
When prompted where you want to install it, select the disk you just created previously.

I don't know where I made a mistake

@ncheng89
Copy link

image
What is the name of your disk partition? What will happen if you click the corresponding disk with the mouse?

@virkingz
Copy link
Author

image What is the name of your disk partition? What will happen if you click the corresponding disk with the mouse?

It will prompt a system error and keep restarting

@ncheng89
Copy link

Did you use the -v parameter to persist the disk? If you did, try deleting everything and then starting over.

@virkingz
Copy link
Author

您是否使用了 -v 参数来持久保存磁盘?如果使用了,请尝试删除所有内容,然后重新开始。

OK, I'll give it a try

@puteulanus
Copy link

I attempted to install macOS 14 in a fresh container and encountered the same issue. This is a screenshot of the logs obtained after modifying the boot args. Since I couldn't prevent the system from rebooting upon a crash and don't understand why the VNC resolution changes during the crash, it's been very difficult to capture the complete logs.

QQ_1735310616261

PS:
From searching the error shown in the screenshot, I found this issue: paolo-projects/auto-unlocker#86 (comment). The problem seems to be related to the lack of AVX2 support in the CPU. The CPU on my machine is N5105, which does not support AVX/AVX2 instructions (the result of cat /proc/cpuinfo | grep avx is empty).

@puteulanus
Copy link

Also crash after macOS 13 installed:

QQ_1735358540949

QQ_1735358558394

@virkingz
Copy link
Author

Also crash after macOS 13 installed:

QQ_1735358540949

QQ_1735358558394

You're right, it can start normally when I change the device

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