chocolatey-community / chocolatey-test-environment

A testing setup related to how the Chocolatey Package Verifier runs testing. Used for manual testing or prior to submission
Apache License 2.0
117 stars 187 forks source link

Instructions not working #34

Open teknowledgist opened 5 years ago

teknowledgist commented 5 years ago

I really have no idea how Vagrant works, but walking through the instructions apparently isn't enough:

PS C:\chocolatey-test-environment> vagrant sandbox on
[default] Starting sandbox mode...
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
PS C:\chocolatey-test-environment> vagrant provision
==> default: Running provisioner: shell...
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.
PS C:\chocolatey-test-environment> vagrant sandbox rollback
[default] Rolling back the virtual machine...
VBoxManage.exe: error: Machine '0a9cbe89-3445-43eb-a029-bb0e81a53035' is not currently running
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
PS C:\chocolatey-test-environment> vagrant provision
==> default: Running provisioner: shell...
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.
PS C:\chocolatey-test-environment> vagrant halt
==> default: Attempting graceful shutdown of VM...
    default: Guest communication could not be established! This is usually because
    default: SSH is not running, the authentication information was changed,
    default: or some other networking issue. Vagrant will force halt, if
    default: capable.
==> default: Forcing shutdown of VM...
PS C:\chocolatey-test-environment> vagrant destroy
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Destroying VM and associated drives...
PS C:\chocolatey-test-environment> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Cloning VM...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ferventcoder/win2012r2-x64-nocm' version '1.0.0' is up to date...
==> default: Setting the name of the VM: chocolatey-test-environment_default_1550549316175_62876
==> default: Fixed port collision for 5985 => 5985. Now on port 2250.
Vagrant found a port collision for the specified port and virtual machine.
While this port was marked to be auto-corrected, the ports in the
auto-correction range are all also used.

VM: default
Forwarded port: 3389 => 3389
PS C:\chocolatey-test-environment> vagrant sandbox on
[default] Starting sandbox mode...
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
PS C:\chocolatey-test-environment> vagrant provision
==> default: VM is not currently running. Please, first bring it up with `vagrant up` then run this command.

vagrant destroy didn't appear to actually destroy anything. How can I back out entirely and start again? (and will that make any difference, or do I need to be fixing something else?)

teknowledgist commented 4 years ago

Started anew and get:

PS C:\chocolatey-test-environment> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Preparing master VM for linked clones...
    default: This is a one time operation. Once the master VM is prepared,
    default: it will be used as a base for linked clones, making the creation
    default: of new VMs take milliseconds on a modern system.
==> default: Importing base box 'ferventcoder/win2012r2-x64-nocm'...
==> default: Cloning VM...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ferventcoder/win2012r2-x64-nocm' version '1.0.0' is up to date...
==> default: Setting the name of the VM: chocolatey-test-environment_default_1569467613694_21019
==> default: Fixed port collision for 5985 => 5985. Now on port 2250.
Vagrant found a port collision for the specified port and virtual machine.
While this port was marked to be auto-corrected, the ports in the
auto-correction range are all also used.

VM: default
Forwarded port: 3389 => 3389
PS C:\chocolatey-test-environment> vagrant sandbox on
[default] Starting sandbox mode...
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
PS C:\chocolatey-test-environment> vagrant provision
==> default: VM is not currently running. Please, first bring it up with `vagrant up` then run this command.
PS C:\chocolatey-test-environment> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ferventcoder/win2012r2-x64-nocm' version '1.0.0' is up to date...
==> default: Fixed port collision for 5985 => 5985. Now on port 2250.
Vagrant found a port collision for the specified port and virtual machine.
While this port was marked to be auto-corrected, the ports in the
auto-correction range are all also used.

VM: default
Forwarded port: 3389 => 3389
PS C:\chocolatey-test-environment> vagrant provision
==> default: VM is not currently running. Please, first bring it up with `vagrant up` then run this command.

Clearly, there was something missing from the instructions. Not knowing why vagrant up wasn't being recognized as having been done, I started the vm in the virtual box GUI.

PS C:\chocolatey-test-environment> vagrant provision
==> default: Running provisioner: shell...
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.

I have a Test environment VM that I can start up, but C:\Packages isn't there, and Chocolaty isn't installed for me to manually test.

mkevenaar commented 4 years ago

@teknowledgist I had the same thing. You need to do the following:

It is basically this message that causes problems:

Vagrant found a port collision for the specified port and virtual machine.

You probably have winrm configured on your machine (e.g. forced from a domain)

Hope this helps!

Maurice

teknowledgist commented 4 years ago

@mkevenaar Thank you for the suggestion. Clearly this isn't an urgent issue for me since I'm only now again needing the test environment.

However, I'm still encountering the same/similar problem:

PS C:\chocolatey-test-environment> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ferventcoder/win2012r2-x64-nocm' version '1.0.0' is up to date...
==> default: Fixed port collision for 55985 => 55985. Now on port 2250.
Vagrant found a port collision for the specified port and virtual machine.
While this port was marked to be auto-corrected, the ports in the
auto-correction range are all also used.

VM: default
Forwarded port: 3389 => 3389
PS C:\chocolatey-test-environment> vagrant sandbox on
[default] Starting sandbox mode...
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
PS C:\chocolatey-test-environment> vagrant provision
==> default: VM is not currently running. Please, first bring it up with `vagrant up` then run this command.
PS C:\chocolatey-test-environment> vagrant sandbox rollback
[default] Rolling back the virtual machine...
VBoxManage.exe: error: Machine '52055597-8f45-4450-a19d-ca15f5ce11a7' is not currently running
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
PS C:\chocolatey-test-environment> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ferventcoder/win2012r2-x64-nocm' version '1.0.0' is up to date...
==> default: Running provisioner: shell...
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.
ferventcoder commented 4 years ago

It appears there may be more going on here. I think it's likely due to a very older Vbox extensions on the box that need upgraded. Perhaps we should look into adding vb-guest to the mix here to upgrade that on the vagrant box? It does add quite a bit of time, but things tend to work much smoother after that.