Giter Site home page Giter Site logo

node-virtualbox's Introduction

node-virtualbox

NPM version Build Status DepShield Badge

A JavaScript library to interact with VirtualBox virtual machines.

Table of Contents

Installation

Obtain the package

$ npm install virtualbox [--save] [-g]

and then use it

var virtualbox = require('virtualbox');

The general formula for commands is:

virtualbox. API command ( "registered vm name", [parameters], callback );

Available API commands are listed at the end of this document.

Controlling Power and State

node-virtualbox provides convenience methods to command the guest machine's power state in the customary ways.

Starting a cold machine: Two ways

Virtual machines will start headless by default, but you can pass a boolean parameter to start them with a GUI:

virtualbox.start('machine_name', true, function start_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine has started WITH A GUI!');
});

So as not to break pre-0.1.0 implementations, the old method still works (which also defaults to headless):

virtualbox.start('machine_name', function start_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine has started HEADLESS!');
});

Stopping a machine

Note: For historical reasons, .stop is an alias to .savestate.

virtualbox.stop('machine_name', function stop_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine has been saved');
});

To halt a machine completely, you can use poweroff or acpipowerbutton:

virtualbox.poweroff('machine_name', function poweroff_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine has been powered off!');
});
virtualbox.acpipowerbutton('machine_name', function acpipower_callback(error) {
  if (error) throw error;
  console.log("Virtual Machine's ACPI power button was pressed.");
});

Pausing, Saving and Resuming a machine

Noting the caveat above that .stop is actually an alias to .savestate...

virtualbox.pause('machine_name', function pause_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine is now paused!');
});
virtualbox.savestate('machine_name', function save_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine is now paused!');
});

And, in the same family, acpisleepbutton:

virtualbox.acpisleepbutton('machine_name', function acpisleep_callback(error) {
  if (error) throw error;
  console.log("Virtual Machine's ACPI sleep button signal was sent.");
});

Note that you should probably resume a machine which is in one of the above three states.

virtualbox.resume('machine_name', function resume_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine is now paused!');
});

And, of course, a reset button method:

virtualbox.reset('machine_name', function reset_callback(error) {
  if (error) throw error;
  console.log("Virtual Machine's reset button was pressed!");
});

Import a machine

You can import an OVA or OVF file with the vmImport method:

virtualbox.vmImport('ova_file_path', options, function import_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine was imported!');
});

The options object may contain optional parameters:

  • vmname: the name of the new VM.
  • cpus: the number of CPUs.
  • memory: the amount of memory in megabytes.

Export a machine

You can export with vmExport method:

virtualbox.vmExport('machine_name', 'output', function export_callback(error) {
  if (error) throw error;
  console.log('Virtual Machine was exported!');
});

Snapshot Manage

You can show snapshot list with snapshotList method:

virtualbox.snapshotList('machine_name', function (
  error,
  snapshotList,
  currentSnapshotUUID
) {
  if (error) throw error;
  if (snapshotList) {
    console.log(
      JSON.stringify(snapshotList),
      JSON.stringify(currentSnapshotUUID)
    );
  }
});

And, you can take a snapshot:

virtualbox.snapshotTake('machine_name', 'snapshot_name', function (
  error,
  uuid
) {
  if (error) throw error;
  console.log('Snapshot has been taken!');
  console.log('UUID: ', uuid);
});

Or, delete a snapshot:

virtualbox.snapshotDelete('machine_name', 'snapshot_name', function (error) {
  if (error) throw error;
  console.log('Snapshot has been deleted!');
});

Or, restore a snapshot:

virtualbox.snapshotRestore('machine_name', 'snapshot_name', function (error) {
  if (error) throw error;
  console.log('Snapshot has been restored!');
});

Cloning VMs

Make a full clone (duplicate virtual hard drive) of a machine:

virtualbox.clone('source_machine_name', 'new_machine_name', function (error) {
  if (error) throw error;
  console.log('Done fully cloning the virtual machine!');
});

Make a linked clone (interdependent-differentially stored virtual hard drive) of a machine:

virtualbox.snapshotTake('machine_name', 'snapshot_name', function (
  error,
  uuid
) {
  if (error) throw error;
  console.log('Snapshot has been taken!');
  console.log('UUID: ', uuid);
  virtualbox.clone(
    'machine_name',
    'new_machine_name',
    'snapshot_name',
    function (error) {
      if (error) throw error;
      console.log('Done making a linked clone of the virtual machine!');
    }
  );
});

Storage

Manage the IDE controller

In case the VM doesn't have an IDE controller you can use the storagectl command to add one:

virtualbox.storage.addCtl(
  {
    vm: 'machine_name',
    perhiperal_name: 'IDE', //optional
    type: 'ide', //optional
  },
  function () {
    console.log('Controller has been added!');
  }
);

Attach a disk image file

Mount an ISO file to the added controller:

virtualbox.storage.attach(
  {
    vm: 'machine_name',
    perhiperal_name: 'IDE', //optional
    port: '0', //optional
    device: '0', //optional
    type: 'dvddrive', //optional
    medium: 'X:Foldercontaining\the.iso',
  },
  function () {
    console.log('Image has been mounted!');
  }
);

The medium parameter of the options object can be set to the none value to unmount.

Controlling the guest OS

A note about security ⚠️

node-virtualbox is not opinionated: we believe that you know best what you need to do with your virtual machine. Maybe that includes issuing sudo rm -rf / for some reason.

To that end, the virtualbox APIs provided by this module take absolutely no steps to prevent you shooting yourself in the foot.

⚠️ Therefore, if you accept user input and pass it to the virtual machine, you should take your own steps to filter input before it gets passed to virtualbox.

For more details and discussion, see issue #29.

Running programs in the guest

This method takes an options object with the name of the virtual machine, the path to the binary to be executed and any parameters to pass:

var options = {
  vm: 'machine_name',
  cmd: 'C:\\Program Files\\Internet Explorer\\iexplore.exe',
  params: 'https://google.com',
};

virtualbox.exec(options, function exec_callback(error, stdout) {
  if (error) throw error;
  console.log('Started Internet Explorer...');
});

Executing commands as Administrators on Windows guests

Pass username and password information in an options object:

var options = {
  vm: 'machine_name',
  user: 'Administrator',
  password: '123456',
  cmd: 'C:\\Program Files\\Internet Explorer\\iexplore.exe',
  params: 'https://google.com',
};

Killing programs in the guest

Tasks can be killed in the guest as well. In Windows guests this calls taskkill.exe /im and on Linux, BSD and OS X (Darwin) guests, it calls sudo killall:

virtualbox.kill(
  {
    vm: 'machine_name',
    cmd: 'iexplore.exe',
  },
  function kill_callback(error) {
    if (error) throw error;
    console.log('Terminated Internet Explorer.');
  }
);

Sending keystrokes to a virtual machine

Keyboard scan code sequences can be piped directly to a virtual machine's console:

var SCAN_CODES = virtualbox.SCAN_CODES;
var sequence = [
  { key: 'SHIFT', type: 'make', code: SCAN_CODES['SHIFT'] },
  { key: 'A', type: 'make', code: SCAN_CODES['A'] },
  { key: 'SHIFT', type: 'break', code: SCAN_CODES.getBreakCode('SHIFT') },
  { key: 'A', type: 'break', code: SCAN_CODES.getBreakCode('A') },
];

virtualbox.keyboardputscancode(
  'machine_name',
  sequence,
  function keyscan_callback(err) {
    if (error) throw error;
    console.log('Sent SHIFT A');
  }
);

Meta information about machine

List all registered machines, returns an array:

virtualbox.list(function list_callback(machines, error) {
  if (error) throw error;
  // Act on machines
});

Obtaining a guest property by key name:

var options = {
  vm: 'machine_name',
  key: '/VirtualBox/GuestInfo/Net/0/V4/IP',
};

virtualbox.guestproperty.get(options, function guestproperty_callback(machines, error) {
  if (error) throw error;
  // Act on machines
});

Obtaining an extra property by key name:

var options = {
  vm: 'machine_name',
  key: 'GUI/Fullscreen',
};

virtualbox.extradata.get(options, function extradataget_callback(error, value) {
  if (error) throw error;
  console.log(
    'Virtual Machine "%s" extra "%s" value is "%s"',
    options.vm,
    options.key,
    value
  );
});

Writing an extra property by key name:

var options = {
  vm: 'machine_name',
  key: 'GUI/Fullscreen',
  value: 'true',
};

virtualbox.extradata.set(options, function extradataset_callback(error) {
  if (error) throw error;
  console.log(
    'Set Virtual Machine "%s" extra "%s" value to "%s"',
    options.vm,
    options.key,
    options.value
  );
});

Note: some properties are only available/effective if the Guest OS has the (https://www.virtualbox.org/manual/ch04.html)[Guest Additions] installed and running.

Putting it all together

var virtualbox = require('virtualbox');

virtualbox.start('machine_name', function start_callback(error) {
  if (error) throw error;

  console.log('VM "w7" has been successfully started');

  virtualbox.exec(
    {
      vm: 'machine_name',
      cmd: 'C:\\Program Files\\Internet Explorer\\iexplore.exe',
      params: 'http://google.com',
    },
    function (error) {
      if (error) throw error;
      console.log('Running Internet Explorer...');
    }
  );
});

Available Methods

virtualbox

  • .pause({vm:"machine_name"}, callback)
  • .reset({vm:"machine_name"}, callback)
  • .resume({vm:"machine_name"}, callback)
  • .start({vm:"machine_name"}, callback) and .start({vm:"machine_name"}, true, callback)
  • .stop({vm:"machine_name"}, callback)
  • .savestate({vm:"machine_name"}, callback)
  • .vmImport({input: "input"}, {options: "options"}, callback)
  • .vmExport({vm:"machine_name"}, {output: "output"}, callback)
  • .poweroff({vm:"machine_name"}, callback)
  • .acpisleepbutton({vm:"machine_name"}, callback)
  • .acpipowerbutton({vm:"machine_name"}, callback)
  • .guestproperty.get({vm:"machine_name", property: "propname"}, callback)
  • .exec(){vm: "machine_name", cmd: "C:\\Program Files\\Internet Explorer\\iexplore.exe", params: "http://google.com"}, callback)
  • .exec(){vm: "machine_name", user:"Administrator", password: "123456", cmd: "C:\\Program Files\\Internet Explorer\\iexplore.exe", params: "http://google.com"}, callback)
  • .keyboardputscancode("machine_name", [scan_codes], callback)
  • .kill({vm:"machine_name"}, callback)
  • .list(callback)
  • .isRunning({vm:"machine_name"}, callback)
  • .snapshotList({vm:"machine_name"}, callback)
  • .snapshotTake({vm:"machine_name"}, {vm:"snapshot_name"}, callback)
  • .snapshotDelete({vm:"machine_name"}, {vm:"snapshot_UUID"}, callback)
  • .snapshotRestore({vm:"machine_name"}, {vm:"snapshot_UUID"}, callback)
  • .clone({vm:"machine_name"}, {vm:"new_machine_name"}, callback)
  • .storage.addCtl({vm: "machine_name", perhiperal_name: "IDE", type: "ide"}, callback)
  • .storage.attach({vm: "machine_name", perhiperal_name: "IDE", port: "0", device: "0", type: "dvddrive", medium: "X:\Folder\containing\the.iso"}, callback)
  • .extradata.get({vm:"machine_name", key:"keyname"}, callback)
  • .extradata.set({vm:"machine_name", key:"keyname", value:"val"}, callback)

Troubleshooting

  • Make sure that Guest account is enabled on the VM.
  • Make sure your linux guest can sudo with NOPASSWD (at least for now).
  • VMs start headlessly by default: if you're having trouble with executing a command, start the VM with GUI and observe the screen after executing same command.
  • To avoid having "Concurrent guest process limit is reached" error message, execute your commands as an administrator.
  • Don't forget that this whole thing is asynchronous, and depends on the return of vboxmanage not the actual running state/runlevel of services within the guest. See #9

More Examples

License

MIT

Contributing

Please do!

Please abide by the Contributor Code of Conduct.

Testing

We currently do not have a complete unit testing suite. However, example scripts and a Vagrantfile are provided. Test your changes by writing a new script and/or running through all the test scripts to make sure they behave as expected. To do this install vagrant and run vagrant up in this repository's root directory. Then run the example scripts by using node: node test/integration/<script-name>.js. Please be ready to provide test output upon opening a pull request.

node-virtualbox's People

Contributors

2roy999 avatar 69 avatar bodominea avatar bschaepper avatar cedx avatar chiefy avatar colonelpopcorn avatar dependabot[bot] avatar derac avatar duglah avatar felipemdrs avatar gaborcsardi avatar huntr-helper avatar jamieslome avatar kuebk avatar michaelsanford avatar sroegner avatar vera-yang avatar verayangg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-virtualbox's Issues

Configuration-Option to suppress any Log-Output

This would be great, to have a configuration option to suppress any logger output. 🥰

[2020-05-16 01:47:10.448] [INFO] VirtualBox - Virtualbox version detected as 5

You're using an old log4js version, this makes it hard to set the logLvele() within peerDependencies.

I like this module!

Listing VMs not working on Windows 8.1 with VirtualBox 4.3.12

Using a basic script as this one:

var virtualbox=require('virtualbox');
virtualbox.list(function(machines, error) {
  if (error) throw error;
  console.dir(machines);
});

Should output something like:

[2014-06-09 22:33:37.822] [INFO] VirtualBox - Listing VMs
{ 'ae5f532a-4de0-4ab7-a967-c42293447c14': { name: 'Ubuntu', running: false },
  '3451fae4-7e7c-4d75-ac4e-7af9c901cf1a': { name: 'Windows', running: false } }

Instead, I have the following error:

[2014-06-09 22:27:52.126] [INFO] VirtualBox - Listing VMs

C:\Users\C├®dric\Desktop\node_modules\virtualbox\lib\virtualbox.js:95
      if (arrMatches.length === 3) {
                    ^
TypeError: Cannot read property 'length' of null
    at parse_listdata (C:\Users\C├®dric\Desktop\node_modules\virtualbox\lib\virtualbox.js:95:21)
    at C:\Users\C├®dric\Desktop\node_modules\virtualbox\lib\virtualbox.js:67:18
    at C:\Users\C├®dric\Desktop\node_modules\virtualbox\lib\virtualbox.js:42:5
    at ChildProcess.exithandler (child_process.js:645:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:753:16)
    at Process.ChildProcess._handle.onexit (child_process.js:820:5)

It seems that there is a little problem with list data parsing.

[DepShield] (CVSS 7.5) Vulnerability due to usage of debug:2.6.9

Vulnerabilities

DepShield reports that this application's usage of debug:2.6.9 results in the following vulnerability(s):


Occurrences

debug:2.6.9 is a transitive dependency introduced by the following direct dependency(s):

jshint:2.9.6
        └─ phantomjs-prebuilt:2.1.16
              └─ extract-zip:1.6.7
                    └─ debug:2.6.9

nodeunit:0.11.3
        └─ tap:12.5.3
              └─ tap-mocha-reporter:3.0.7
                    └─ debug:2.6.9

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

huntr.dev - Command Injection

This issue has been generated on-behalf of Mik317 (https://huntr.dev/app/users/Mik317)

Vulnerability Description

The issue occurs because a user input is formatted inside a command that will be executed without any check. The issue arises here: https://github.com/Node-Virtualization/node-virtualbox/blob/master/lib/virtualbox.js#L58

Steps To Reproduce:

  1. Create the following PoC file:
// poc.js
var virtualbox = require('virtualbox');
virtualbox.start('machine_name"; touch HACKED; # ', true, function start_callback(error) {
  if (error) throw error;
  console.log("Virtual Machine has started WITH A GUI!");
});
  1. Check there aren't files called HACKED
  2. Execute the following commands in another terminal:
npm i virtualbox # Install affected module
node poc.js #  Run the PoC
  1. Recheck the files: now HACKED has been created

Bug Bounty

We have opened up a bounty for this issue on our bug bounty platform. Want to solve this vulnerability and get rewarded 💰? Go to https://huntr.dev/

jshint & strict mode

  • Validate against jshint and add a .jshintrc
  • And add global strict mode
  • Ask npm test (at least for the time being) to jshint /lib and /test

Multiple concurrent instances, stdin/out/err?

Hi,

Reading the source it seems, only one instance can be run simultaneously ?
Is it a limitation if vbox ?

Also, i was looking at exec, it won t give access to stdout / stderr / stdin.
Is it a limitation of vbox ?

I m especially looking for windows support.

I d like to spawn some process on the remote and get their standard input/output to process them.
I have poor knowledge of virtualbox, for the moment, i hope you can give me some input about what it can do or not.

Publish actual version

Hi! Thank you for this package.

In version 0.1.3.

TypeError: virtualbox.snapshotRestore is not a function

It is right.
But in master this function is existing.

How to handle VirtualBox 5 encrypted machine passwords?

Problem Context

VirtualBox 5.0 now supports encrypted virtual disk images, which non-trivially complicates launch of headless VMs (see #24).

There does not appear to be a method for bypassing our module and passing passwords as, say, environment variables directly to VirtualBox. This means that node-virtualbox will have to handle them in order to control an encrypted VM.

The problem of what to do about the virtual machine passwords is non-trivial. Ideally, I'd like not to handle them at all. I'm devoted to maintaining the trust of the community; being open source, we can demonstrate our eventual implementation.

Possible Solutions

  1. Read environment variable from process.env.VARNAME that the user has passed to their application and simply pass it along in memory to controlvm. It could follow some naming convention that allows us to determine which VM it belongs to without worrying about storing a mapping.

get value of certain property of showvminfo command

Guys, thank you for your work.
I'm working on VirtualBox extension for VSCode and I want to show OS name next to VM name like on SS below.

image

But instead of just "windows" I want to show "Windows 10 (64-bit)",
instead of "mac" - "Mac OS X (64-bit)"

For this purpose, I need method to perform this command and get all properties as object.

VBoxManage.exe showvminfo -machinereadable "Mac OS machine"

I mean next structure should be converted to next JS object

name="Mac OS machine"
groups="/"
ostype="Mac OS X (64-bit)"
...
{
    name: "Mac OS machine",
    groups: "/",
    ostype: "Mac OS X (64-bit)",
    ...
}

I would appreciate if somebody take care about it.

[DepShield] (CVSS 7.4) Vulnerability due to usage of lodash.flattendeep:4.4.0

Vulnerabilities

DepShield reports that this application's usage of lodash.flattendeep:4.4.0 results in the following vulnerability(s):


Occurrences

lodash.flattendeep:4.4.0 is a transitive dependency introduced by the following direct dependency(s):

nodeunit:0.11.3
        └─ tap:12.5.3
              └─ nyc:13.3.0
                    └─ caching-transform:3.0.1
                          └─ package-hash:3.0.0
                                └─ lodash.flattendeep:4.4.0

This is an automated GitHub Issue created by Sonatype DepShield. Details on managing GitHub Apps, including DepShield, are available for personal and organization accounts. Please submit questions or feedback about DepShield to the Sonatype DepShield Community.

Code tooling changes

I wanted to ask the folks here if they would be interested in moving the codebase to Typescript. This would buy us a pre-runtime type check in addition to the linting already available. I also wanted to ask if this is viable with the current Node version (0.12 and newer, from travis.yml file, not sure if accurate 🤷‍♂️) we are targeting.

I would also like to set up some unit and integration tests for the API before I start making many more changes. I'm going to install mocha, chai, and sinon as tools to help out. Is that cool with everyone here?

API Documentation

The README needs better API documentation with clear examples of each method, its parameters, limitations and caveats.

e.g., request

Update keyboardputscancode example in README

The documentation defines the usage of keyboardputscancode as such:

var sequence = [
  { key: 'SHIFT', type: 'make',  code: SCAN_CODES['SHIFT']},
  { key: 'A',     type: 'make',  code: SCAN_CODES['A']},
  { key: 'SHIFT', type: 'break', code: SCAN_CODES.getBreakCode('SHIFT')},
  { key: 'A',     type: 'break', code: SCAN_CODES.getBreakCode('A')}
];
virtualbox.keyboardputscancode("machine_name", sequence, function keyscan_callback(err) {
    if (error) throw error;
    console.log('Sent SHIFT A');
});

But it throws an error:

VBoxManage: error: Error '[object' is not a hex byte!

To reflect the way scan-codes.js works, I think the example should be instead:

var sequence = [
  SCAN_CODES['SHIFT'][0],
  SCAN_CODES['A'][0],
  SCAN_CODES.getBreakCode('SHIFT')[0],
  SCAN_CODES.getBreakCode('A')[0]
];

Update control APIs for VirtualBox 5.0 disk encryption

VirtualBox 5.0 now supports encrypted virtual disk images, which non-trivially complicates launch of headless VMs:

9.31.3. Starting a VM with encrypted images

When a VM is started using the GUI, a dialog will open where the user needs to enter all passwords for all encrypted images attached to the VM. If another frontend like VBoxHeadless is used, the VM will be paused as soon as the guest tries to access an encrypted disk. The user needs to provide the passwords through VBoxManage using the following command:

VBoxManage controlvm "uuid|vmname" addencpassword "id" "password" [--removeonsuspend "yes|no"]

To be implemented properly, this feature should be event-driven (or at least poll on a timer), waiting for the machine to pause and ask for a password and then providing one.

The matter of what to do about handling the machine's password is open, see #25.

Fix Travis CI build issues

Investigate and fix any relevant Travis CI build configuration issues to ensure the results from Travis are reliable.

Blocks #37 🚫 ☹️

Potential for Arbitrary Command Injection

the functions below in virtualbox.js, could allow for a user to inject additional commands with the cmd variable (ex: "; pwd") resulting in remote command execution assuming this was public facing.

function vboxcontrol(cmd, callback) {
  command('VBoxControl ' + cmd, callback);
}

function vboxmanage(cmd, callback) {
  command(vBoxManageBinary + cmd, callback);
}

Add more control on VM power states

The user should be allowed more control over power states. I propose exporting these as well, for flexibility:

  • poweroff
  • acpipowerbutton
  • acpisleepbutton

(Notably, it is not currently possible to power off a virtual machine.)

In addition to the currently-supported:

  • savestate (currently == "stop")
  • resume
  • pause
  • reset

Running exec in start callback always fails as VM isn't ready

I am having an issue, and I know the reason why it's happening, but I am unsure if there is a way to solve it.

When I issue a virtualbox.start(vm_name, cb) the callback is getting executed before the VM has fully booted. When I try to execute a command in said VM, it fails as it is not ready for commands. I've "solved" this issue by adding a setTimeout but it feels very hacky. Is there any way to long-poll the VM and query if it's actually ready to accept commands?

Thanks!

Move from callbacks to promises

Since we've removed explicit support for versions of node <10, we can tap into the native Promise API to handle our system calls.

Require 2FA for npm publication

Hi @colonelpopcorn !

Pursuant to you assembling and hopefully publishing release/1.0.1 and to the access granted from #69, could you please enable 2FA on your npmjs.com account?

Thank you for carrying the torch. 👍

moving to an organization ?

heyy @michaelsanford

would you like to move this repo to an organization, since you've been contributing it a lot more than me ?

my github account can be gone or something in the future, so, we better keep it under your hands!

github has good support for renaming, all links will keep working!

VBoxManage.exe not found on Windows 8.1 with VirtualBox 4.3.12

I'm using your "virtualbox" package (v0.1.0) on Windows 8.1 with Node.js 0.10.28 and VirtualBox 4.3.12r93733.
A simple script as this one always fails:

var virtualbox=require('virtualbox');
virtualbox.list(function(machines, error) {
  if (error) throw error;
  console.dir(machines);
});

With this error message:

Error: Command failed: 'vboxmanage' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

    at ChildProcess.exithandler (child_process.js:647:15)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:753:16)
    at Process.ChildProcess._handle.onexit (child_process.js:820:5)

The message is in French, but the issue is clear: "VBoxManage.exe" was not found.

Update dependencies

Update the following two dependencies:

log4js  0.x  →  1.x 
async  ^2.1.2  →  ^2.1.4

Incorrect MacOs recognition

How you can see on SS, I have created MacOs virtual machine. But code on line 432 doesn't work correctly because there is a space in the name.

image

Release 1.0.1

We need to publish the new version of virtualbox lib. I don't have permission on the publish so @michaelsanford should publish.

Remote management over SSH

Would anyone be interested in having functionality for remote SSH management added? A project I am working on involves doing this with multiple VirtualBox hosts, so this would require a way to to call a different exec function. To avoid having to specify this for each function call, I would probably make a class whose methods delegate execution to a particular function. This can be done without adding SSH-specific dependencies to the package by letting the class just accept an alternate execution function as an optional argument.

Detachable start

I wonder if i'ts possible to add support for detachable start of VMs. That would help very much in automated testing environments that need a clean machine for each test. I don't see any way to do it now with node-virtualbox.

Customize how virtualbox is executed

Some improperly configured systems may not allow for execFile to work flawlessly every time. It would be nice to allow users to customize the behavior/underlying mechanism to execute VBoxManage. A constructor argument should suffice.

[Feature] List, create, and delete snapshots

It would be great to have snapshot support in the module, so that it could be used for backup tasks, too.
Any chance to get snapshotList, snapshotCreate, and snapshotDelete methods?

Empty snapshot list

I'm using version 5.1.22r115126 of VBoxManage on Windows 10.

When I try to run snapshotList for my VMs, I get an error object if there are no snapshot for a VM, but if there are snapshots, the returned array is empty, and the UUID is undefined.

If I try to get the snapshots from the CLI (using "C:\Program Files\Oracle\VirtualBox\\VBoxManage.exe" snapshot "2e996f4f-ca83-4e0f-bf7d-fd8d3d8c93e3" list --machinereadable) I get the following output:

SnapshotName="Istantanea 1"
SnapshotUUID="c3dee892-28f7-475a-ba8a-bac2b98cfac8"
CurrentSnapshotName="Istantanea 1"
CurrentSnapshotUUID="c3dee892-28f7-475a-ba8a-bac2b98cfac8"
CurrentSnapshotNode="SnapshotName"

Specify open source license

Need a license

Organizations often have legal requirements mandating license compliance for open-source software usage.

We should agree on a license, and:

  • attach it to the package.json; and
  • include the complete license in a LICENSE or LICENSE.md file

License Proposal

I propose the MIT or the BSD ISC license (comparison).

My personal take is that this npm should be:

  • as widely- and freely-usable as possible,
  • including closed-source commercial products (without forcing them to become open-source),
  • with as little restriction as possible, and
  • not hold the developers and contributors liable in case anything goes wrong.

The MIT license is used in virtually all node modules I have come across, with very few exceptions.

Discuss? @azer It's your baby, so ultimately your decision, I think.

If you choose one, I can implement it. (I've done about 40 pull requests for that for other projects in the last month…)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.