methods/vb_common.rb
# Add non-bridged network to VirtualBox VM
Add non-bridged network to VirtualBox VM
Add non - bridged network to VirtualBox VM
def add_nonbridged_network_to_vbox_vm(options,nic_name)
  message = "Information:\tAdding network "+nic_name+" to "+options['name']
  if nic_name.match(/vboxnet/)
    command = "#{options['vboxmanage']} modifyvm #{options['name']} --hostonlyadapter1 #{nic_name} ; #{options['vboxmanage']} modifyvm #{options['name']} --nic1 hostonly"
  else
    command = "#{options['vboxmanage']} modifyvm #{options['name']} --nic1 #{nic_name}"
  end
  execute_command(options,message,command)
  return
end
def add_nonbridged_network_to_vbox_vm ( options , nic_name ) message = "Information:\tAdding network " + nic_name + " to " + options [ 'name' ] if nic_name . match ( / vboxnet / ) command = "#{options['vboxmanage']} modifyvm #{options['name']} --hostonlyadapter1 #{nic_name} ; #{options['vboxmanage']} modifyvm #{options['name']} --nic1 hostonly" else command = "#{options['vboxmanage']} modifyvm #{options['name']} --nic1 #{nic_name}" end execute_command ( options , message , command ) return end
Add non-bridged network to VirtualBox VM
Add non - bridged network to VirtualBox VM
options
<not_specific>
nic_name
<not_specific>