Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: hh/veewee
...
head fork: hh/veewee
  • 4 commits
  • 29 files changed
  • 0 commit comments
  • 1 contributor
Showing with 871 additions and 47 deletions.
  1. +2 −0  lib/veewee/command/vagrant/basebox.rb
  2. +39 −0 lib/veewee/command/vagrant/winrm.rb
  3. +6 −1 lib/veewee/definition.rb
  4. +8 −0 lib/veewee/provider/core/box.rb
  5. +15 −5 lib/veewee/provider/core/box/build.rb
  6. +17 −0 lib/veewee/provider/core/box/copy.rb
  7. +26 −13 lib/veewee/provider/core/box/exec.rb
  8. +15 −0 lib/veewee/provider/core/box/iwinrm.rb
  9. +20 −0 lib/veewee/provider/core/box/wincp.rb
  10. +53 −0 lib/veewee/provider/core/box/winrm.rb
  11. +47 −0 lib/veewee/provider/core/helper/comm.rb
  12. +146 −0 lib/veewee/provider/core/helper/winrm.rb
  13. +1 −1  lib/veewee/provider/parallels/box/helper/buildinfo.rb
  14. +1 −0  lib/veewee/provider/virtualbox/box.rb
  15. +16 −8 lib/veewee/provider/virtualbox/box/create.rb
  16. +1 −1  lib/veewee/provider/virtualbox/box/helper/buildinfo.rb
  17. +9 −0 lib/veewee/provider/virtualbox/box/helper/create.rb
  18. +29 −0 lib/veewee/provider/virtualbox/box/helper/winrm_options.rb
  19. +31 −11 lib/veewee/provider/virtualbox/box/up.rb
  20. +1 −1  lib/veewee/provider/vmfusion/box/helper/buildinfo.rb
  21. +6 −6 templates/windows-2008R1-serverstandard-amd64/Autounattend.xml
  22. +155 −0 templates/windows-7-enterprise-amd64-winrm/Autounattend.xml
  23. +52 −0 templates/windows-7-enterprise-amd64-winrm/README.md
  24. +45 −0 templates/windows-7-enterprise-amd64-winrm/definition.rb
  25. +40 −0 templates/windows-7-enterprise-amd64-winrm/install-cygwin-sshd.bat
  26. +2 −0  templates/windows-7-enterprise-amd64-winrm/install-vbox-guest.bat
  27. +14 −0 templates/windows-7-enterprise-amd64-winrm/install-winrm.bat
  28. BIN  templates/windows-7-enterprise-amd64-winrm/oracle-cert.cer
  29. +74 −0 templates/windows-7-enterprise-amd64-winrm/postinstall.sh
View
2  lib/veewee/command/vagrant/basebox.rb
@@ -8,6 +8,7 @@
require 'veewee/command/vagrant/up'
require 'veewee/command/vagrant/halt'
require 'veewee/command/vagrant/ssh'
+require 'veewee/command/vagrant/winrm'
require 'veewee/command/vagrant/define'
require 'veewee/command/vagrant/undefine'
require 'veewee/command/vagrant/export'
@@ -31,6 +32,7 @@ def initialize(argv,env)
@subcommands.register(:up) { Veewee::Command::Vagrant::Up }
@subcommands.register(:halt) { Veewee::Command::Vagrant::Halt }
@subcommands.register(:ssh) { Veewee::Command::Vagrant::Ssh }
+ @subcommands.register(:winrm) { Veewee::Command::Vagrant::Winrm }
@subcommands.register(:define) { Veewee::Command::Vagrant::Define }
@subcommands.register(:undefine) { Veewee::Command::Vagrant::Undefine }
@subcommands.register(:export) { Veewee::Command::Vagrant::Export }
View
39 lib/veewee/command/vagrant/winrm.rb
@@ -0,0 +1,39 @@
+require 'optparse'
+
+module Veewee
+ module Command
+ module Vagrant
+ class Winrm < ::Vagrant::Command::Base
+ def execute
+ options = {}
+
+ opts = OptionParser.new do |opts|
+ opts.banner = "Winrm into the basebox"
+ opts.separator ""
+ opts.separator "Usage: vagrant basebox winrm <boxname> <command>"
+
+ opts.on("-d", "--debug", "enable debugging") do |d|
+ options['debug'] = d
+ end
+
+ end
+
+ # Parse the options
+ argv = parse_options(opts)
+ return if !argv
+ raise ::Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 2
+
+ begin
+ venv=Veewee::Environment.new(options)
+ venv.ui=@env.ui
+ venv.providers["virtualbox"].get_box(argv[0]).iwinrm(arg[1])
+ rescue Veewee::Error => ex
+ venv.ui.error ex
+ exit -1
+ end
+
+ end
+ end
+ end
+ end
+end
View
7 lib/veewee/definition.rb
@@ -21,6 +21,8 @@ class Definition
attr_accessor :ssh_login_timeout, :ssh_user , :ssh_password, :ssh_key, :ssh_host_port, :ssh_guest_port
+ attr_accessor :winrm_login_timeout, :winrm_user , :winrm_password, :winrm_host_port, :winrm_guest_port
+
attr_accessor :sudo_cmd
attr_accessor :shutdown_cmd
@@ -72,6 +74,9 @@ def initialize(name,path,env)
# :ssh_host_port => "2222", :ssh_guest_port => "22", :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
# :shutdown_cmd => "shutdown -h now",
# :kickstart_file => nil,
+ @winrm_host_port = "5985"; @winrm_guest_port = "5985"
+ @winrm_login_timeout = "10000"
+ @boot_cmd_sequence = [] # Empty list by default
@virtualbox={:vm_options => {}}
@vmfusion={:vm_options => {}}
@@ -160,7 +165,7 @@ def valid?
# Postinstall files require a valid user and password
unless self.postinstall_files.nil?
- if self.ssh_user.nil? || self.ssh_password.nil?
+ if (self.ssh_user.nil? || self.ssh_password.nil?) && (self.winrm_user.nil? || self.winrm_password.nil?)
return false
end
end
View
8 lib/veewee/provider/core/box.rb
@@ -3,15 +3,21 @@
require 'veewee/provider/core/helper/web'
require 'veewee/provider/core/helper/shell'
require 'veewee/provider/core/helper/iso'
+require 'veewee/provider/core/helper/winrm'
+require 'veewee/provider/core/helper/comm'
require 'veewee/provider/core/box/build'
require 'veewee/provider/core/box/scp'
+require 'veewee/provider/core/box/wincp'
+require 'veewee/provider/core/box/copy'
require 'veewee/provider/core/box/exec'
require 'veewee/provider/core/box/poweroff'
require 'veewee/provider/core/box/halt'
require 'veewee/provider/core/box/sudo'
require 'veewee/provider/core/box/ssh'
require 'veewee/provider/core/box/issh'
+require 'veewee/provider/core/box/winrm'
+require 'veewee/provider/core/box/iwinrm'
require 'veewee/provider/core/box/floppy'
module Veewee
@@ -26,6 +32,8 @@ class Box
include ::Veewee::Provider::Core::Helper::Web
include ::Veewee::Provider::Core::Helper::Shell
include ::Veewee::Provider::Core::Helper::Ssh
+ include ::Veewee::Provider::Core::Helper::Winrm
+ include ::Veewee::Provider::Core::Helper::Comm
include ::Veewee::Provider::Core::Helper::Iso
include ::Veewee::Provider::Core::BoxCommand
View
20 lib/veewee/provider/core/box/build.rb
@@ -74,12 +74,17 @@ def build(options={})
sleep 2
end
+
self.transfer_buildinfo(options)
self.handle_postinstall(options)
env.ui.confirm "The box #{name} was build succesfully!"
env.ui.info "You can now login to the box with:"
- env.ui.info ssh_command_string
+ if (definition.winrm_user && definition.winrm_password)
+ env.ui.info winrm_command_string
+ else
+ env.ui.info ssh_command_string
+ end
return self
end
@@ -194,9 +199,14 @@ def handle_postinstall(options)
# Filenames of postinstall_files are relative to their definition
filename=File.join(definition.path,postinstall_file)
unless File.basename(postinstall_file)=~/^_/
- self.scp(filename,File.basename(filename))
- self.exec("chmod +x \"#{File.basename(filename)}\"")
- self.exec(sudo("./"+File.basename(filename)))
+ self.copy_to_box(filename,File.basename(filename))
+ if (definition.winrm_user && definition.winrm_password)
+ # no sudo on windows, batch files only please?
+ self.exec(File.basename(filename))
+ else
+ self.exec("chmod +x \"#{File.basename(filename)}\"")
+ self.exec(sudo("./"+File.basename(filename)))
+ end
else
env.logger.info "Skipping postinstallfile #{postinstall_file}"
end
@@ -213,7 +223,7 @@ def transfer_buildinfo(options)
infofile.puts "#{info[:content]}"
infofile.rewind
infofile.close
- self.scp(infofile.path,info[:filename])
+ self.copy_to_box(infofile.path,info[:filename])
infofile.delete
rescue RuntimeError => ex
env.ui.error "Error transfering file #{info[:filename]} failed, possible not enough permissions to write? #{ex}"
View
17 lib/veewee/provider/core/box/copy.rb
@@ -0,0 +1,17 @@
+module Veewee
+ module Provider
+ module Core
+ module BoxCommand
+
+ def copy_to_box(localfile,remotefile,options={})
+ raise Veewee::Error,"Box is not running" unless self.running?
+ if definition.winrm_user && definition.winrm_password # prefer winrm
+ self.wincp(localfile,remotefile,options)
+ else
+ self.scp(localfile,remotefile,options)
+ end
+ end
+ end # Module
+ end # Module
+ end # Module
+end # Module
View
39 lib/veewee/provider/core/box/exec.rb
@@ -8,25 +8,38 @@ def ssh_command_string
"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p #{ssh_options[:port]} -l #{definition.ssh_user} #{self.ip_address}"
end
+ def winrm_command_string
+ "knife winrm -m #{self.ip_address}-P #{winrm_options[:port]} -x #{definition.winrm_user}" +
+ " -P #{definition.winrm_password} COMMAND"
+ end
+
def exec(command,options={})
raise Veewee::Error,"Box is not running" unless self.running?
- begin
- new_options=ssh_options.merge(options)
- self.when_ssh_login_works(self.ip_address,new_options) do
- begin
- env.logger.info "About to execute remote command #{command} on box #{name} - #{self.ip_address} - #{new_options}"
- result=self.ssh_execute(self.ip_address,command,new_options)
- return result
- rescue RuntimeError => ex
- env.ui.error "Error executing command #{command} : #{ex}"
- raise Veewee::SshError, ex
+ if definition.winrm_user && definition.winrm_password
+ env.ui.error "WINRM EXEC NOT IMPLEMPENTED YET"
+ env.ui.error "Command: #{command}"
+ elsif definition.ssh_user && definition.ssh_password
+
+ begin
+ new_options=ssh_options.merge(options)
+ self.when_ssh_login_works(self.ip_address,new_options) do
+ begin
+ env.logger.info "About to execute remote command #{command} on box #{name} - #{self.ip_address} - #{new_options}"
+ result=self.ssh_execute(self.ip_address,command,new_options)
+ return result
+ rescue RuntimeError => ex
+ env.ui.error "Error executing command #{command} : #{ex}"
+ raise Veewee::SshError, ex
+ end
end
+ rescue Net::SSH::AuthenticationFailed => ex # may want to catch winrm auth fails as well
+ env.ui.error "Authentication failure"
+ raise Veewee::SshError, ex
end
- rescue Net::SSH::AuthenticationFailed => ex
- env.ui.error "Authentication failure"
- raise Veewee::SshError, ex
+
end
+
end
end # Module
end # Module
View
15 lib/veewee/provider/core/box/iwinrm.rb
@@ -0,0 +1,15 @@
+require 'veewee/provider/core/helper/ssh'
+module Veewee
+ module Provider
+ module Core
+ module BoxCommand
+
+ def iwinrm(command=nil,options={})
+ self.winrm(command,options.merge({:interactive => true}))
+ end
+
+ end # Module
+ end # Module
+ end # Module
+end # Module
+
View
20 lib/veewee/provider/core/box/wincp.rb
@@ -0,0 +1,20 @@
+require 'veewee/provider/core/helper/winrm'
+module Veewee
+ module Provider
+ module Core
+ module BoxCommand
+
+ def wincp(localfile,remotefile,options={})
+ raise Veewee::Error,"Box is not running" unless self.running?
+ begin
+ self.when_winrm_login_works(self.ip_address,winrm_options.merge(options)) do
+ env.ui.info "We connected via WINRM!"
+ env.ui.info "Going to try and copy #{localfile} to #{remotefile}"
+ env.ui.error "However File copy via WINRM not implemented yet, look at core/helper/scp"
+ end
+ end
+ end
+ end # Module
+ end # Module
+ end # Module
+end # Module
View
53 lib/veewee/provider/core/box/winrm.rb
@@ -0,0 +1,53 @@
+require 'veewee/provider/core/helper/winrm'
+module Veewee
+ module Provider
+ module Core
+ module BoxCommand
+
+
+ def winrm(command=nil,options={})
+
+ raise Veewee::Error,"Box is not running" unless self.running?
+
+ if (options[:interactive]==true)
+ # Command line options
+ host_ip=self.ip_address
+
+ unless host_ip.nil? || host_ip==""
+ winrm_command="winrm #{winrm_commandline_options(options)} #{host_ip} \"#{command}\""
+ else
+ env.ui.error "Can't winrm into '#{@name} as we couldn't figure out it's ip-address"
+ end
+ else
+ winrm_options={:user => definition.winrm_user,:password => definition.winrm_password, :port => definition.winrm_host_port}
+ winrm_execute(host_ip,command,winrm_options)
+ end
+
+ end
+
+ private
+ def winrm_options(options)
+
+ command_options = [
+ #"-q", #Suppress warning messages
+ # "-T", #Pseudo-terminal will not be allocated because stdin is not a terminal.
+ "-p #{winrm_options[:port]}",
+ "-o UserKnownHostsFile=/dev/null",
+ "-t -o StrictHostKeyChecking=no",
+ "-o IdentitiesOnly=yes",
+ "-o VerifyHostKeyDNS=no"
+ ]
+ if !(definition.winrm_key.nil? || definition.winrm_key.length!="")
+ command_options << "-i #{definition.winrm_key}"
+ end
+ commandline_options="#{command_options.join(" ")} ".strip
+
+ user_option=definition.winrm_user.nil? ? "" : "-l #{definition.winrm_user}"
+
+ return "#{commandline_options} #{user_option}"
+ end
+ end # Module
+ end # Module
+ end # Module
+end # Module
+
View
47 lib/veewee/provider/core/helper/comm.rb
@@ -0,0 +1,47 @@
+module Veewee
+ module Provider
+ module Core
+ module Helper
+
+ module Comm
+
+ def comm_method
+ if (definition.winrm_user && definition.winrm_password)
+ :winrm
+ else
+ :ssh
+ end
+ end
+
+ def when_comm_login_works(ip="127.0.0.1", options = { } , &block)
+ case comm_method
+ when :winrm
+ when_winrm_login_works(ip,options,block)
+ when :ssh
+ when_ssh_login_works(ip,options,block)
+ end
+ end
+
+ def comm_transfer_file(host,filename,destination = '.' , options = {})
+ case comm_method
+ when :winrm
+ winrm_transfer_file(host,filename,destination,options)
+ when :ssh
+ ssh_transfer_file(host,filename,destination,options)
+ end
+ end
+
+ def comm_execute(host,command, options = { :progress => "on"} )
+ case comm_method
+ when :winrm
+ winrm_execute(host,command, options )
+ when :ssh
+ ssh_execute(host,command, options )
+ end
+ end
+
+ end #Class
+ end #Module
+ end #Module
+ end #Module
+end #Module
View
146 lib/veewee/provider/core/helper/winrm.rb
@@ -0,0 +1,146 @@
+module Veewee
+ module Provider
+ module Core
+ module Helper
+
+ class WinrmResult
+ attr_accessor :stdout
+ attr_accessor :stderr
+ attr_accessor :status
+
+ def initialize(stdout,stderr,status)
+ @stdout=stdout
+ @stderr=stderr
+ @status=status
+ end
+ end
+
+ module Winrm
+
+ require 'timeout'
+ require 'log4r'
+ require 'em-winrm'
+ require 'highline'
+
+ def winrm_up?(ip,options)
+ @httpcli = HTTPClient.new(:agent_name => 'Ruby WinRM Client')
+ @httpcli.receive_timeout = 10
+ @httpcli.set_auth(nil, options[:user], options[:pass])
+ @httpcli.get("http://#{ip}:#{options[:port]}/wsman")
+ return true
+ rescue HTTPClient::ReceiveTimeoutError
+ return false
+ end
+
+ def when_winrm_login_works(ip="127.0.0.1", options = {}, &block)
+
+ options=winrm_options.merge(options.merge({:operation_timeout => 5}))
+
+ env.ui.info "Waiting for winrm login on #{ip} with user #{options[:user]} to windows on port => #{options[:port]} to work, timeout=#{options[:timeout]} sec"
+
+
+ begin
+ Timeout::timeout(options[:timeout]) do
+ connected=false
+ while !connected do
+ begin
+ env.ui.info ".",{:new_line => false}
+ next if not winrm_up?(ip, options)
+ winrm_execute(ip,"hostname",options.merge({:progress => nil}))
+ env.ui.info "\n"
+ block.call(ip);
+ env.ui.info ""
+ return true
+ rescue Exception => e
+ puts e.inspect
+ puts e.message
+ puts e.backtrace.inspect
+ sleep 5
+ end
+ end
+ end
+ rescue Timeout::Error
+ env.ui.error "Winrm timeout #{options[:timeout]} sec has been reached."
+ exit -1
+ rescue WinRM::WinRMHTTPTransportError => e
+ if e.message =~ /401/
+ env.ui.error "Unable to authenticate as '#{options[:user]}' with password '#{options[:pass]}'"
+ else
+ raise e
+ end
+ end
+ return false
+ end
+
+
+ def winrm_transfer_file(host,filename,destination = '.' , options = {})
+ options = winrm_options.merge(options.merge({:paranoid => false }))
+ # when_winrm_login_works
+
+ env.ui.info "FIXME: Transferring #{filename} to #{destination} "
+ # print these out while uploading:
+ env.ui.info ".",{:new_line => false}
+ # t::SSH.start( host,options[:user],options )
+ env.ui.info ""
+ end
+
+ def new_session(host,options)
+ opts = winrm_options.merge(options)
+
+ # create a session
+ begin
+ endpoint = "http://#{host}:#{opts[:port]}/wsman"
+ client = ::WinRM::WinRMWebService.new(endpoint, :plaintext, opts)
+ client.set_timeout(opts[:operation_timeout]) if opts[:operation_timeout]
+ rescue ::WinRM::WinRMAuthorizationError => error
+ raise ::WinRM::WinRMAuthorizationError.new("#{error.message}@#{host}")
+ end
+ client
+ end
+
+ def winrm_execute(host,command, options = { :progress => "on"} )
+
+ options = winrm_options.merge({:exitcode => "0"}.merge(options))
+ stdout=""
+ stderr=""
+ status=-99999
+
+ session = new_session(host, options)
+
+ env.ui.info "Executing winrm command: #{command}" if options[:progress]
+
+ remote_id = session.open_shell
+ command_id = session.run_command(remote_id, command)
+ output = session.get_command_output(remote_id, command_id) do |out,error|
+ if out
+ stdout += out
+ env.ui.info out,{:new_line => false} if options[:progress]
+ end
+ if error
+ stderr += error
+ env.ui.info error,{:new_line => false} if options[:progress]
+ end
+ end
+ status = output[:exitcode]
+ env.ui.info "ERROR: exit code #{exit_code}" if status > 0
+
+ if (status.to_s != options[:exitcode] )
+ if (options[:exitcode]=="*")
+ #its a test so we don't need to worry
+ else
+ raise "Exitcode was not what we expected"
+ end
+
+ end
+
+ return Veewee::Provider::Core::Helper::WinrmResult.new(stdout,stderr,status)
+
+ end
+
+
+
+ end #Class
+ end #Module
+ end #Module
+ end #Module
+end #Module
View
2  lib/veewee/provider/parallels/box/helper/buildinfo.rb
@@ -36,7 +36,7 @@ def transfer_buildinfo(options)
env.logger.info "About to transfer parallels tools iso buildinfo to the box #{name} - #{ip_address} - #{ssh_options}"
iso_image=guest_iso_path
- self.scp(iso_image,File.basename(iso_image))
+ self.copy_to_box(iso_image,File.basename(iso_image))
end
end
View
1  lib/veewee/provider/virtualbox/box.rb
@@ -12,6 +12,7 @@
require 'veewee/provider/virtualbox/box/helper/ip'
require 'veewee/provider/virtualbox/box/helper/forwarding'
require 'veewee/provider/virtualbox/box/helper/ssh_options'
+require 'veewee/provider/virtualbox/box/helper/winrm_options'
require 'veewee/provider/virtualbox/box/helper/guest_additions'
require 'veewee/provider/virtualbox/box/helper/status'
require 'veewee/provider/virtualbox/box/helper/version'
View
24 lib/veewee/provider/virtualbox/box/create.rb
@@ -12,13 +12,6 @@ def create(options={})
raise Veewee::Error,"To create the vm '#{name}' the directory '#{box_directory}' needs to be empty. \nThis could be caused by an badly closed vm.\nRemove it manually before you proceed."
end
- guessed_port=guess_free_port(definition.ssh_host_port.to_i,definition.ssh_host_port.to_i+40).to_s
- if guessed_port.to_s!=definition.ssh_host_port
- env.ui.warn "Changing ssh port from #{definition.ssh_host_port} to #{guessed_port}"
- definition.ssh_host_port=guessed_port.to_s
- end
-
-
# Suppress those annoying virtualbox messages
self.suppress_messages
@@ -48,7 +41,22 @@ def create(options={})
self.add_floppy_controller
self.attach_floppy
- self.add_ssh_nat_mapping
+ if definition.winrm_user && definition.winrm_password # prefer winrm
+ env.ui.warn "Using winrm because winrm_user and winrm_password are both set"
+ guessed_port=guess_free_port(definition.winrm_host_port.to_i,definition.winrm_host_port.to_i+40).to_s
+ if guessed_port.to_s!=definition.winrm_host_port
+ env.ui.warn "Changing winrm port from #{definition.winrm_host_port} to #{guessed_port}"
+ definition.winrm_host_port=guessed_port.to_s
+ end
+ self.add_winrm_nat_mapping
+ else
+ guessed_port=guess_free_port(definition.ssh_host_port.to_i,definition.ssh_host_port.to_i+40).to_s
+ if guessed_port.to_s!=definition.ssh_host_port
+ env.ui.warn "Changing ssh port from #{definition.ssh_host_port} to #{guessed_port}"
+ definition.ssh_host_port=guessed_port.to_s
+ end
+ self.add_ssh_nat_mapping
+ end
end
View
2  lib/veewee/provider/virtualbox/box/helper/buildinfo.rb
@@ -16,7 +16,7 @@ def transfer_buildinfo(options)
super(options)
iso_image="VBoxGuestAdditions_#{self.vbox_version}.iso"
env.logger.info "About to transfer virtualbox guest additions iso to the box #{name} - #{ip_address} - #{ssh_options}"
- self.scp("#{File.join(env.config.veewee.iso_dir,iso_image)}",File.basename(iso_image))
+ self.copy_to_box("#{File.join(env.config.veewee.iso_dir,iso_image)}",File.basename(iso_image))
end
end
View
9 lib/veewee/provider/virtualbox/box/helper/create.rb
@@ -31,6 +31,15 @@ def add_ssh_nat_mapping
end
end
+ def add_winrm_nat_mapping
+
+ unless definition.nil?
+ #Map SSH Ports
+ command="#{@vboxcmd} modifyvm '#{name}' --natpf1 'guestwinrm,tcp,,#{definition.winrm_host_port},,#{definition.winrm_guest_port}'"
+ shell_exec("#{command}")
+ end
+ end
+
def add_shared_folder
command="#{@vboxcmd} sharedfolder add '#{name}' --name 'veewee-validation' --hostpath '#{File.expand_path(env.validation_dir)}' --automount"
shell_exec("#{command}")
View
29 lib/veewee/provider/virtualbox/box/helper/winrm_options.rb
@@ -0,0 +1,29 @@
+module Veewee
+ module Provider
+ module Virtualbox
+ module BoxCommand
+
+ def winrm_options
+ port=definition.winrm_host_port
+ if self.exists?
+ forward=self.forwarding("guestwinrm")
+ unless forward.nil?
+ port=forward[:host_port]
+ end
+ end
+
+ winrm_options={
+ :user => definition.winrm_user,
+ :pass => definition.winrm_password,
+ :port => port,
+ :basic_auth_only => true,
+ :timeout => definition.winrm_login_timeout.to_i
+ }
+ return winrm_options
+
+ end
+
+ end
+ end
+ end
+end
View
42 lib/veewee/provider/virtualbox/box/up.rb
@@ -8,20 +8,40 @@ def up(options={})
raise Veewee::Error,"Box is already running" if self.running?
- # Before we start,correct the ssh port if needed
- forward=self.forwarding("guestssh")
- guessed_port=guess_free_port(definition.ssh_host_port.to_i,definition.ssh_host_port.to_i+40).to_s
- definition.ssh_host_port=guessed_port.to_s
-
- unless forward.nil?
- if guessed_port!=forward[:guest_port]
- # Remove the existing one
- self.delete_forwarding("guestssh")
- env.ui.warn "Changing ssh port from #{forward[:guest_port]} to #{guessed_port}"
- self.add_ssh_nat_mapping
+ if definition.winrm_user && definition.winrm_password # prefer winrm
+ # Before we start,correct the ssh port if needed
+ forward=self.forwarding("guestwinrm")
+ guessed_port=guess_free_port(definition.winrm_host_port.to_i,definition.winrm_host_port.to_i+40).to_s
+ definition.winrm_host_port=guessed_port.to_s
+
+ unless forward.nil?
+ if guessed_port!=forward[:guest_port]
+ # Remove the existing one
+ self.delete_forwarding("guestwinrm")
+ env.ui.warn "Changing winrm port on UP from #{forward[:guest_port]} to #{guessed_port}"
+ self.add_winrm_nat_mapping
+ end
+ else
+ self.add_winrm_nat_mapping
end
+
else
+ # Before we start,correct the ssh port if needed
+ forward=self.forwarding("guestssh")
+ guessed_port=guess_free_port(definition.ssh_host_port.to_i,definition.ssh_host_port.to_i+40).to_s
+ definition.ssh_host_port=guessed_port.to_s
+
+ unless forward.nil?
+ if guessed_port!=forward[:guest_port]
+ # Remove the existing one
+ self.delete_forwarding("guestssh")
+ env.ui.warn "Changing ssh port from #{forward[:guest_port]} to #{guessed_port}"
self.add_ssh_nat_mapping
+ end
+ else
+ self.add_ssh_nat_mapping
+ end
+
end
self.suppress_messages
View
2  lib/veewee/provider/vmfusion/box/helper/buildinfo.rb
@@ -34,7 +34,7 @@ def transfer_buildinfo(options)
env.logger.info "About to transfer vmware tools iso buildinfo to the box #{name} - #{ip_address} - #{ssh_options}"
iso_image=guest_iso_path
- self.scp(iso_image,File.basename(iso_image))
+ self.copy_to_box(iso_image,File.basename(iso_image))
end
end
View
12 templates/windows-2008R1-serverstandard-amd64/Autounattend.xml
@@ -107,11 +107,11 @@
<!-- <Description>Install Chef Client</Description> -->
<!-- <Order>2</Order> -->
<!-- </SynchronousCommand> -->
- <SynchronousCommand wcm:action="add">
- <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine>
- <Description>Install Cygwin SSHD</Description>
- <Order>2</Order>
- </SynchronousCommand>
+ <!-- <SynchronousCommand wcm:action="add"> -->
+ <!-- <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine> -->
+ <!-- <Description>Install Cygwin SSHD</Description> -->
+ <!-- <Order>2</Order> -->
+ <!-- </SynchronousCommand> -->
<!-- needed wget -->
<!-- <SynchronousCommand wcm:action="add"> -->
<!-- <CommandLine>cmd.exe /c a:install-guest-additions.bat</CommandLine> -->
@@ -128,7 +128,7 @@
<HelpCustomized>false</HelpCustomized>
</OEMInformation>
<!-- Rename computer here. -->
- <ComputerName>vagrant-2008R1-serverstandard</ComputerName>
+ <ComputerName>vagrant-2008R1</ComputerName>
<TimeZone>New Zealand Standard Time</TimeZone>
<RegisteredOwner></RegisteredOwner>
</component>
View
155 templates/windows-7-enterprise-amd64-winrm/Autounattend.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<unattend xmlns="urn:schemas-microsoft-com:unattend">
+ <servicing></servicing>
+ <settings pass="windowsPE">
+ <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <DiskConfiguration>
+ <Disk wcm:action="add">
+ <CreatePartitions>
+ <CreatePartition wcm:action="add">
+ <Order>1</Order>
+ <Type>Primary</Type>
+ <Size>10000</Size>
+ </CreatePartition>
+ </CreatePartitions>
+ <ModifyPartitions>
+ <ModifyPartition wcm:action="add">
+ <Extend>false</Extend>
+ <Format>NTFS</Format>
+ <Letter>C</Letter>
+ <Order>1</Order>
+ <PartitionID>1</PartitionID>
+ <Label>Windows 2008R2</Label>
+ </ModifyPartition>
+ </ModifyPartitions>
+ <DiskID>0</DiskID>
+ <WillWipeDisk>true</WillWipeDisk>
+ </Disk>
+ <WillShowUI>OnError</WillShowUI>
+ </DiskConfiguration>
+ <UserData>
+ <ProductKey>
+ <WillShowUI>Never</WillShowUI>
+ </ProductKey>
+ <AcceptEula>true</AcceptEula>
+ <FullName>Vagrant Fullname</FullName>
+ <Organization>Vagrant Inc</Organization>
+ </UserData>
+ <ImageInstall>
+ <OSImage>
+ <InstallTo>
+ <DiskID>0</DiskID>
+ <PartitionID>1</PartitionID>
+ </InstallTo>
+ <WillShowUI>OnError</WillShowUI>
+ <InstallToAvailablePartition>false</InstallToAvailablePartition>
+ <InstallFrom>
+ <MetaData wcm:action="add">
+ <Key>/IMAGE/NAME</Key>
+ <Value>Windows 7 ENTERPRISE</Value>
+ </MetaData>
+ </InstallFrom>
+ </OSImage>
+ </ImageInstall>
+ </component>
+ <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <SetupUILanguage>
+ <UILanguage>en-US</UILanguage>
+ </SetupUILanguage>
+ <InputLocale>en-US</InputLocale>
+ <SystemLocale>en-US</SystemLocale>
+ <UILanguage>en-US</UILanguage>
+ <UILanguageFallback>en-US</UILanguageFallback>
+ <UserLocale>en-US</UserLocale>
+ </component>
+ </settings>
+ <settings pass="oobeSystem">
+ <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <UserAccounts>
+ <AdministratorPassword>
+ <Value>ZABnAEIAaABBAEcAYwBBAGMAZwBCAGgAQQBHADQAQQBkAEEAQgBRAEEARwBFAEEAYwB3AEIAegBBAEgAYwBBAGIAdwBCAHkAQQBHAFEAQQBBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
+ <PlainText>false</PlainText>
+ </AdministratorPassword>
+ <LocalAccounts>
+ <LocalAccount wcm:action="add">
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</PlainText>
+ </Password>
+ <Description>Vagrant User</Description>
+ <DisplayName>vagrant</DisplayName>
+ <Group>administrators</Group>
+ <Name>vagrant</Name>
+ </LocalAccount>
+ </LocalAccounts>
+ </UserAccounts>
+ <OOBE>
+ <HideEULAPage>true</HideEULAPage>
+ <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
+ <NetworkLocation>Work</NetworkLocation>
+ <ProtectYourPC>3</ProtectYourPC>
+ </OOBE>
+ <AutoLogon>
+ <Password>
+ <Value>dgBhAGcAcgBhAG4AdABQAGEAcwBzAHcAbwByAGQA</Value>
+ <PlainText>false</PlainText>
+ </Password>
+ <Username>vagrant</Username>
+ <Enabled>true</Enabled>
+ </AutoLogon>
+ <FirstLogonCommands>
+ <!-- <SynchronousCommand wcm:action="add"> -->
+ <!-- <CommandLine>cmd.exe /c a:install-cygwin-sshd.bat</CommandLine> -->
+ <!-- <Description>Install Cygwin SSH</Description> -->
+ <!-- <Order>1</Order> -->
+ <!-- <RequiresUserInput>true</RequiresUserInput> -->
+ <!-- </SynchronousCommand> -->
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-vbox-guest.bat</CommandLine>
+ <Description>Install Win RM</Description>
+ <Order>1</Order>
+ <RequiresUserInput>true</RequiresUserInput>
+ </SynchronousCommand>
+ <SynchronousCommand wcm:action="add">
+ <CommandLine>cmd.exe /c a:install-winrm.bat</CommandLine>
+ <Description>Install Win RM</Description>
+ <Order>2</Order>
+ <RequiresUserInput>true</RequiresUserInput>
+ </SynchronousCommand>
+ </FirstLogonCommands>
+ <ShowWindowsLive>false</ShowWindowsLive>
+ </component>
+ </settings>
+ <settings pass="specialize">
+ <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
+ <OEMInformation>
+ <HelpCustomized>false</HelpCustomized>
+ </OEMInformation>
+ <!-- Rename computer here. -->
+ <ComputerName>vagrant-2008R2</ComputerName>
+ <TimeZone>Pacific Standard Time</TimeZone>
+ <RegisteredOwner>Vagrant</RegisteredOwner>
+ <ShowWindowsLive>false</ShowWindowsLive>
+ </component>
+ <component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <SkipAutoActivation>true</SkipAutoActivation>
+ </component>
+ <component name="Security-Malware-Windows-Defender" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <DisableAntiSpyware>true</DisableAntiSpyware>
+ </component>
+ <component name="Microsoft-Windows-SystemRestore-Main" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <DisableSR>1</DisableSR>
+ </component>
+ </settings>
+ <settings pass="generalize">
+ <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <SkipRearm>1</SkipRearm>
+ </component>
+ </settings>
+ <settings pass="offlineServicing">
+ <component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <EnableLUA>false</EnableLUA>
+ </component>
+ </settings>
+ <cpi:offlineImage cpi:source="catalog:d:/sources/install_windows 7 enterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
+</unattend>
View
52 templates/windows-7-enterprise-amd64-winrm/README.md
@@ -0,0 +1,52 @@
+You can download a free trial of Windows 7 Enterprise 90-day Trial
+
+url: http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx
+file: 7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso
+md5sum: 1d0d239a252cb53e466d39e752b17c28
+
+'''
+PS C:\Users\Administrator> Dism /Get-WIMInfo /WimFile:d:\sources\install.wim
+
+Deployment Image Servicing and Management tool
+Version: 6.1.7600.16385
+
+Details for image : d:\sources\install.wim
+
+Index : 1
+Name : Windows 7 ENTERPRISE
+Description : Windows 7 ENTERPRISE
+Size : 11,913,037,777 bytes
+
+The operation completed successfully.
+'''
+
+- place it in a directory called iso
+
+The installation uses the Standard way for Windows Unattended installation.
+The XML file was created using the Windows AIK kit, but the file can also be edited by hand.
+
+To edit the Autounattend.xml and validate it:
+
+You can download The Windows® Automated Installation Kit (AIK) for Windows® 7:
+url: http://www.microsoft.com/download/en/details.aspx?id=5753
+file: KB3AIK_EN.iso
+md5sum: 1e73b24a89eceab9d50585b92db5482f
+
+- Building the machine creates a floppy that contains:
+ - AutoUnattend.xml (that will configure the windows)
+ - winrm-install.bat (activates the http and https listener + punches the firewall hole)
+
+AIK also includes dism, which will allow you to choose a specific version:
+
+If you want to install a different version, edit Autoattended.xml and replace the /IMAGE/NAME value with
+one of the names listed in the sources/install.wim on the install DVD .iso
+
+
+
+# Use the Name : from 'Dism.exe /Get-WIMInfo /WimFile:d:\sources\install.wim'
+# <InstallFrom>
+# <MetaData wcm:action="add">
+# <Key>/IMAGE/NAME</Key>
+# <Value>Windows 7 ENTERPRISE</Value>
+# </MetaData>
+# </InstallFrom>
View
45 templates/windows-7-enterprise-amd64-winrm/definition.rb
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+#video memory size should be at least 32meg for windows 7 to do full screen on my desktop
+# I'm not sure how to set that with veewee::session yet
+Veewee::Session.declare({
+ :os_type_id => 'Windows7_64',
+ # http://technet.microsoft.com/en-us/evalcenter/cc442495.aspx
+ # The 90-day Trial is offered for a limited time and in limited quantity.
+ # The download will be available through June 30th, 2012, while supplies last.
+ :iso_file => "7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso",
+ :iso_src => "http://wb.dlservice.microsoft.com/dl/download/release/Win7/3/b/a/3bac7d87-8ad2-4b7a-87b3-def36aee35fa/7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso",
+ :iso_md5 => "1d0d239a252cb53e466d39e752b17c28",
+ :iso_download_timeout => "100000",
+
+ :cpu_count => '1',
+ :memory_size=> '512',
+ :disk_size => '20280', :disk_format => 'VDI', :hostiocache => 'off',
+
+ :floppy_files => [
+ "Autounattend.xml",
+ "install-vbox-guest.bat",
+ "install-winrm.bat",
+ "install-cygwin-sshd.bat",
+ "oracle-cert.cer"
+ ],
+
+ #:boot_wait => "1", #12 minutes
+ #:boot_cmd_sequence => [''],
+
+ # :ssh_login_timeout => "10000",
+ # Actively attempt to winrm (no ssh on base windows) in for 10000 seconds
+ # :ssh_user => "vagrant", :ssh_password => "vagrant", :ssh_key => "",
+ # :ssh_host_port => "59857", :ssh_guest_port => "22",
+
+ #:winrm_login_timeout => "10005",
+ :winrm_user => "vagrant", :winrm_password => "vagrant",
+ # :winrm_host_port => "6001", :winrm_guest_port => "5985",
+
+ # And run postinstall.sh for up to 10000 seconds
+ :postinstall_timeout => "10000",
+ :postinstall_files => ["postinstall.sh"],
+ # No sudo on windows
+ :sudo_cmd => "%f",
+ # Shutdown is different as well
+ :shutdown_cmd => "shutdown /s /t 60 /c \"Vagrant Shutdown\" /f /d p:4:1",
+ })
View
40 templates/windows-7-enterprise-amd64-winrm/install-cygwin-sshd.bat
@@ -0,0 +1,40 @@
+REM http://webcache.googleusercontent.com/search?q=cache:SjoPPpuQxuoJ:www.tcm.phy.cam.ac.uk/~mr349/cygwin_install.html+install+cygwin+ssh+commandline&cd=2&hl=nl&ct=clnk&gl=be&source=www.google.be
+
+REM create the cygwin directory
+cmd /c mkdir %SystemDrive%\cygwin
+
+cmd /c bitsadmin /transfer CygwinSetupExe /download /priority normal http://www.cygwin.com/setup.exe %SystemDrive%\cygwin\cygwin-setup.exe
+
+REM goto a temp directory
+cd %SystemDrive%\windows\temp
+
+REM run the installation
+cmd /c %SystemDrive%\cygwin\cygwin-setup.exe -q -R %SystemDrive%\cygwin -P openssh,openssl,curl,cygrunsrv,wget,rebase,vim -s http://cygwin.mirrors.pair.com
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin cygrunsrv -R sshd'
+
+REM /bin/ash is the right shell for this command
+cmd /c %SystemDrive%\cygwin\bin\ash -c /bin/rebaseall
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkgroup -l'>%SystemDrive%\cygwin\etc\group
+
+cmd /c %SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin mkpasswd -l'>%SystemDrive%\cygwin\etc\passwd
+
+%SystemDrive%\cygwin\usr\bin\sleep 1
+
+%SystemDrive%\cygwin\bin\bash -c 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin /usr/bin/ssh-host-config -y -c "ntsecbinmode tty" -w "abc&&123!!" '
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="c:\cygwin\usr\sbin\sshd.exe" SSHD enable=yes
+
+cmd /c if exist %Systemroot%\system32\netsh.exe netsh advfirewall firewall add rule name="ssh" dir=in action=allow protocol=TCP localport=22
+
+%SystemDrive%\cygwin\usr\bin\sleep 2
+
+net start sshd
+
+# Fix corrupt recycle bin
+# http://www.winhelponline.com/blog/fix-corrupted-recycle-bin-windows-7-vista/
+cmd /c rd /s /q c:\$Recycle.bin
+
View
2  templates/windows-7-enterprise-amd64-winrm/install-vbox-guest.bat
@@ -0,0 +1,2 @@
+cmd /c certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
+e:\VBoxWindowsAdditions-amd64.exe /S
View
14 templates/windows-7-enterprise-amd64-winrm/install-winrm.bat
@@ -0,0 +1,14 @@
+cmd /c winrm quickconfig -q
+cmd /c winrm quickconfig -transport:http # needs to be auto no questions asked
+cmd /c winrm set winrm/config @{MaxTimeoutms="1800000"}
+cmd /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="300"}
+cmd /c winrm set winrm/config/service @{AllowUnencrypted="true"}
+cmd /c winrm set winrm/config/service/auth @{Basic="true"}
+cmd /c winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}
+cmd /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
+cmd /c netsh firewall add portopening TCP 5985 "Port 5985"
+cmd /c net stop winrm
+cmd /c net start winrm
+
+cmd /c reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveActive /t REG_SZ /d 0 /f
+cmd /c reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveIsSecure /t REG_SZ /d 0 /f
View
BIN  templates/windows-7-enterprise-amd64-winrm/oracle-cert.cer
Binary file not shown
View
74 templates/windows-7-enterprise-amd64-winrm/postinstall.sh
@@ -0,0 +1,74 @@
+set -x
+
+# Create the home directory
+mkdir -p /home/vagrant
+chown vagrant /home/vagrant
+cd /home/vagrant
+
+# Install ssh certificates
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+cd /home/vagrant/.ssh
+wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+cd ..
+
+# Install rpm,apt-get like code for cygwin
+# http://superuser.com/questions/40545/upgrading-and-installing-packages-through-the-cygwin-command-line
+wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
+chmod +x apt-cyg
+mv apt-cyg /usr/local/bin/
+
+# 7zip will allow us to extract a file from an ISO
+wget http://downloads.sourceforge.net/sevenzip/7z922-x64.msi
+msiexec /qb /i 7z922-x64.msi
+
+# Download Virtualbox Additions
+VBOX_VERSION="4.1.8" #"4.0.8"
+wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+
+# Extract the installer from the ISO (WHY WHY WHY isn't this available not bundled within an ISO)
+/cygdrive/c/Program\ Files/7-Zip/7z.exe x VBoxGuestAdditions_$VBOX_VERSION.iso VBoxWindowsAdditions-amd64.exe
+
+# Mark Oracle as a trusted installer
+#http://blogs.msdn.com/b/steverac/archive/2009/07/09/adding-certificates-to-the-local-certificates-store-and-setting-local-policy-using-a-command-line-system-center-updates-publisher-example.aspx
+
+certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer
+
+# Install the Virtualbox Additions
+./VBoxWindowsAdditions-amd64.exe /S
+
+
+#Rather than do the manual install of ruby and chef, just use the opscode msi
+curl -L http://www.opscode.com/chef/install.msi -o chef-client-latest.msi
+msiexec /qb /i chef-client-latest.msi
+
+
+#http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/
+
+#Making aliases
+cat <<EOF > /home/vagrant/.bash_profile
+alias chef-client="chef-client.bat"
+alias gem="gem.bat"
+alias ruby="ruby.exe"
+alias puppet="puppet.bat"
+alias ohai="ohai.bat"
+alias irb="irb.bat"
+alias facter="facter.bat"
+EOF
+
+
+cat <<'EOF' > /bin/sudo
+#!/usr/bin/bash
+exec "$@"
+EOF
+chmod 755 /bin/sudo
+
+# Mounting a directory
+net.exe use '\\vboxsvr\veewee-validation'
+
+
+# Reboot
+# http://www.techrepublic.com/blog/datacenter/restart-windows-server-2003-from-the-command-line/245
+shutdown.exe /s /t 0 /d p:2:4 /c "Vagrant initial reboot"
+

No commit comments for this range

Something went wrong with that request. Please try again.