O'Reilly logo

KVM Virtualization Cookbook by Konstantin Ivanov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

We take advantage of the functionality that the nbd kernel module provides by allowing us to associate a raw image file to a block device using the qemu-nbd utility. To get more information about the kernel module run the following code:

root@kvm:~# modinfo nbdfilename: /lib/modules/4.4.0-62-generic/kernel/drivers/block/nbd.kolicense: GPLdescription: Network Block Devicesrcversion: C67096AF2AE3C738DBE0B7Edepends:intree: Yvermagic: 4.4.0-62-generic SMP mod_unload modversionsparm: nbds_max:number of network block devices to initialize (default: 16) (int)parm: max_part:number of partitions per device (default: 0) (int)root@kvm:~#

We can examine the block device metadata created in step 2 by running the following command:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required