VirtualBox

Ticket #11998: clone.pl

File clone.pl, 445 bytes (added by CyberChris, 11 years ago)

Script to quickly clone N machines for a given machine name

Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6my $clone_limit = $ARGV[0];
7my $ref_name = $ARGV[1];
8
9if (!$clone_limit)
10{
11 print STDERR "Please provide the number of desired machines to clone\n";
12 exit(0);
13}
14
15if (!$ref_name)
16{
17 print STDERR "Please provide the name of the machine to be cloned\n";
18 exit(0);
19}
20
21foreach (my $i = 0; $i < $clone_limit; $i++)
22{
23 `vboxmanage clonevm malanize-windows-xp --name sample_clone_$i --mode all --register`;
24}

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy