version 1.1, 2010/04/08 11:20:54
|
version 1.2, 2010/04/21 21:22:01
|
Line 1
|
Line 1
|
# Introduction |
# Introduction |
|
|
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. |
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. |
|
|
This tutorial show the different steps required to set up a raw disk image like the one used by QEMU, to either try, test, audit (or even assess) modifications done to a particular NetBSD's environment, without having access to the real hardware, or alter your day-to-day system, with the risk of making it unusable. |
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: |
|
|
It is also a lot faster to test modifications within a virtual machine. |
|
|
|
This tutorial deals with two different point of views: |
|
* the host, which is the machine and OS hosting the different VMs. |
* the host, which is the machine and OS hosting the different VMs. |
* the guest(s), representing the different systems emulated/hosted on the host, through QEMU. |
* the guest(s), representing the different systems emulated/hosted on the host, through QEMU. |
|
|
# Setting up the environment |
# Setting up the environment |
|
|
|
## Creating the raw disk image |
|
|
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: |
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: |
|
|
dd if=/dev/null of=netbsd-guest.img bs=1m count=2000 |
$ dd if=/dev/null of=netbsd-guest.img bs=1m count=2000 |
|
|
/!\ 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. |
/!\ 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. |
|
|
Now that the disk image file is ready, we need to install our system inside. |
Now that the disk image file is ready, we will need to install our system inside. |
|
|
|
## Copy bootloader and create disklabel |
|
|
|
## Mount the filesystem |
|
|
|
# Installing the system |
|
|
|
## Quick and easy way |
|
|
|
## Through build.sh |
|
|
|
# Configuring the system |
|
|
|
# Starting-up the VM |
|
|
=> TODO |
# Convenient scripts |