Parallels / vagrant-parallels

Vagrant Parallels Provider
https://parallels.github.io/vagrant-parallels
MIT License
996 stars 87 forks source link

Vagrant-parallels fails to recognize that vm is running. #385

Closed ondrasek closed 3 years ago

ondrasek commented 3 years ago

The plugin fails to recognize that VM is already booted up in Parallels. Running without debug, the `vagrant up' process is stuck at:

❯ vagrant destroy -f && vagrant up
==> debian10-generic-base: Forcing shutdown of VM...
==> debian10-generic-base: Destroying VM and associated drives...
==> debian10-generic-base: Destroying unused networking interface...
==> debian10-generic-base: Running cleanup tasks for 'reload' provisioner...
Bringing machine 'debian10-generic-base' up with 'parallels' provider...
==> debian10-generic-base: Registering VM image from the base box 'generic/debian10'...
==> debian10-generic-base: Creating new virtual machine as a full clone of the box image...
==> debian10-generic-base: Unregistering the box VM image...
==> debian10-generic-base: Setting the default configuration for VM...
==> debian10-generic-base: Running 'post-import' VM customizations...
==> debian10-generic-base: Checking if box 'generic/debian10' version '3.2.16' is up to date...
==> debian10-generic-base: Setting the name of the VM: debian10-generic-base
==> debian10-generic-base: Preparing network interfaces based on configuration...
    debian10-generic-base: Adapter 0: shared
==> debian10-generic-base: Clearing any previously set network interfaces...
==> debian10-generic-base: Running 'pre-boot' VM customizations...
==> debian10-generic-base: Booting VM...
==> debian10-generic-base: Running 'post-boot' VM customizations...
==> debian10-generic-base: Waiting for machine to boot. This may take a few minutes...

With debug, this is what I see running in a loop:

2021-04-14 21:29:14 [ INFO] Starting process: ["/usr/local/bin/prlctl", "list", "bd4aea2a-d11d-46f0-9ef9-eaeaa78495d8", "--no-header", "-o", "status"]
2021-04-14 21:29:14 [DEBUG] Command not in installer, not touching env vars.
2021-04-14 21:29:14 [ INFO] Command not in installer, restoring original environment...
2021-04-14 21:29:14 [DEBUG] Selecting on IO
2021-04-14 21:29:14 [DEBUG] stdout: running
2021-04-14 21:29:14 [DEBUG] Waiting for process to exit. Remaining to timeout: 32000
2021-04-14 21:29:14 [DEBUG] Exit status: 0

Prlctl run manually produces:

>prlctl list bd4aea2a-d11d-46f0-9ef9-eaeaa78495d8 --no-header -o status
running

Yet the provider is looping over the prlctl command until it times out.

I can also see the VM running in Parallels and I am able to login using default Vagrant credentials. However, running vagrant ssh produces this:

❯ vagrant status
Current machine states:

debian10-generic-base     running (parallels)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

❯ vagrant ssh
The provider for this Vagrant-managed machine is reporting that it
is not yet ready for SSH. Depending on your provider this can carry
different meanings. Make sure your machine is created and running and
try again. Additionally, check the output of `vagrant status` to verify
that the machine is in the state that you expect. If you continue to
get this error message, please view the documentation for the provider
you're using.
ondrasek commented 3 years ago

debug.out.txt

ondrasek commented 3 years ago

Seems to be Parallels issue. Running prlsrvctl shutdown -f fixes the issue. Apologies and closing. I have reported the root cause to Parallels support. The problem is that DHCP fails on the shared network and the machines stop getting addresses.