How to use the virtualbox.exec function in virtualbox

To help you get started, we’ve selected a few virtualbox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github azer / lowkick / lib / drivers / virtualbox.js View on Github external
virtualbox.start(vm, function(error){
    
    if(error){
      logging.error('Failed to start VM "%s"', vm);
      callback && callback(error);
      return;
    }

    logging.debug('Executing VirtualBox command on VM "%s". Username: %s Password: %s', vm, username, passwd);

    virtualbox.exec({ 'vm': vm, 'username': username, 'passwd': passwd, 'cmd': path, 'params': params }, function(error, stdout){

      if(error){
        logging.error(error);
      }

      callback && callback(error, stdout);
      
    });

  });
}