From 29bd0b7182cc392bee0786b8f31bf3316aa07123 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 24 Oct 2019 09:47:06 +0100 Subject: [PATCH] 6000-series of slides about fun things to do with nbdkit --- 2019-kvm-forum/.gitignore | 4 ++++ 2019-kvm-forum/6000-fun-stuff-with-nbdkit.html | 11 +++++++++++ 2019-kvm-forum/6200-vddk.d/vddk | 1 + 2019-kvm-forum/6200-vddk.term | 19 +++++++++++++++++++ 2019-kvm-forum/notes/notes-06-fun-stuff | 22 ++++++++++++++++++++++ 2019-kvm-forum/restore | 10 ++++++++++ 2019-kvm-forum/run | 10 ++++++++-- 7 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 2019-kvm-forum/6000-fun-stuff-with-nbdkit.html create mode 120000 2019-kvm-forum/6200-vddk.d/vddk create mode 100755 2019-kvm-forum/6200-vddk.term create mode 100644 2019-kvm-forum/notes/notes-06-fun-stuff create mode 100755 2019-kvm-forum/restore diff --git a/2019-kvm-forum/.gitignore b/2019-kvm-forum/.gitignore index 397e2db..58f34aa 100644 --- a/2019-kvm-forum/.gitignore +++ b/2019-kvm-forum/.gitignore @@ -1,3 +1,7 @@ /bindings /history /fastzero.d/src.qcow2 +/6200-vddk.d/fedora.vmdk +/6200-vddk.d/fedora.vmdk.xz +/6200-vddk.d/fedora.vmdk.lck +/6200-vddk.d/mp diff --git a/2019-kvm-forum/6000-fun-stuff-with-nbdkit.html b/2019-kvm-forum/6000-fun-stuff-with-nbdkit.html new file mode 100644 index 0000000..24fa3af --- /dev/null +++ b/2019-kvm-forum/6000-fun-stuff-with-nbdkit.html @@ -0,0 +1,11 @@ + + + + +

Some fun things we can do with nbdkit

+ +

nbdkit is an NBD server with plugins

+ +

+https://github.com/libguestfs/nbdkit +

diff --git a/2019-kvm-forum/6200-vddk.d/vddk b/2019-kvm-forum/6200-vddk.d/vddk new file mode 120000 index 0000000..0e0188b --- /dev/null +++ b/2019-kvm-forum/6200-vddk.d/vddk @@ -0,0 +1 @@ +/home/rjones/tmp/vddk/vmware-vix-disklib-distrib \ No newline at end of file diff --git a/2019-kvm-forum/6200-vddk.term b/2019-kvm-forum/6200-vddk.term new file mode 100755 index 0000000..d75a73a --- /dev/null +++ b/2019-kvm-forum/6200-vddk.term @@ -0,0 +1,19 @@ +#!/bin/bash - + +source functions + +# Title. +export title="VDDK" + +# History. +remember 'LD_LIBRARY_PATH=vddk/lib64 nbdkit vddk file=$PWD/fedora.vmdk' +remember 'nbdsh -u nbd://localhost' +remember 'guestfish --ro --format=raw -a nbd://localhost -i' +remember 'nbdfuse mp nbd://localhost &' +remember 'ls -lh mp' +remember 'hexdump -C mp/nbd | head -30' + +./restore +cd 6200-vddk.d +terminal +./restore diff --git a/2019-kvm-forum/notes/notes-06-fun-stuff b/2019-kvm-forum/notes/notes-06-fun-stuff new file mode 100644 index 0000000..d2bc352 --- /dev/null +++ b/2019-kvm-forum/notes/notes-06-fun-stuff @@ -0,0 +1,22 @@ +The aim here is to show some fun/weird/outlandish things we +can do with nbdkit. + +* Heading: Isolate VDDK + +nbdkit vddk file=demo.vmdk +Open it with: + guestfish + nbdsh + nbdfuse + +* Heading: Boot a busybox VM + +https://rwmj.wordpress.com/2019/02/19/nbdkit-linuxdisk-plugin/ + +* Heading: Data disks + +https://rwmj.wordpress.com/2019/10/05/another-nbd-boot-sector-hack/ + +* Heading: Reflection + +https://rwmj.wordpress.com/2019/09/13/nbdkit-supports-exportnames/ \ No newline at end of file diff --git a/2019-kvm-forum/restore b/2019-kvm-forum/restore new file mode 100755 index 0000000..0af856d --- /dev/null +++ b/2019-kvm-forum/restore @@ -0,0 +1,10 @@ +#!/bin/bash - + +# Only do this on Rich's laptop. +if [ "$LOGNAME" = "rjones" ]; then + fusermount -u $talkdir/6200-vddk.d/mp >& /dev/null + sleep 0.5 + killall nbdkit >& /dev/null +fi + +exit 0 diff --git a/2019-kvm-forum/run b/2019-kvm-forum/run index 2b0453a..6c04a17 100755 --- a/2019-kvm-forum/run +++ b/2019-kvm-forum/run @@ -12,8 +12,14 @@ export GNOME_KEYRING_PID= #unset https_proxy #unset ftp_proxy -# If we need to precreate any files. -# ... +# Clean up after previous run. +talkdir=$PWD ./restore + +# Precreate any files necessary. +rm -rf 6200-vddk.d/mp +mkdir 6200-vddk.d/mp +#rm -f 6200-vddk.d/fedora.vmdk +#unxz --keep 6200-vddk.d/fedora.vmdk.xz # Run techtalk. The demos require nbdkit 1.14, libnbd 1.1.5, and qemu 4.2, # which are not present in Fedora 30, so point to self-built versions. -- 1.8.3.1