1Rex::Virtualization::VBUosxe(r3)Contributed Perl DocumenRteaxt:i:oVnirtualization::VBox(3)
2
3
4
6 Rex::Virtualization::VBox - VirtualBox Virtualization Module
7
9 With this module you can manage VirtualBox.
10
12 use Rex::Commands::Virtualization;
13
14 set virtualization => "VBox";
15
16 use Data::Dumper;
17
18 print Dumper vm list => "all";
19 print Dumper vm list => "running";
20
21 vm destroy => "vm01";
22
23 vm delete => "vm01";
24
25 vm start => "vm01";
26
27 vm shutdown => "vm01";
28
29 vm reboot => "vm01";
30
31 vm option => "vm01",
32 memory => 512;
33
34 print Dumper vm info => "vm01";
35
36 # creating a vm
37 vm create => "vm01",
38 storage => [
39 {
40 file => "/mnt/data/vbox/vm01.img",
41 size => "10G",
42 },
43 {
44 file => "/mnt/iso/debian6.iso",
45 }
46 ],
47 memory => 512,
48 type => "Linux26",
49 cpus => 1,
50 boot => "dvd";
51
52 vm forward_port => "vm01", add => { http => [8080, 80] };
53
54 vm forward_port => "vm01", remove => "http";
55
56 print Dumper vm guestinfo => "vm01";
57
58 vm share_folder => "vm01", add => { sharename => "/path/to/share" };
59
60 vm share_folder => "vm01", remove => "sharename";
61
62 For VirtualBox memory declaration is always in megabyte.
63
64
65
66perl v5.32.1 2021-03-06 Rex::Virtualization::VBox(3)