Rex::Box::KVM(3pm)

✨ Rex::Box::KVM ✨

okay bestie, so this page is Rex::Box::KVM, which lives in the User Contributed Perl Documentation corner of your man pages, and it's literally the KVM module for Rex/Boxes πŸ’–


πŸŽ€ NAME πŸŽ€

Rex::Box::KVM β€” the Rex/Boxes KVM Module. that's it, that's the name, short n sweet, she's giving minimalism πŸ’…


🌸 DESCRIPTION 🌸

so this is a Rex/Boxes module that lets you use KVM VMs πŸ–₯️✨ and here's the important part, no cap: you need to have libvirt installed. like, you can't skip that step, it's the whole vibe, libvirt is the main character and you're just showing up for her 🫢


πŸ¦‹ EXAMPLES πŸ¦‹

kay so to use this module inside your Rexfile you can run these commands, periodt:

use Rex::Commands::Box;
set box => "KVM";

task "prepare_box", sub {
   box {
      my ($box) = @_;

      $box->name("mybox");
      $box->url("http://box.rexify.org/box/ubuntu-server-12.10-amd64.kvm.qcow2");

      $box->network(1 => {
         name => "default",
      });

      $box->auth(
         user => "root",
         password => "box",
      );

      $box->setup("setup_task");
   };
};

and if you're more of a YAML girlie (valid, iconic, same energy) you can use this template:

type: KVM
vms:
   vmone:
      url: http://box.rexify.org/box/ubuntu-server-12.10-amd64.kvm.qcow2
      setup: setup_task

and then you just use it like this in your Rexfile, super simple:

use Rex::Commands::Box init_file => "file.yml";

task "prepare_vms", sub {
   boxes "init";
};

like?? it's giving effortless πŸ˜­πŸ’–


πŸ‘‘ METHODS πŸ‘‘

also pls pls pls go look at the Methods of Rex::Box::Base β€” this module inherits all methods of it, so everything in there is yours too, it's the family package deal fr fr 🫢✨

πŸ“ new(name => $vmname)

the constructor, used when you're in OO mode:

my $box = Rex::Box::KVM->new(name => "vmname");

she's born πŸŽ€

🌈 memory($memory_size)

sets the memory of a VM, measured in megabyte. yeah. megabytes. don't come at me, that's what it says πŸ’€

⭐ info

returns a hashRef of vm information. that's the tea, she's gossipy, she tells you everything 🫢

🧚 ip

this method returns the ip of a vm on which the ssh daemon is listening. so like, that's the ip you actually want, the one that answers when you knock πŸ”₯


ngl bestie the only rule here is libvirt or it's over, everything else is smooth sailing 🌊

okay that's the whole page!! this was perl v5.40.1, dated 2025-10-03, and the source doc is Rex::Box::KVM(3pm) πŸ’– mwah, go build some VMs, you ate πŸ‘‘βœ¨

πŸ“¦ where this page comes from