6000-series of slides about fun things to do with nbdkit
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 24 Oct 2019 08:47:06 +0000 (09:47 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 24 Oct 2019 09:15:51 +0000 (10:15 +0100)
2019-kvm-forum/.gitignore
2019-kvm-forum/6000-fun-stuff-with-nbdkit.html [new file with mode: 0644]
2019-kvm-forum/6200-vddk.d/vddk [new symlink]
2019-kvm-forum/6200-vddk.term [new file with mode: 0755]
2019-kvm-forum/notes/notes-06-fun-stuff [new file with mode: 0644]
2019-kvm-forum/restore [new file with mode: 0755]
2019-kvm-forum/run

index 397e2db..58f34aa 100644 (file)
@@ -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 (file)
index 0000000..24fa3af
--- /dev/null
@@ -0,0 +1,11 @@
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<link rel="stylesheet" href="style.css" type="text/css"/>
+<script src="code.js" type="text/javascript"></script>
+
+<h1>Some fun things we can do with nbdkit</h1>
+
+<p>nbdkit is an <b>NBD server with plugins</b></p>
+
+<p>
+<a href="https://github.com/libguestfs/nbdkit">https://github.com/libguestfs/nbdkit</a>
+</p>
diff --git a/2019-kvm-forum/6200-vddk.d/vddk b/2019-kvm-forum/6200-vddk.d/vddk
new file mode 120000 (symlink)
index 0000000..0e0188b
--- /dev/null
@@ -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 (executable)
index 0000000..d75a73a
--- /dev/null
@@ -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 (file)
index 0000000..d2bc352
--- /dev/null
@@ -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 (executable)
index 0000000..0af856d
--- /dev/null
@@ -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
index 2b0453a..6c04a17 100755 (executable)
@@ -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.