Annotation of wikisrc/kernel_debugging_with_qemu.mdwn, revision 1.2

1.1 wiki 1: # Introduction
2:
1.2 ! wiki 3: Virtual machines are a convenient way to test, debug or even audit different systems on one single host. This is particularly helpful when you need to set up a machine for which you do not necessarily have the hardware, or the access, in a very cheap way, without risking breaking your day-to-day system.
1.1 wiki 4:
1.2 ! wiki 5: This tutorial show the different steps required to set up a raw disk image like the one used by QEMU. It deals with two different point of views:
1.1 wiki 6: * the host, which is the machine and OS hosting the different VMs.
7: * the guest(s), representing the different systems emulated/hosted on the host, through QEMU.
8:
9: # Setting up the environment
10:
1.2 ! wiki 11: ## Creating the raw disk image
! 12:
1.1 wiki 13: To start our VM, we need some disk space to provide an emulated hard drive. For QEMU, by default, this is done through raw disk images. Therefore, the first step will be the creation of a disk image file. Here, we create a 2GB file, filled with zeros:
14:
1.2 ! wiki 15: $ dd if=/dev/null of=netbsd-guest.img bs=1m count=2000
1.1 wiki 16:
17: /!\ if you want to mount the file image from within the host later through [[!template id=man name="vnconfig" section="8"]], it is recommended to use [[!template id=man name="dd" section="1"]] and not the *qemu-img* tool, as [[!template id=man name="vnd" section="4"]] does not support sparse disk image yet.
18:
1.2 ! wiki 19: Now that the disk image file is ready, we will need to install our system inside.
! 20:
! 21: ## Copy bootloader and create disklabel
! 22:
! 23: ## Mount the filesystem
! 24:
! 25: # Installing the system
! 26:
! 27: ## Quick and easy way
! 28:
! 29: ## Through build.sh
! 30:
! 31: # Configuring the system
! 32:
! 33: # Starting-up the VM
1.1 wiki 34:
1.2 ! wiki 35: # Convenient scripts