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

Cannot start VM with error: "virtual machine's network attachment has been disconnected" #72

Closed
Lutzifer opened this issue May 16, 2022 · 9 comments

Comments

@Lutzifer
Copy link

Lutzifer commented May 16, 2022

After creating a VM using

tart create --from-ipsw=latest monterey-vanilla

starting it using

tart run monterey-vanilla  

fails with the error

"virtual machine's network attachment has been disconnected"

Guest: 21E258.ipsw
Host: 12.3.1 (21E258), MacBook Pro (16-inch, 2021), Apple M1 Max

@edigaryev
Copy link
Collaborator

Hello, thanks for checking out the fix provided in #74 so quickly!

Unfortunately I've never stumbled upon this on a a similar configuration (MacBookPro18,3 and 21E258 for both host and guests). However, assuming that you have essentially a pristine guest OS, do you run some other virtualization/networking software on your host by a chance?

Can you check if #77 works for you and does not cause a lot of re-attachments?

@Lutzifer
Copy link
Author

#77 causes an infinite loop of re-attachments, but I can setup the OS then (without network)

I have UTM installed, but it is not running atm.

I cannot see, what VZNATNetworkDeviceAttachment is using under the hood, but the only available device for VZBridgedNetworkInterface is my wifi.

@Lutzifer
Copy link
Author

It works if I use an USB Dongle to connect to LAN.

@edigaryev
Copy link
Collaborator

#77 causes an infinite loop of re-attachments, but I can setup the OS then (without network)

Thanks for checking this! Looks like adding the re-attachment logic would do nothing useful to fix the issue as the error cause doesn't seem to be intermittent.

I cannot see, what VZNATNetworkDeviceAttachment is using under the hood, but the only available device for VZBridgedNetworkInterface is my wifi.

It's using vmnet under the hood most likely. This API manifests itself in ifconfig output as vmenetX interfaces connected to bridge100 normally.

@edigaryev
Copy link
Collaborator

@Lutzifer could you also check the #80 please? Does the network work with it?

It ignores all errors with the assumption that the Virtualization.Framework may re-connect the attachment itself.

@Lutzifer
Copy link
Author

network does not work with #80

I can see vmenetX appear when I run tart, but do not see bridge100

Would be interesting to test this against another MacBookPro18,3 to see if it is only a config issue on my side.
Will also try later today when I have upgraded to macOS 12.4 to see if this changes anything.

@fkorotkov
Copy link
Contributor

fkorotkov commented May 17, 2022

@Lutzifer I'm on MacBookPro18,3 (14" M1 Max with 2 TB) so this is very interesting to see what's the difference. Have you tried cloning an existing VM? The vanilla one I built and pushed from my machine:

tart clone ghcr.io/cirruslabs/macos-monterey-vanilla:12.4 test
tart run test

@Lutzifer
Copy link
Author

Ok, I found the source of the problem:

I had enabled both internet sharing and air play receiver in the sharing settings.
After disabling both of them, it worked. My guess: Internet Sharing was enabled with a port that was no longer available (USB-Ethernet Dongle) and kept the NAT Service busy.

Thanks for all the help!

@fkorotkov
Copy link
Contributor

Wow. Glad you found the issue!

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