How to do it...

Follow these steps outlined to install a new Debian Linux distribution on the raw image:

  1. Mount the root partition from the Network Block Device (NBD) device and ensure that it was mounted successfully:
root@kvm:~# mount /dev/nbd0p2 /mnt/    root@kvm:~# mount | grep mnt    /dev/nbd0p2 on /mnt type ext4 (rw) root@kvm:~#
  1. Install the latest stable Debian distribution on the root partition mounted on /mnt from the specified public repository:
root@kvm:~# debootstrap --arch=amd64 --include="openssh-server vim" stable /mnt/ http://httpredir.debian.org/debian/    ...    I: Base system installed successfully.    root@kvm:~#
  1. Ensure the root filesystem was created, by listing all the files at the mounted location:
root@kvm:~# ls -lah /mnt/ ...

Get KVM Virtualization Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.