On Thu, Feb 15, 2018 at 02:44:57PM -0500, Jiri B wrote: > Hi, > > qemu-nbd[1] is a way to "attach" qcow2 image to a nbd[2] device, > but we don't have nbd yet. Though Patrick made it working > for Bitrig[3]. Would it be usable in OpenBSD? > > If qemu-nbd is not an option, what are other ways to get > data from various qemu-supported images (if not running qemu > itself and getting data over tcp/ip)? > > I found vdfuse[4] but it would need VirtualBox libs working > on OpenBSD... > > Jiri > > [1] http://ask.xmodulo.com/mount-qcow2-disk-image-linux.html > [2] https://en.wikipedia.org/wiki/Network_block_device > An example mounting OpenBSD partitions inside qcow2 on Linux: > > # qemu-nbd --connect=/dev/nbd0 /var/lib/libvirt/images/instsrv2.qcow2 > > # fdisk -l /dev/nbd0 > Disk /dev/nbd0: 20 GiB, 21474836480 bytes, 41943040 sectors > Units: sectors of 1 * 512 = 512 bytes > Sector size (logical/physical): 512 bytes / 512 bytes > I/O size (minimum/optimal): 512 bytes / 512 bytes > Disklabel type: dos > Disk identifier: 0x00000000 > > Device Boot Start End Sectors Size Id Type > /dev/nbd0p4 * 64 41929649 41929586 20G a6 OpenBSD > > # dmesg | grep -A1 nbd0: > [670102.643817] nbd0: p4 > p4: <openbsd: p5 p6 p7 p8 p9 p10 p11 p12 p13 > > > # mount -t ufs -o ufstype=44bsd /dev/nbd0p5 /mnt > > [3] https://github.com/bitrig/bitrig/wiki/Roadmap > [4] https://github.com/SophosLabs/vdfuse >
convert it to raw using qemu-img and then attach it as a vnd. -ml

