= How to prepare a fresh VM image for download =

{{{#!wiki note
This is for VirtualBox so if you use another VM thingie your mileage may vary
}}}

 1. Open the .ovf and confirm importing
 1. Click "Settings" and adjust them as following:
  * General->Basic: change "Version" to Debian
  * General->Description: maybe put a short manual how to get started here
  * System->Motherboard: enable "Hardware clock in UTC time"
  * Storage:
   * Select the CD drive on the IDE controller and "insert" a Linux live CD image (click the small CD icon right to the "CD/DVD Drive" drop-down box)
   * Select the SCSI controller and enable "Use host I/O cache" (this is important otherwise the machine will have a corrupt file system after each complete shutdown)
 1. Start the VM which should boot the live CD (eg Knoppix or any other)
 1. Mount the disk: {{{sudo mount /dev/sda1 /mnt/}}}
 1. Download the customisation package: {{{
cd /mnt/root/
sudo wget --content-disposition 'https://wiki.cacert.org/SystemAdministration/Systems/Development?action=AttachFile&do=get&target=cacert-dev-image_0.2_all.deb'
}}}{{{#!wiki note
You can also use a web browser to [[attachment:../cacert-dev-image_0.2_all.deb|download the file]] and then copy it to the right place on the command line
}}}
 1. Chroot with network connection: {{{
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
sudo mount -o bind /sys/ /mnt/sys/
sudo mount -o bind /proc/ /mnt/proc/
sudo chroot /mnt/
}}}
 1. Change root password to a known value: {{{passwd}}}
 1. Install the customisation package: {{{
dpkg -i root/cacert-dev-image_0.2_all.deb
# ^ This will fail to configure due to missing dependencies but already unpack the package ^
aptitude install cacert-dev-image
# ^ This dowloads the dependencies and finishes the configuration ^
}}} {{{#!wiki important
You will be asked whether you want to replace the `firewall.sh` and `interfaces` with the package maintainer's version. At least replacing `interfaces` is strongly recommended because it makes the network setup a whole lot easier.

There may be some problems with `mtop` but that's not related to cacert-dev-image
}}}
 1. Shutdown live CD and export the VM (File->Export Applianceā€¦) one time using the all in one `.ova` and the other time in `.ovf` format both times with the manifest option checked (allows to easily identify corrupted downloads)

----
 . [2013-08-24] (u60)  works for '''[[SystemAdministration/Systems/Development#T8|T8]]''' too.

----
 . CategorySystems
 . CategorySoftwareAssessment