New in virt-sysprep: Add firstboot scripts

In libguestfs ≥ 1.19.32 you can now use the virt-sysprep to add “firstboot” scripts to Linux guests. These scripts run exactly once the next time the guest boots, so you can use them to customize the guest in an infinite number of ways: Installing software, changing logos and desktop backgrounds, adding user accounts, etc.

To use this, simply use the --firstboot option on the command line as many times as required:

$ virt-sysprep -a guest.img \
    --firstboot ./yum-update.sh \
    --firstboot ./set-desktop.sh
Advertisement

4 Comments

Filed under Uncategorized

4 responses to “New in virt-sysprep: Add firstboot scripts

  1. Sander

    Now that’s an interesting feature! Unfortunately it will take a while to RHEL 6.5 to be released with 1.20

    • rich

      I guess this is more likely a RHEL 7 feature.

      Nevertheless, you can already do this using guestfish. virt-sysprep makes it simpler, but you can follow the same steps by hand.

      • Sander

        I still hope 1.20 get in RHEL 6.5 , this way is simpler to write and read. I’ve got some projects which could used it.

        But anyway, that’s script you posted is a good solution, for now at least.

  2. Kazuo Moriwaka

    nice! Unique ID regeneration needs per-VM regeneration and this is the solution 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.