Virtualize framework Connection Invalid when starting VM

Hi.
Sorry if this question has been answered in another post, if it has I can't find it.
My device is MacBook Pro 16-inch, M1, 2021.

So I tried to create a VM using this guide from Apple
I followed the guide and used an image of debian. Everything worked fine until the machine appeared stuck at some point of the installation. I chose my languages then I had some other prompt asking me to install something but I can't remember precisely the step at which I thought it was freezed (I think it was the GNOME install)
So because the machine was not responding for several minutes (I might have been too hurried) I quitted the process by simply clicking on the Quit button in the VM window.
The problem is that from that point onward, I can't load any VM anymore.
The build is successful in Xcode, the machine starts but immediately quits with this response from Xcode logs :

Virtual machine successfully started.
Guest did stop virtual machine.
2023-02-02 22:22:45.413600+0100 GUILinux[22984:380971] [client] No error handler for XPC error: Connection invalid

I just can't understand why, I tried to delete and download the guide again but it doesn't work. I will add that it's my first time using Xcode and I might have missed something obivous.

Accepted Reply

Just a guest from your description of the problem:

  • The installation was incomplete somehow. But, it succeeded in setting up the base system and updated EFI.
  • As a result, when EFI starts, it picks up the disk with the partial installation instead of the Debian install disk.
  • Either there is no kernel to boot or Linux detects something is wrong. Either way, it gives up and shuts down the machine.

Assuming there is no data that needs to be preserved, the easiest way forward is to discard the aborted installation and try again.

The example creates a GUI Linux VM.bundle bundle in the user home's directory (~/GUI Linux VM.bundle/, vmBundlePath in the code). That bundle contains the disk, EFI Variable Store, and machine identity.

If you delete that bundle, the App's createVMBundle() will create a new one and you could try the installation from scratch.

Replies

Just a guest from your description of the problem:

  • The installation was incomplete somehow. But, it succeeded in setting up the base system and updated EFI.
  • As a result, when EFI starts, it picks up the disk with the partial installation instead of the Debian install disk.
  • Either there is no kernel to boot or Linux detects something is wrong. Either way, it gives up and shuts down the machine.

Assuming there is no data that needs to be preserved, the easiest way forward is to discard the aborted installation and try again.

The example creates a GUI Linux VM.bundle bundle in the user home's directory (~/GUI Linux VM.bundle/, vmBundlePath in the code). That bundle contains the disk, EFI Variable Store, and machine identity.

If you delete that bundle, the App's createVMBundle() will create a new one and you could try the installation from scratch.

So I deleted the bundle and rebuilded the project, and now it works.
Somehow I missed this, I am sorry for that.
Thank you for you help and quick anwser !

hey.. i've also successfully run the (Running GUI Linux in a virtual machine on a Mac) project, but instead of getting a GUI i get "Guest did stop virtual machine." in console. am i missing a step here?

  • Hi, I hope you are doing well. I faced with the similar issue. Could you please tell me what was the issue for you and how did you solve it?

Add a Comment