dotless-de / vagrant-vbguest

A Vagrant plugin to keep your VirtualBox Guest Additions up to date
MIT License
2.88k stars 207 forks source link

vagrant 2.1.4 cannot install vagrant-vbguest correctly #306

Closed tyy0402 closed 6 years ago

tyy0402 commented 6 years ago

After I installed vagrant and vagrant-vbguest, vagrant -vshows "Vagrant 2.1.4" while vagrant -h shows Plugin vagrant-vbguest is not installed. Install it with: vagrant plugin install vagrant-vbguest vagrant-triggers When I tried vagrant up, it still shows Plugin vagrant-vbguest is not installed. Install it with: vagrant plugin install vagrant-vbguest vagrant-triggers Then I tried vagrant plugin install vagrant-vbguest vagrant-triggers and vagrant up, it shows

Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.16.0)'!
Installing the 'vagrant-triggers' plugin. This can take a few minutes...
Fetching: bundler-1.16.4.gem (100%)
Fetching: vagrant-triggers-0.5.3.gem (100%)
Installed the plugin 'vagrant-triggers (0.5.3)'!

and vagrant up again,

WARNING: Vagrant has detected the `vagrant-triggers` plugin. This plugin conflicts
with the internal triggers implementation. Please uninstall the `vagrant-triggers`
plugin and run the command again if you wish to use the core trigger feature. To
uninstall the plugin, run the command shown below:

  vagrant plugin uninstall vagrant-triggers

Note that the community plugin `vagrant-triggers` and the core trigger feature
in Vagrant do not have compatible syntax.

To disable this warning, set the environment variable `VAGRANT_USE_VAGRANT_TRIGGERS`.
Plugin vagrant-vbguest is not installed. Install it with:
vagrant plugin install vagrant-vbguest vagrant-triggers

was showed. How can I install vagrant-vbguest correctly?

fnordfish commented 6 years ago

Did you upgrade an existing vagrant installation? If so, the safest way to get all your plugins work again is by re-installing them:

  1. make a not of your installed plugins: vagrant plugin list
  2. delete them all, hardcore edition: rm -rf ~/.vagrant.d/{gems,plugins.json}
  3. re-install them: vagrant plugin install list of all your plugins
tyy0402 commented 6 years ago

Thanks for your reply. After re-install, vagrant-vbguest is installed successful. While I entered the file of Ocracoke and vagrant up, it shows

Plugin` vagrant-vbguest is not installed. Install it with:
vagrant plugin install vagrant-vbguest vagrant-triggers

I used Ocracoke(https://github.com/NCSU-Libraries/ocracoke), mabe there are some conflicts between vagrant-vbguest and Ocracoke, which cause the problem.

fnordfish commented 6 years ago

oh sorry, I wasn't precise enough. It's not literally vagrant plugin install list of all your plugins, but vagrant plugin install <write your list of plugins here>, for example: vagrant plugin install vagrant-vbguest vagrant-triggers. Although you don't need vagrant-triggers anymore (hence the warning)

Just rm -rf ~/.vagrant.d/{gems,plugins.json} again, and then vagrant plugin install vagrant-vbguest (and all the plugins you like)

fnordfish commented 6 years ago

oh. now I see. I remember reading something about plugin registration issues in Vagrant 2.1.4 - let me check. Meanwhile, you can try to downgrade to Vagrant 2.1.3

tyy0402 commented 6 years ago

After re-install, vagrant-vbguest is installed successful. ONCE I entered the file of Ocracoke and vagrant up, it shows

Plugin vagrant-vbguest is not installed. Install it with: vagrant plugin install vagrant-vbguest vagrant-triggers I used Ocracoke(https://github.com/NCSU-Libraries/ocracoke), mabe there are some conflicts between vagrant-vbguest and Ocracoke, which cause the problem. I can run vagrant correctly in every file except in the Ocracoke file.

fnordfish commented 6 years ago

So there is a fixed but unreleased issue: https://github.com/hashicorp/vagrant/pull/10165

I've just tested with 2.1.4 and 2.1.3, and indeed Vagrant has a bug in it's has_plugin? method.

fnordfish commented 6 years ago

Vagrant 2.1.2 is working for me

fnordfish commented 6 years ago

To clarify, Ocracoke checks for plugins using Vagrant.has_plugin? in here: https://github.com/NCSU-Libraries/ocracoke/blob/master/Vagrantfile#L6 This method is buggy in Vagrant 2.1.3 and 2.1.4 and returns a false negative (actually, Vagrant 2.1.4 will run the Vagrant file twice and you'd get the correct result at the second run, but Ocracoke's Vagrantfile exits hard at the first false negative)

tyy0402 commented 6 years ago

So can I use Vagrant 2.1.2.

fnordfish commented 6 years ago

Just realized, that of cause, you could just simple remove the exit in the Vagrantfile (at https://github.com/NCSU-Libraries/ocracoke/blob/master/Vagrantfile#L9) Which in your case should probably be done anyways, b/c you don't want to install vagrant-triggers since it has been integrated into Vagrant.

Still, Vagrant 2.1.4 has that nasty double load bug, so 2.1.3 should be safe.

tyy0402 commented 6 years ago

How can I get 2.1.3 version? I just find a msi file on https://www.filecluster.com/Vagrant.html

fnordfish commented 6 years ago

here's everything: https://releases.hashicorp.com/vagrant/

tyy0402 commented 6 years ago

I used 2.1.3 version and removed exit. Although it has some warnings

WARNING: Vagrant has detected the `vagrant-triggers` plugin. This plugin conflicts
with the internal triggers implementation. Please uninstall the `vagrant-triggers`
plugin and run the command again if you wish to use the core trigger feature. To
uninstall the plugin, run the command shown below:

  vagrant plugin uninstall vagrant-triggers

Note that the community plugin `vagrant-triggers` and the core trigger feature
in Vagrant do not have compatible syntax.

To disable this warning, set the environment variable `VAGRANT_USE_VAGRANT_TRIGGERS`.
Plugin vagrant-vbguest is not installed. Install it with:
vagrant plugin install vagrant-vbguest vagrant-triggers
Plugin vagrant-triggers is not installed. Install it with:
vagrant plugin install vagrant-vbguest vagrant-triggers
/home/tyy/.vagrant.d/gems/2.4.4/gems/of-0.4.0/lib/of.rb:4: warning: constant ::Fixnum is deprecated

it works.

While I run vagrant up, I met another problem perhaps relate to VirtualBox.

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'geerlingguy/centos7' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: 1.2.4
==> default: Loading metadata for box 'geerlingguy/centos7'
    default: URL: https://vagrantcloud.com/geerlingguy/centos7
==> default: Adding box 'geerlingguy/centos7' (v1.2.4) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/geerlingguy/boxes/centos7/versions/1.2.4/providers/virtualbox.box
==> default: Successfully added box 'geerlingguy/centos7' (v1.2.4) for 'virtualbox'!
==> 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 'geerlingguy/centos7'...
==> default: Cloning VM...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'geerlingguy/centos7' is up to date...
==> default: Setting the name of the VM: ocracoke_default_1536317166455_16270
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:

  https://www.virtualbox.org/manual/ch04.html#sharedfolders

This option can be disabled globally with an environment variable:

  VAGRANT_DISABLE_VBOXSYMLINKCREATE=1

or on a per folder basis within the Vagrantfile:

  config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 80 (guest) => 8088 (host) (adapter 1)
    default: 443 (guest) => 8443 (host) (adapter 1)
    default: 3000 (guest) => 8090 (host) (adapter 1)
    default: 8983 (guest) => 8984 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "b74a9a9a-09ae-49ad-98c7-d9169e0f0804", "--type", "headless"]

Stderr: VBoxManage: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

https://github.com/hashicorp/vagrant/issues/1809