hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.16k stars 4.43k forks source link

Still latest Vagrant version ignores admin privileges in windows 11 #13183

Open jayeshkumarbhoi opened 1 year ago

jayeshkumarbhoi commented 1 year ago

Debug output

>vagrant up --provider=hyperv
The provider 'hyperv' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

The Hyper-V provider requires that Vagrant be run with
administrative privileges. This is a limitation of Hyper-V itself.
Hyper-V requires administrative privileges for management
commands. Please restart your console with administrative
privileges and try again.

Expected behavior

Vagrant should start as command prompt started with admin rights.

Actual behavior

Still asking to run Vagrant with admin privileges.

Reproduction information

Vagrant version

>vagrant version
Installed Version: 2.3.6
Latest Version: 2.3.6

You're running an up-to-date version of Vagrant!

Host operating system

Microsoft Windows 11 Enterprise

Guest operating system

CentOS/7

Steps to reproduce

  1. Start command prompt\power shell with admin rights
  2. Give command vagrant up --provider=hyperv

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"

  config.vm.provider "hyperv" do |h, override|
    unless File.exist?(".vagrant/machines/default/hyperv/action_provision")
      override.vm.provision "shell", inline: <<-SHELL
        yum install -y cifs-utils </dev/null
        ip link set mtu 1400 dev eth0
        echo "MTU=1400" >> /etc/sysconfig/network-scripts/ifcfg-eth0
      SHELL
      override.vm.post_up_message = "VM is initialized but not ready.  Please run `vagrant reload` to finalize."
    else
      override.vm.synced_folder '.', '/vagrant', {
        type: 'smb', mount_options: ['vers=3.0'],
      }
      override.vm.post_up_message = "Your VM is ready for use."
    end
  end
end
chrisroberts commented 1 year ago

Hi there,

Would you please provide a gist of the output generated from running vagrant up --debug

Thanks!