methods/vb_common.rb
# Add hard disk to VirtualBox VM
Add hard disk to VirtualBox VM
Add hard disk to VirtualBox VM
def add_cdrom_to_vbox_vm(options)
  message = "Information:\tAttaching CDROM \""+options['file']+"\" to VM "+options['name']
  command = "#{options['vboxmanage']} storagectl \"#{options['name']}\" --name \"cdrom\" --add \"sata\" --controller \"IntelAHCI\""
  execute_command(options,message,command)
  if File.exist?(options['vboxadditions'])
    message = "Information:\tAttaching ISO "+options['vboxadditions']+" to VM "+options['name']
    command = "#{options['vboxmanage']} storageattach \"#{options['name']}\" --storagectl \"cdrom\" --port 0 --device 0 --type dvddrive --medium \"#{options['file']}\""
    execute_command(options,message,command)
  end
  return
end
def add_cdrom_to_vbox_vm ( options ) message = "Information:\tAttaching CDROM \"" + options [ 'file' ] + "\" to VM " + options [ 'name' ] command = "#{options['vboxmanage']} storagectl \"#{options['name']}\" --name \"cdrom\" --add \"sata\" --controller \"IntelAHCI\"" execute_command ( options , message , command ) if File . exist? ( options [ 'vboxadditions' ] ) message = "Information:\tAttaching ISO " + options [ 'vboxadditions' ] + " to VM " + options [ 'name' ] command = "#{options['vboxmanage']} storageattach \"#{options['name']}\" --storagectl \"cdrom\" --port 0 --device 0 --type dvddrive --medium \"#{options['file']}\"" execute_command ( options , message , command ) end return end
Add hard disk to VirtualBox VM
Add hard disk to VirtualBox VM
options
<not_specific>