Fedora 25 is out, virt-builder images available

$ virt-builder -l | grep fedora-25
fedora-25                x86_64     Fedora® 25 Server
fedora-25                i686       Fedora® 25 Server (i686)
fedora-25                aarch64    Fedora® 25 Server (aarch64)
fedora-25                armv7l     Fedora® 25 Server (armv7l)
fedora-25                ppc64      Fedora® 25 Server (ppc64)
fedora-25                ppc64le    Fedora® 25 Server (ppc64le)
$ virt-builder fedora-25
$ qemu-system-x86_64 -machine accel=kvm:tcg \
      -cpu host -m 2048 \
      -drive file=fedora-25.img,format=raw,if=virtio

Or to try out Fedora on a different architecture:

$ virt-builder fedora-25 --arch ppc64le -o fedora-25-ppc64le.img
$ qemu-system-ppc64 -cpu POWER8 -m 2048 \
      -drive file=fedora-25-ppc64le.img,format=raw,if=virtio


Filed under Uncategorized

5 responses to “Fedora 25 is out, virt-builder images available

  1. Thanks Rich! My only complaint with virt-builder, and I hope I’m wrong on this, is that you can’t really control how big the swap partition is. Please say there is some way to specify swap partition size!?! While I’m sure there is a way to manipulate the resulting disk image with various tools after-the-fact, that really negates the speed and ease of use of virt-builder.

    • rich

      We always say that virt-builder is just a wrapper around lower-level tools. The --size parameter really runs virt-resize. If you’re prepared to do the virt-resize step yourself as an extra step then you can control the swap partition size (or indeed other partitions).

      $ virt-builder fedora-25
      $ virt-filesystems -a fedora-25.img --all --long -h
      Name       Type        VFS   Label  MBR  Size  Parent
      /dev/sda1  filesystem  ext4  -      -    1.0G  -
      /dev/sda2  filesystem  swap  -      -    615M  -
      /dev/sda3  filesystem  xfs   -      -    4.4G  -
      /dev/sda1  partition   -     -      83   1.0G  /dev/sda
      /dev/sda2  partition   -     -      82   615M  /dev/sda
      /dev/sda3  partition   -     -      83   4.4G  /dev/sda
      /dev/sda   device      -     -      -    6.0G  -
      $ mv fedora-25.img fedora-25.img.old
      $ truncate -s 20G fedora-25.img
      $ virt-resize fedora-25.img.old fedora-25.img --resize /dev/sda2=2G --expand /dev/sda3
      Summary of changes:
      /dev/sda1: This partition will be left alone.
      /dev/sda2: This partition will be resized from 615.0M to 2.0G.
      /dev/sda3: This partition will be resized from 4.4G to 17.0G.  The 
      filesystem xfs on /dev/sda3 will be expanded using the 'xfs_growfs' method.
      $ rm fedora-25.img.old
      $ virt-filesystems -a fedora-25.img --all --long -h
      Name       Type        VFS   Label  MBR  Size  Parent
      /dev/sda1  filesystem  ext4  -      -    1.0G  -
      /dev/sda2  filesystem  swap  -      -    2.0G  -
      /dev/sda3  filesystem  xfs   -      -    17G   -
      /dev/sda1  partition   -     -      83   1.0G  /dev/sda
      /dev/sda2  partition   -     -      82   2.0G  /dev/sda
      /dev/sda3  partition   -     -      83   17G   /dev/sda
      /dev/sda   device      -     -      -    20G   -

      However doing that did reveal a bug: virt-resize does not adjust the size of the swap partition data, so when you boot the guest the first time you have to:

      # swapoff /dev/vda2
      # mkswap /dev/vda2
      # swapon /dev/vda2

      to get the extra space. This is a bug in virt-resize, so you can file that in the usual way.

  2. I don’t have a usual way with regards to virt-resize as I’ve not filed a bug on it before. I have worked with bugzilla.redhat.com a ton… but are you talking about a libguestfs specific bug site?

    Yes, since virt-builder is a wrapper to underlying tools, can’t you tell those tools what size you want the swap partition to be initially? Thanks for showing the various steps it takes to change it after-the-fact… but again, that really negates the speed and ease-of-use of virt-builder to begin with. virt-builder does have a way to specify initial disk size but when you make a huge disk and it by default has a tiny swap… I mean… who wants that? I guess just asking about the swap partition really is a cop-out on my part… as really, you’d want a way to enumerate all desired partitions and not just swap. Maybe there is an easy enough way to make a blank disk image sized and partitioned exactly as desired prior to running virt-builder and then a way to tell virt-builder to use that as a base?

    I guess once I play with your recipe a few times and better learn the disk manipulation tools, I’ll feel differently… but imagine all of the effort it takes just to adjust the swap and then what about the other partitions? Starts to sound like a nightmare or do you disagree?

  3. Pingback: Fedora on the Pine64 | Richard WM Jones

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 )

Twitter picture

You are commenting using your Twitter 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.