Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Bernie (codewiz@mstdn.io)'s status on Sunday, 19-Dec-2021 08:03:24 UTC Bernie Bernie

    Anyone knows how to setup kvm/libvirt to boot a VM directly from an LVM partition containing a filesystem?

    I just want the host to load the latest kernel + initrd from the root filesystem of the VM without the need for a DOS partition table, an MBR to load GRUB, etc.

    In conversation Sunday, 19-Dec-2021 08:03:24 UTC from mstdn.io permalink
    • Bernie (codewiz@mstdn.io)'s status on Sunday, 19-Dec-2021 08:06:32 UTC Bernie Bernie
      in reply to
      • Stanislas :NotLikeThis:
      • Benoit

      And if the solution starts with "create a GPT and a UEFI boot partition", then I'm happy to keep the MBR.

      What I'm looking for is to simplify VM disks down to a plain filesystem hosted in an LVM logical volume. Now I have this DOS/GPT disk nonsense that can't be mounted on the host without special magic.

      cc: @benoit @angristan

      In conversation Sunday, 19-Dec-2021 08:06:32 UTC permalink
    • スプリットショックウイルス :arch_linux: (splitshockvirus@distrotoot.com)'s status on Sunday, 19-Dec-2021 09:25:00 UTC スプリットショックウイルス :arch_linux: スプリットショックウイルス :arch_linux:
      in reply to

      @codewiz I think libvirt manager has xml support for filesystems as a way to attach disk storage.

      I don't know if it can be used to accomplish what you described (as in I've never done that). However there is the ability to mount qcow2 disks directly onto a linux filesystem via qemu-nbd so I don't see why what you described wouldn't be possible.

      I'll look into this later today if you haven't found out an answer.

      In conversation Sunday, 19-Dec-2021 09:25:00 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Sunday, 19-Dec-2021 09:25:00 UTC Bernie Bernie
      in reply to
      • スプリットショックウイルス :arch_linux:

      @SplitShockVirus Thank you!

      In conversation Sunday, 19-Dec-2021 09:25:00 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Sunday, 19-Dec-2021 09:35:01 UTC Bernie Bernie
      in reply to
      • Patrick Georgi

      @patrick I like the qemu + coreboot with a grub payload idea because it should work seamlessly with any distro which updates the grub config after installing a kernel update.

      Where do I find the right image? Or how would I build it myself?

      In conversation Sunday, 19-Dec-2021 09:35:01 UTC permalink
    • Patrick Georgi (patrick@georgi.family)'s status on Sunday, 19-Dec-2021 09:35:03 UTC Patrick Georgi Patrick Georgi
      in reply to
      @codewiz mount -oro,loop your-lvm-partition /somewhere; cp /somewhere/bzImage /somewhere/initrd /tmp/foo; umount /somewhere; kvm -kernel /tmp/foo/kernel -initrd /tmp/foo/initrd -all -the -other -kvm -cruft

      ;-)

      The more sophisticated variant (that gets by without the host kernel touching VM data, which can be awkward if the VM kernel messed with it in unknown ways) would be an emulation/qemu-q35 coreboot image with grub2 or filo or something as payload. That way the in-"flash" code knows your filesystem and can load kernels directly.

      The option for enable such an image in kvm would be "kvm -bios /path/to/bios/image", and I guess libvirt has some underexercised config field doing the same.
      In conversation Sunday, 19-Dec-2021 09:35:03 UTC permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.