Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y/N prompt vagrant destroy does not work on Win 10 PowerShell #7649

Closed
SamStamport opened this issue Jul 26, 2016 · 12 comments
Closed

Y/N prompt vagrant destroy does not work on Win 10 PowerShell #7649

SamStamport opened this issue Jul 26, 2016 · 12 comments

Comments

@SamStamport
Copy link

Please note that the Vagrant issue tracker is reserved for bug reports and
enhancements. For general usage questions, please use the Vagrant mailing list:
https://groups.google.com/forum/#!forum/vagrant-up. Thank you!

1.8.4

Run vagrant -v to show the version. If you are not running the latest version
of Vagrant, please upgrade before submitting an issue.

Windows 10

This is the operating system that you run locally.

Apache

This is the operating system you run in the virtual machine.

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
Vagrant.require_version '>= 1.8.1'

# Absolute paths on the host machine.
host_drupalvm_dir = File.dirname(File.expand_path(__FILE__))
host_project_dir = ENV['DRUPALVM_PROJECT_ROOT'] || host_drupalvm_dir
host_config_dir = ENV['DRUPALVM_CONFIG_DIR'] ? "#{host_project_dir}/#{ENV['DRUPALVM_CONFIG_DIR']}" : host_project_dir

# Absolute paths on the guest machine.
guest_project_dir = '/vagrant'
guest_drupalvm_dir = ENV['DRUPALVM_DIR'] ? "/vagrant/#{ENV['DRUPALVM_DIR']}" : guest_project_dir
guest_config_dir = ENV['DRUPALVM_CONFIG_DIR'] ? "/vagrant/#{ENV['DRUPALVM_CONFIG_DIR']}" : guest_project_dir

# Cross-platform way of finding an executable in the $PATH.
def which(cmd)
  exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
  ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
    exts.each do |ext|
      exe = File.join(path, "#{cmd}#{ext}")
      return exe if File.executable?(exe) && !File.directory?(exe)
    end
  end
  nil
end

def walk(obj, &fn)
  if obj.is_a?(Array)
    obj.map { |value| walk(value, &fn) }
  elsif obj.is_a?(Hash)
    obj.each_pair { |key, value| obj[key] = walk(value, &fn) }
  else
    obj = yield(obj)
  end
end

require 'yaml'
# Load default VM configurations.
vconfig = YAML.load_file("#{host_drupalvm_dir}/default.config.yml")
# Use optional config.yml and local.config.yml for configuration overrides.
['config.yml', 'local.config.yml'].each do |config_file|
  if File.exist?("#{host_config_dir}/#{config_file}")
    vconfig.merge!(YAML.load_file("#{host_config_dir}/#{config_file}"))
  end
end

# Replace jinja variables in config.
vconfig = walk(vconfig) do |value|
  while value.is_a?(String) && value.match(/{{ .* }}/)
    value = value.gsub(/{{ (.*?) }}/) { vconfig[Regexp.last_match(1)] }
  end
  value
end

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  # Networking configuration.
  config.vm.hostname = vconfig['vagrant_hostname']
  if vconfig['vagrant_ip'] == '0.0.0.0' && Vagrant.has_plugin?('vagrant-auto_network')
    config.vm.network :private_network, ip: vconfig['vagrant_ip'], auto_network: true
  else
    config.vm.network :private_network, ip: vconfig['vagrant_ip']
  end

  if !vconfig['vagrant_public_ip'].empty? && vconfig['vagrant_public_ip'] == '0.0.0.0'
    config.vm.network :public_network
  elsif !vconfig['vagrant_public_ip'].empty?
    config.vm.network :public_network, ip: vconfig['vagrant_public_ip']
  end

  # SSH options.
  config.ssh.insert_key = false
  config.ssh.forward_agent = true

  # Vagrant box.
  config.vm.box = vconfig['vagrant_box']

  # If a hostsfile manager plugin is installed, add all server names as aliases.
  aliases = []
  if vconfig['drupalvm_webserver'] == 'apache'
    vconfig['apache_vhosts'].each do |host|
      aliases.push(host['servername'])
      aliases.concat(host['serveralias'].split) if host['serveralias']
    end
  else
    vconfig['nginx_hosts'].each do |host|
      aliases.concat(host['server_name'].split)
      aliases.concat(host['server_name_redirect'].split) if host['server_name_redirect']
    end
  end
  aliases = aliases.uniq - [config.vm.hostname, vconfig['vagrant_ip']]

  if Vagrant.has_plugin?('vagrant-hostsupdater')
    config.hostsupdater.aliases = aliases
  elsif Vagrant.has_plugin?('vagrant-hostmanager')
    config.hostmanager.enabled = true
    config.hostmanager.manage_host = true
    config.hostmanager.aliases = aliases
  end

  # Synced folders.
  vconfig['vagrant_synced_folders'].each do |synced_folder|
    options = {
      type: synced_folder['type'],
      rsync__auto: 'true',
      rsync__exclude: synced_folder['excluded_paths'],
      rsync__args: ['--verbose', '--archive', '--delete', '-z', '--chmod=ugo=rwX'],
      id: synced_folder['id'],
      create: synced_folder.include?('create') ? synced_folder['create'] : false,
      mount_options: synced_folder.include?('mount_options') ? synced_folder['mount_options'] : nil
    }
    if synced_folder.include?('options_override')
      options = options.merge(synced_folder['options_override'])
    end
    config.vm.synced_folder synced_folder['local_path'], synced_folder['destination'], options
  end

  # Allow override of the default synced folder type.
  config.vm.synced_folder host_project_dir, '/vagrant', type: vconfig.include?('vagrant_synced_folder_default_type') ? vconfig['vagrant_synced_folder_default_type'] : 'nfs'

  # Provisioning. Use ansible if it's installed, JJG-Ansible-Windows if not.
  if which('ansible-playbook')
    config.vm.provision 'ansible' do |ansible|
      ansible.playbook = "#{host_drupalvm_dir}/provisioning/playbook.yml"
      ansible.galaxy_role_file = "#{host_drupalvm_dir}/provisioning/requirements.yml"
      ansible.extra_vars = {
        config_dir: host_config_dir
      }
    end
  else
    config.vm.provision 'shell' do |sh|
      sh.path = "#{host_drupalvm_dir}/provisioning/JJG-Ansible-Windows/windows.sh"
      sh.args = "-e 'config_dir=\"#{guest_config_dir}\"' #{guest_drupalvm_dir}/provisioning/playbook.yml"
    end
  end
  # ansible_local provisioner is broken in Vagrant < 1.8.2.
  # else
  #   config.vm.provision "ansible_local" do |ansible|
  #     ansible.playbook = "#{guest_drupalvm_dir}/provisioning/playbook.yml"
  #     ansible.galaxy_role_file = "#{guest_drupalvm_dir}/provisioning/requirements.yml"
  #     ansible.extra_vars = {
  #       config_dir: guest_config_dir
  #     }
  #   end
  # end

  # VMware Fusion.
  config.vm.provider :vmware_fusion do |v, override|
    # HGFS kernel module currently doesn't load correctly for native shares.
    override.vm.synced_folder host_project_dir, '/vagrant', type: 'nfs'

    v.gui = false
    v.vmx['memsize'] = vconfig['vagrant_memory']
    v.vmx['numvcpus'] = vconfig['vagrant_cpus']
  end

  # VirtualBox.
  config.vm.provider :virtualbox do |v|
    v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
    v.name = vconfig['vagrant_hostname']
    v.memory = vconfig['vagrant_memory']
    v.cpus = vconfig['vagrant_cpus']
    v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
    v.customize ['modifyvm', :id, '--ioapic', 'on']
  end

  # Parallels.
  config.vm.provider :parallels do |p, override|
    override.vm.box = vconfig['vagrant_box']
    p.name = vconfig['vagrant_hostname']
    p.memory = vconfig['vagrant_memory']
    p.cpus = vconfig['vagrant_cpus']
    p.update_guest_tools = true
  end

  # Set the name of the VM. See: http://stackoverflow.com/a/17864388/100134
  config.vm.define vconfig['vagrant_machine_name']

  # Cache packages and dependencies if vagrant-cachier plugin is present.
  if Vagrant.has_plugin?('vagrant-cachier')
    config.cache.scope = :box
    config.cache.auto_detect = false
    config.cache.enable :apt
    # Cache the composer directory.
    config.cache.enable :generic, cache_dir: '/home/vagrant/.composer/cache'
  end

  # Allow an untracked Vagrantfile to modify the configurations
  eval File.read "#{host_config_dir}/Vagrantfile.local" if File.exist?("#{host_config_dir}/Vagrantfile.local")
end

Please note, if you are using Homestead or a different Vagrantfile format, we
may be unable to assist with your issue. Try to reproduce the issue using a
vanilla Vagrantfile first.

Debug output

Provide a link to a GitHub Gist containing the complete debug output:
https://www.vagrantup.com/docs/other/debugging.html. The debug output should
be very long. Do NOT paste the debug output in the issue, just paste the
link to the Gist.

Using Win 10 PowerShell when I hit the y (or n) key the y should be shown on the screen and then accepted by the script.

What should have happened?

When I typed y and hit enter the y did not show up on the PowerShell window and the script hangs. It works fine with the Windows Command prompt, however.

What actually happened?

Steps to reproduce

  1. Set up a Win 10 machine with PowerShell
  2. Install a dummy Vagrant machine.
  3. Type vagrant destroy

References

Are there any other GitHub issues (open or closed) that should be linked here?
For example:

@dragon788
Copy link
Contributor

dragon788 commented Aug 9, 2016

@ColumbiaBlooms I have a feeling there is something within your Vagrantfile that is getting processed and looking for input that is causing the issue with not being able to destroy. Can you try commenting out most of the Vagrantfile except the boxname and see if you are then able to destroy? Also make sure if you have a Vagrantfile in ~/.vagrant.d/ or $env:HOME/.vagrant.d/ or %USERPROFILE%/.vagrant.d/ that you move it to some other name otherwise it may affect this troubleshooting as well.

Also, if you do a vagrant destroy -f in the directory with your Vagrantfile, does that properly destroy the VM?

@SamStamport
Copy link
Author

Before changing Vagrantfile "vagrant destroy --debug" results in a prompt, but when I type anything nothing happens. The keyboard input is ignore as if the process is hung. I have to stop the Ruby process. Here are the last few lines of output.

DEBUG subprocess: Exit status: 0
INFO warden: Calling OUT action:
#VagrantPlugins::ProviderVirtualBox::Action::Created:0x2e80ae0
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 5 hooks defined.
INFO runner: Running action: machine_action_destroy
#Vagrant::Action::Warden:0x4823448
INFO warden: Calling IN action: #<Proc:0x47dffa8@C:/HashiCorp/Vagrant/embedded
/gems/gems/vagrant-1.8.5/lib/vagrant/action/warden.rb:94 (lambda)>
INFO warden: Calling IN action: #Vagrant::Action::Builtin::Call:0x48233e8
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 5 hooks defined.
INFO runner: Running action: machine_action_destroy
#Vagrant::Action::Builder:0x4740450
INFO warden: Calling IN action:
#Vagrant::Action::Builtin::DestroyConfirm:0x47395b0
INFO interface: ask: Are you sure you want to destroy the 'drupalvm' VM?
[y/N]
INFO interface: ask: drupalvm: Are you sure you want to destroy the
'drupalvm' VM? [y/N]

Running "vagrant destroy -f" works just fine since there is no "y/n" prompt.

I get the following errors when I type "vagrant destroy" with the new Vagrantfile.

vagrant : Vagrant failed to initialize at a very early stage:
At line:1 char:1

  • vagrant destroy
  • - CategoryInfo          : NotSpecified: (Vagrant failed ...ry early stage: 
      :String) [], RemoteException
    - FullyQualifiedErrorId : NativeCommandError
    
    

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.
Path: C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile
Line number: 5
Message: NameError: undefined local variable or method `config' for main:Object

Here is what's left of my Vagrantfile. I guess I didn't understand what you meant by leaving the boxname only.

-- mode: ruby --

vi: set ft=ruby :

Vagrant box.

config.vm.box = vconfig['vagrant_box']

VirtualBox.

config.vm.provider :virtualbox do |v|
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
v.name = vconfig['vagrant_hostname']
v.memory = vconfig['vagrant_memory']
v.cpus = vconfig['vagrant_cpus']
v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
v.customize ['modifyvm', :id, '--ioapic', 'on']
end

@dragon788
Copy link
Contributor

dragon788 commented Aug 10, 2016

You did good, just need to add this line back at the beginning of your file.

Vagrant.configure(2) do |config|

And another end after your last line.

@SamStamport
Copy link
Author

Getting the following messages with updates to Vagrantfile.

vagrant : C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:5:in block in <top (required)>': undefined local variable or methodvconfig' for
main:Object (NameError)
At line:1 char:1

  • vagrant up

    • CategoryInfo : NotSpecified: (C:/Users/samst/...ect (NameError)
      :String) [], RemoteException
    • FullyQualifiedErrorId : NativeCommandError

    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/conf
    ig/v2/loader.rb:37:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/conf ig/v2/loader.rb:37:inload'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/conf
    ig/loader.rb:113:in block (2 levels) in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/conf ig/loader.rb:107:ineach'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/conf
    ig/loader.rb:107:in block in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/conf ig/loader.rb:104:ineach'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/conf
    ig/loader.rb:104:in load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/vagr antfile.rb:28:ininitialize'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/envi
    ronment.rb:740:in new' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/envi ronment.rb:740:invagrantfile'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/envi
    ronment.rb:486:in host' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/envi ronment.rb:208:inblock in action_runner'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/acti
    on/runner.rb:33:in call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/acti on/runner.rb:33:inrun'
    from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/envi
    ronment.rb:473:in hook' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/lib/vagrant/envi ronment.rb:722:inunload'
    from
    C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant:177:in
    ensure in <main>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.5/bin/vagrant:177:in

    '

Current Vagrantfile.

-- mode: ruby --

vi: set ft=ruby :

Vagrant.configure(2) do |config|

Vagrant box.

config.vm.box = vconfig['vagrant_box']

VirtualBox.

config.vm.provider :virtualbox do |v|
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
v.name = vconfig['vagrant_hostname']
v.memory = vconfig['vagrant_memory']
v.cpus = vconfig['vagrant_cpus']
v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
v.customize ['modifyvm', :id, '--ioapic', 'on']
end
end

@dragon788
Copy link
Contributor

dragon788 commented Aug 10, 2016

OK, can you look in the default.config.yml for an entry of vagrant_box and take the name from that and change the config.vm.box = vconfig['vagrant_box'] to config.vm.box = <the value of the 'vagrant_box' variable>?

@SamStamport
Copy link
Author

Still getting a syntax error. I guess I don't understand your instructions ...

vagrant : There is a syntax error in the following Vagrantfile. The syntax
error
At line:1 char:1

  • vagrant status
  • - CategoryInfo          : NotSpecified: (There is a synt...he syntax error 
      :String) [], RemoteException
    - FullyQualifiedErrorId : NativeCommandError
    
    

message is reproduced below for convenience:
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:5: syntax error, unexpected
'<'
config.vm.box = <'geerlingguy/ubuntu1604'> # <...
^
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:10: syntax error,
unexpected tSYMBEG, expecting keyword_end
config.vm.provider :virtualbox do |v|
^
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:18: syntax error,
unexpected keyword_end, expecting end-of-input

Vagrantfile contents:

-- mode: ruby --

vi: set ft=ruby :

Vagrant.configure(2) do |config|

Vagrant box.

config.vm.box = <'geerlingguy/ubuntu1604'>

VirtualBox.

config.vm.provider :virtualbox do |v|
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
v.name = vconfig['vagrant_hostname']
v.memory = vconfig['vagrant_memory']
v.cpus = vconfig['vagrant_cpus']
v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
v.customize ['modifyvm', :id, '--ioapic', 'on']
end
end

@dragon788
Copy link
Contributor

I should have noted that you don't need the angle brackets, they were there
to show the block of text that needed replaced. Remove those and leave the
quotes and see if that works.

On Aug 10, 2016 3:26 PM, "Sam Stamport" [email protected] wrote:

Still getting a syntax error. I guess I don't understand your instructions
...

vagrant : There is a syntax error in the following Vagrantfile. The syntax
error
At line:1 char:1

  • vagrant status
  • - CategoryInfo : NotSpecified: (There is a synt...he syntax error
      :String) [], RemoteException
    - FullyQualifiedErrorId : NativeCommandError
    
    

message is reproduced below for convenience:
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:5: syntax error,
unexpected
'<'
config.vm.box = <'geerlingguy/ubuntu1604'> # <...
^
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:10: syntax error,
unexpected tSYMBEG, expecting keyword_end
config.vm.provider :virtualbox do |v|
^
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:18: syntax error,
unexpected keyword_end, expecting end-of-input

Vagrantfile contents:
-- mode: ruby -- vi: set ft=ruby :

Vagrant.configure(2) do |config|

Vagrant box.

config.vm.box = <'geerlingguy/ubuntu1604'>

VirtualBox.

config.vm.provider :virtualbox do |v|
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
v.name = vconfig['vagrant_hostname']
v.memory = vconfig['vagrant_memory']
v.cpus = vconfig['vagrant_cpus']
v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
v.customize ['modifyvm', :id, '--ioapic', 'on']
end
end


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7649 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdxXkNl72CAdl7lUPvDQ_O4M4K0mcxIks5qejQMgaJpZM4JVlwp
.

@SamStamport
Copy link
Author

Still not working. I get the following when I type vagrant status.

vagrant : There was an error loading a Vagrantfile. The file being loaded

At line:1 char:1

  • vagrant status

    • CategoryInfo : NotSpecified: (There was an er...le being loaded

    :String) [], RemoteException

    • FullyQualifiedErrorId : NativeCommandError

and the error message are shown below. This is usually caused by

a syntax error.

Path:

Line number: /Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile

Message: NameError: undefined local variable or method `vconfig' for

main:Object

Vagrantfile contents

-- mode: ruby --

vi: set ft=ruby :

Vagrant.configure(2) do |config|

Vagrant box.

config.vm.box = 'geerlingguy/ubuntu1604'

VirtualBox.

config.vm.provider :virtualbox do |v|

v.linked_clone = true if Vagrant::VERSION =~ /^1.8/

v.name = vconfig['vagrant_hostname']

v.memory = vconfig['vagrant_memory']

v.cpus = vconfig['vagrant_cpus']

v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']

v.customize ['modifyvm', :id, '--ioapic', 'on']

end

end

From: dragon788 [mailto:[email protected]]
Sent: Thursday, August 11, 2016 8:59 AM
To: mitchellh/vagrant
Cc: Sam Stamport; Mention
Subject: Re: [mitchellh/vagrant] Y/N prompt vagrant destroy does not work on Win 10 PowerShell (#7649)

I should have noted that you don't need the angle brackets, they were there
to show the block of text that needed replaced. Remove those and leave the
quotes and see if that works.

On Aug 10, 2016 3:26 PM, "Sam Stamport" [email protected] wrote:

Still getting a syntax error. I guess I don't understand your instructions
...

vagrant : There is a syntax error in the following Vagrantfile. The syntax
error
At line:1 char:1

  • vagrant status
  • CategoryInfo : NotSpecified: (There is a synt...he syntax error
    :String) [], RemoteException
  • FullyQualifiedErrorId : NativeCommandError

message is reproduced below for convenience:
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:5: syntax error,
unexpected
'<'
config.vm.box = <'geerlingguy/ubuntu1604'> # <...
^
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:10: syntax error,
unexpected tSYMBEG, expecting keyword_end
config.vm.provider :virtualbox do |v|
^
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:18: syntax error,
unexpected keyword_end, expecting end-of-input

Vagrantfile contents:
-- mode: ruby -- vi: set ft=ruby :

Vagrant.configure(2) do |config|

Vagrant box.

config.vm.box = <'geerlingguy/ubuntu1604'>

VirtualBox.

config.vm.provider :virtualbox do |v|
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
v.name = vconfig['vagrant_hostname']
v.memory = vconfig['vagrant_memory']
v.cpus = vconfig['vagrant_cpus']
v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
v.customize ['modifyvm', :id, '--ioapic', 'on']
end
end


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7649 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdxXkNl72CAdl7lUPvDQ_O4M4K0mcxIks5qejQMgaJpZM4JVlwp
.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #7649 (comment) , or mute the thread https://github.com/notifications/unsubscribe-auth/AMYFr1PWqtmNqEIU2YUXKorOI6m5p1pCks5qeyqagaJpZM4JVlwp . https://github.com/notifications/beacon/AMYFr2AwlxOy0u3qSsmO6j50L9VssQuhks5qeyqagaJpZM4JVlwp.gif

@dragon788
Copy link
Contributor

Can you post your entire new Vagrantfile and we'll see if there is
something else that needs tweaked.

On Fri, Aug 12, 2016 at 9:36 AM, Sam Stamport [email protected]
wrote:

Still not working. I get the following when I type vagrant status.

vagrant : There was an error loading a Vagrantfile. The file being loaded

At line:1 char:1

  • vagrant status
  • CategoryInfo : NotSpecified: (There was an er...le being loaded

:String) [], RemoteException

  • FullyQualifiedErrorId : NativeCommandError

and the error message are shown below. This is usually caused by

a syntax error.

Path:

Line number: /Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile

Message: NameError: undefined local variable or method `vconfig' for

main:Object

Vagrantfile contents

-- mode: ruby --

vi: set ft=ruby :

Vagrant.configure(2) do |config|

Vagrant box.

config.vm.box = 'geerlingguy/ubuntu1604'

VirtualBox.

config.vm.provider :virtualbox do |v|

v.linked_clone = true if Vagrant::VERSION =~ /^1.8/

v.name = vconfig['vagrant_hostname']

v.memory = vconfig['vagrant_memory']

v.cpus = vconfig['vagrant_cpus']

v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']

v.customize ['modifyvm', :id, '--ioapic', 'on']

end

end

From: dragon788 [mailto:[email protected]]
Sent: Thursday, August 11, 2016 8:59 AM
To: mitchellh/vagrant
Cc: Sam Stamport; Mention
Subject: Re: [mitchellh/vagrant] Y/N prompt vagrant destroy does not work
on Win 10 PowerShell (#7649)

I should have noted that you don't need the angle brackets, they were there
to show the block of text that needed replaced. Remove those and leave the
quotes and see if that works.

On Aug 10, 2016 3:26 PM, "Sam Stamport" [email protected] wrote:

Still getting a syntax error. I guess I don't understand your
instructions
...

vagrant : There is a syntax error in the following Vagrantfile. The
syntax
error
At line:1 char:1

  • vagrant status
  • CategoryInfo : NotSpecified: (There is a synt...he syntax error
    :String) [], RemoteException
  • FullyQualifiedErrorId : NativeCommandError

message is reproduced below for convenience:
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:5: syntax error,
unexpected
'<'
config.vm.box = <'geerlingguy/ubuntu1604'> # <...
^
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:10: syntax error,
unexpected tSYMBEG, expecting keyword_end
config.vm.provider :virtualbox do |v|
^
C:/Users/samst/Desktop/Drupal/DrupalVM/Vagrantfile:18: syntax error,
unexpected keyword_end, expecting end-of-input

Vagrantfile contents:
-- mode: ruby -- vi: set ft=ruby :

Vagrant.configure(2) do |config|

Vagrant box.

config.vm.box = <'geerlingguy/ubuntu1604'>

VirtualBox.

config.vm.provider :virtualbox do |v|
v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
v.name = vconfig['vagrant_hostname']
v.memory = vconfig['vagrant_memory']
v.cpus = vconfig['vagrant_cpus']
v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
v.customize ['modifyvm', :id, '--ioapic', 'on']
end
end


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7649 (comment)
,
or mute the thread
<https://github.com/notifications/unsubscribe-
auth/AAdxXkNl72CAdl7lUPvDQ_O4M4K0mcxIks5qejQMgaJpZM4JVlwp>
.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <
https://github.com/mitchellh/vagrant/issues/7649#issuecomment-239168656>
, or mute the thread <https://github.com/notifications/unsubscribe-auth/
AMYFr1PWqtmNqEIU2YUXKorOI6m5p1pCks5qeyqagaJpZM4JVlwp> . <
https://github.com/notifications/beacon/AMYFr2AwlxOy0u3qSsmO6j50L9VssQ
uhks5qeyqagaJpZM4JVlwp.gif>


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7649 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdxXtKcorMc-MiARXgWBHE696QwJTGOks5qfIT7gaJpZM4JVlwp
.

@SamStamport
Copy link
Author

SamStamport commented Aug 12, 2016

Vagrantfile contents:

# -_\- mode: ruby -_-

# vi: set ft=ruby :

Vagrant.configure(2) do |config|
  # Vagrant box.
  config.vm.box = 'geerlingguy/ubuntu1604'

  # VirtualBox.
  config.vm.provider :virtualbox do |v|
    v.linked_clone = true if Vagrant::VERSION =~ /^1.8/
    v.name = vconfig['vagrant_hostname']
    v.memory = vconfig['vagrant_memory']
    v.cpus = vconfig['vagrant_cpus']
    v.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']
    v.customize ['modifyvm', :id, '--ioapic', 'on']
  end
end

@chrisroberts chrisroberts added this to the 1.8 milestone Oct 3, 2016
@chrisroberts
Copy link
Member

The problem here is that the vconfig variable being used within your Vagrantfile is not defined. This is causing errors to be generated when Vagrant attempts to load it. Cheers!

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants