How can I provide a guest to Windows using the firewall / path authoring tool?

I am trying to use Powershell to provide Windows Vagrant. I checked that my script runs on my local machine if I run Powershell as an administrator. During the process of preparing strollers, a roving user cannot pick up and run a script.

I know that powershell scripts are supported with Vagrant, so what needs to happen to use them for preparation? My initial thought was to try to run the script with a new Powershell admin, but I believe there should be a better way.

I am trying to just download a file using System.Net.WebClientand use msiexecto install.

Vagrantfile:

# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
PROVISION_WIN7_SCRIPT = "provision_win7.ps1"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "win7", primary: false do |win7|
  config.vm.provision "shell", :path => "#{PROVISION_WIN7_SCRIPT}"
  config.vm.box      = "win7"
  config.vm.hostname = "win7"
  config.vm.communicator = "winrm"
  config.vm.network :private_network, ip: "10.10.10.10"
  config.vm.box_url = "https://atlas.hashicorp.com/designerror/boxes/windows-7/versions/1.0/providers/virtualbox.box"   
    config.vm.provider :virtualbox do |vb|
      vb.gui = true
      vb.customize ["modifyvm", :id, "--memory", 1024]
      vb.customize ["modifyvm", :id, "--cpus", 1]
      vb.customize ["modifyvm", :id, "--vram", "32"]
      vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
      vb.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
  end
  end
end

Edit:

, , : Vagrant 1.6.3, Virtualbox 4.3.30. , :

Bringing machine 'win7' up with 'virtualbox' provider...
==> win7: Importing base box 'designerror/windows-7'...
==> win7: Matching MAC address for NAT networking...
==> win7: Checking if box 'designerror/windows-7' is up to date...
==> win7: Setting the name of the VM: vagrant_win7_1453859492744_23074
==> win7: Clearing any previously set network interfaces...
==> win7: Preparing network interfaces based on configuration...
    win7: Adapter 1: nat
    win7: Adapter 2: hostonly
==> win7: Forwarding ports...
    win7: 3389 => 3389 (adapter 1)
    win7: 22 => 2222 (adapter 1)
    win7: 5985 => 55985 (adapter 1)
==> win7: Running 'pre-boot' VM customizations...
==> win7: Booting VM...
==> win7: Waiting for machine to boot. This may take a few minutes...
==> win7: Machine booted and ready!
==> win7: Checking for guest additions in VM...
==> win7: Setting hostname...
==> win7: Configuring and enabling network interfaces...
==> win7: Mounting shared folders...
    win7: /vagrant => /Users/dstark/Projects/itbestprac-pres/vagrant
==> win7: Running provisioner: shell...
    win7: Running: c:\tmp\vagrant-shell.ps1

c:\tmp vagrant-shell.ps1 vagrant-elevated-shell.ps1, shell ps script -, . , , script .

config.winrm.username config.winrm.password, , script. .

+4
1

, privileged :

config.vm.provision "shell", path: "scripts/provision.ps1", privileged: true

:

config.vm.provision "shell", :path => "#{PROVISION_WIN7_SCRIPT}", privileged: true
0

All Articles