Rex::Box::Base(3pm)

πŸ’– Rex::Box::Base β€” the manual, but make it cute

okay so this is the Rex::Box::Base(3pm) page, from the User Contributed Perl Documentation section, and bestie it is exactly what it sounds like: the base module that every other Rex::Box module is built on. sit down, grab a strawberry lemonade πŸ“, we're learning this together.


🌸 NAME 🌸

Rex::Box::Base β€” the Rex/Boxes Base Module. she's the blueprint, the template, the mother of all boxes. periodt. πŸ‘‘


✨ DESCRIPTION ✨

This is a Rex/Boxes base module. that's it, that's the whole vibe β€” she's the foundation, the base class, the one everyone else inherits from. iykyk πŸ’…


πŸ¦‹ METHODS πŸ¦‹

These methods are shared across all other Rex::Box modules. so like, whichever box provider you're using, these are the ones you already know. no cap. πŸ”₯


πŸŽ€ info

Returns a hashRef of vm information. all the deets, in one handy reference. πŸ’–


πŸŽ€ name($vmname)

Sets the name of the virtual machine. give your VM a cute lil identity, bestie. 🫢


πŸŽ€ setup(@tasks)

Sets the tasks that should be executed as soon as the VM is available through SSH. like, the moment she wakes up and answers the door, these tasks run. instant main character energy. ✨


πŸŽ€ storage('path/to/vm/disk')

Sets the disk path of the virtual machine. πŸ—‚οΈ

heads up bestie: this one works only on KVM. don't try it elsewhere, she will not show up to the party. πŸ’€

πŸŽ€ import_vm()

This method must be overwritten by the implementing class. you literally have to do it yourself β€” she's handing you the pencil πŸ–ŠοΈ, no take-backs.


πŸŽ€ stop()

Stops the VM. nap time. 😴


πŸŽ€ destroy()

Destroy the VM. absolutely obliterated. no survivors πŸ’€πŸ”₯


πŸŽ€ start()

Starts the VM. wake up queen, you have rex tasks to run 🌈


πŸŽ€ ip()

Return the ip:port to which rex will connect to. the address where all the magic happens πŸͺ„


πŸŽ€ status()

Returns the status of a VM. a lil vibe check, honestly.

Valid return values are "running" and "stopped".


πŸŽ€ provision_vm([@tasks])

Executes the given tasks on the VM. you bring the to-do list, she brings the SSH 🫢


πŸŽ€ cpus($count)

Set the amount of CPUs for the VM. more cpus = more girlboss, mathematically πŸ’…


πŸŽ€ memory($memory_size)

Sets the memory of a VM in megabyte. (megabytes, bestie β€” keep the units straight πŸ’œ)


πŸŽ€ network(%option)

Configure the network for a VM. 🌐

Currently it supports 2 modes: nat and bridged. Currently it supports only one network card.

the nat one, looking like:

 $box->network(
   1 => {
     type => "nat",
   },
 );

and the bridged one, looking like:

 $box->network(
   1 => {
     type => "bridged",
     bridge => "eth0",
   },
 );

see? she ate. πŸ‘‘


πŸŽ€ forward_port(%option)

Set ports to be forwarded to the VM.

ngl bestie, this is not supported by all Box providers. check before you commit, fr fr.

and here's the shape of it:

 $box->forward_port(
   name => [$from_host_port, $to_vm_port],
   name2 => [$from_host_port_2, $to_vm_port_2],
   ...
 );

name it, map it, forward it. so satisfying. πŸŽ€


πŸŽ€ list_boxes

List all available boxes. window shopping but for VMs πŸ›οΈ


πŸŽ€ url($url)

The URL where to download the Base VM Image. πŸ“₯

You can use self-made images or prebuild images from <http://box.rexify.org/>. do it yourself, or let the internet do it for you β€” both iconic.


πŸŽ€ auth(%option)

Configure the authentication to the VM. πŸ”

 $box->auth(
   user => $user,
   password => $password,
   private_key => $private_key,
   public_key => $public_key,
 );

keys and passwords, pick your fighter πŸ’œ


πŸŽ€ options(%option)

Addition options for boxes. the lil extras, the finishing touch ✨

 $box->options(
   opt1 => $val1,
   opt2 => $val2,
 );

that's the whole page bestie, we did it, we read the entire thing, and honestly? obsessed. πŸ’–πŸ¦‹πŸ’…

okay love you byeee β€” this was Rex::Box::Base from perl v5.40.1, dated 2025-10-03. written down, remembered forever, periodt. πŸŒΈπŸŽ€βœ¨

πŸ“¦ where this page comes from