Because of the higher stability we use libvirt for our build process.
-
Install the required packages and cofigure libvirt
- Packages:
- libvirt0
- virt-manager
- qemu-kvm
- python3
- zerofree
- rdiff
- p7zip-full
- Setup libvirt and a network bridge (https://wiki.libvirt.org/page/Networking#Debian.2FUbuntu_Bridging)
- Packages:
-
Create a target directory for the BaseDisk builder (i.e. /opt/BaseDisk) and cd into it
- Make sure there are at least 20GB of free space
- Download "generateInitialConfig.py", "libBaseDiskBuild.py", "libVM.py", "cleanup.py" and "buildNewBaseDisk.py"
- Download the latest pm_files from http://unstable.privacymachine.eu/BaseDisk_build/pm_files/ and extract them
- Download latest guestadditions.iso from http://download.virtualbox.org/virtualbox/ and create a symlink:
ln -s VBoxGuestAdditions_5.1.26.iso VBoxGuestAdditionsUsed.iso - Create a subfolder "grmlWithSshKey" and extract http://unstable.privacymachine.eu/BaseDisk_build/grmlWithSshKey/grmlWithSshKey.tar there
-
Edit "generateInitialConfig.py" and run it afterwards to create the initial configuration as well as the folder structure
-
Make sure you have a configured network bridge for libvirt
-
Start "virt-manager"
- File -> New Virtual Machine
- Select: Import existing disk image
- Hit: Forward
- As storage path select the empty-flat.vmdk in the target directory (Browse Local)
- OS type = Linux
- Version = Debian Wheezy (or later)
- Hit: Forward
- (optional:) select 2 CPUs
- Hit: Forward
- Name = vm_BaseDisk_build
- Select: Customize before install
- Open: Advanced options
- Select: Specify shared device name
- Fill in the bridge name
- Hit: Finish
- Hit: Add Hardware
- Select: Storage
- Device Type = CDROM device
- As storage select grmlWithSshKey.iso (Browse Local)
- Hit: Finish
- Hit: Add Hardware
- Select: Storage
- Device Type = CDROM device
- As storage select VBoxGuestAdditionsUsed.iso (Browse Local)
- Hit: Finish
- Select: Disk 1
- Open: Advanced options
- Disk bus = SATA
- Hit: Apply
- Select: Boot options
- Change to:
bootable: SATA Disk 1
bootable: IDE CDROM 1
not-bootable: IDE CDROM 2
not-bootable: NIC - Hit: Apply
- Hit: Begin Installation, but "Force off the VM" at boot prompt.
-
run "buildNewBaseDisk.py" In case of a failure nothing gets removed so you can debug manually. Run "cleanup.py" to remove all old files.
This script generates the initial config, creates the folder structure and is should be edited by the user before first run. Because of the limitations of JSON files and the fact that buildNewBaseDisk.py updates its own config this script provides a easy way to generate an initial config. The configuration parameters are documented in this python script. Make sure you have no additional witespaces in lines ending with a backslash.
This script reads the configuration file "buildBaseDiskConfig.json" and triggers the build process for a BaseDisk. "buildBaseDiskConfig.json" will be updated after each successful run to store the required metadata! It also manages the generation of BaseDisk-deltas (incremental BaseDisk updates with rdiff) as well as the optional signing and uploading process.
This scripts delete the meta-data from the config file buildBaseDiskConfig.json Also the following directories are cleared:
- BaseDisk_delta
- BaseDisk_image
- BaseDisk_log
- BaseDisk_signature
This is a python class that allows communication with the VM over the libvirt command line tools and via SSH.
This is a python library that controls the actual build process of the BaseDisks. It manages the bootstrap (basic debian install) as well as the installation of additional packages and the VirtualBox guest additions.
This folder contains files which are copied to the BaseDisks. I.e. systemd scripts, openbox configurations....
Note: Neider "pm_files/pm/fonts" nor "pm_files/home/liveuser/.mozilla" are part of the git repository!
This is because of the size of this folders, for a complete download check out http://unstable.privacymachine.eu/BaseDisk_build/pm_files/
- mkdir mounted_BaseDisk
- losetup -o 1048576 /dev/loop0 empty-flat.vmdk
- mount /dev/loop0 mounted_BaseDisk