Menu

Prepare Virtual Machine

Dirk Krause
← Previous ↑ Home ↑ Live Systems → Next

Prepare Virtual Machine to build Disklessian or DKtoolian

Create VM or container

Create VM or container
On your computer — referred to as “the virtualization host“ below — create a virtual machine or a container.

Disk space: 32 GiB ore more
Assign at least 32 GiB disk space to the virtual machine.
Formerly I recommended 48 GiB to build a customized kernel. This is no longer necessary.

Debian GNU/Linux base system + ssh server
Install Debian 12 (bookworm).
In the software selection dialog disable any options for a graphical desktop and enable the option to install the SSH server.

Unprivileged user and root user
During installation you have to specify full name and user name of an unprivileged user. A password is required too. I recommend to leave the users shell at the default value.
Another password is required for the root user.

Boot
At the end of the installation process you can boot the VM into the Debian system just installed.


Repository branches

All branches
If the live systems to build use WiFi or Bluetooth there is a good likelihood to need binary firmware files at boot time.
For licensing reasons some firmware packages can not be distributed together with a Linux kernel on same media, so they are in the contrib or non-free repository branches which are not enabled by default.
We have to enable access to these repository branches manually.

As root in the virtual machine edit the /etc/apt/sources.list file. In all non-comment lines replace “ main” by “ main non-free-firmware contrib non-free”. So a typical example line

deb http://deb.debian.org/debian/ bookworm main non-free-firmware

must be changed to:

deb http://deb.debian.org/debian/ bookworm main non-free-firmware contrib non-free

Update and upgrades
Updates and upgrades may be available for some packages.
As root in the virtual machine run:

apt-get update && apt-get -y dist-upgrade

If any packages were installed or updated, reboot the virtual machine:

shutdown -r now

Additional packages

As root in the virtual machine run:

apt-get -y install net-tools sudo rsync gpg nfs-client

Allow sudo

Choice 1: Modify /etc/sudoers file

As root in the virtual machine edit the /etc/sudoers file. Below the

root    ALL=(ALL:ALL) ALL

line add a

user    ALL=(ALL:ALL) ALL

line. Replace “user” by the login name of the unprivileged user.

Choice 2: Create file /etc/sudoers.d/user

Create a /etc/sudoers.d/username file containing a line

user    ALL=(ALL)       NOPASSWD: ALL

Choice 3: Use usermod command

usermod -a -G sudo _username_

Download and unpack dklivesys

Downloads directory
As unprivileged user in the virtual machine run:

cd
if [ ! -d Downloads ]
then
    mkdir Downloads
    chmod 755 Downloads
fi

Download sources
Download the dklivesys-bookworm-1.0.22.tar.gz archive into the Downloads directory.
The downloads are available from the DK tools project page at SourceForge. In the “Files” area change into the “dklivesys” directory. From the subdirectory indicating the most recent version retrieve the dklivesys-debianversion-version.tar.gz archive.

Unpack sources
Unpack the source archive:

cd ~/Downloads
tar xzf dklivesys-bookworm-1.0.22.tar.gz

Replace “1.0.22” by the version number of your downloaded file if necessary.

You can now either install the software into a subdirectory below /usr/local or build packages to install.

Installation to /usr/local/dklivesys-1.0.22 allows you to modify the dklivesys scripts if necessary. So this installation is recommended for those planning to contribute to the project. Probably some extra action is required to have the man pages available.

Installation via package management is recommended for those “just using” dklivesys but not planning to modify the scripts.

Choice 1: Installation to /usr/local/dklivesys-1.0.22

Installation
As root in the virtual machine run

mkdir -p /usr/local/dklivesys-1.0.22
cd ~user/Downloads/dklivesys-1.0.22
sbin/dklivesys-pkg-common
./configure --prefix=/usr/local/dklivesys-1.0.22
make
make install

Set PATH
As root in the virtual machine create or modify the /etc/profile.d/dklivesys.sh file:

:
DKLIVESYSVERS="1.0.22"
if [ -d /usr/local/dklivesys-${DKLIVESYSVERS}/sbin -a "X"`id -u` = "X0" ]
then
  export PATH="/usr/local/dklivesys-${DKLIVESYSVERS}/sbin:${PATH}"
fi

Make sure all users have read permission to the file

chmod 644 /etc/profile.d/dklivesys.sh

Finally log off and back on in the virtual machine as root and check the PATH.
For root, PATH should contain the /usr/local/dlivesys-1.0.22/sbin directory now.

Choice 2: Installation as package

Build the package
As unprivileged user in the virtual machine run

cd ~/Downloads
cp dklivesys-bookworm-1.0.22.tar.gz dklivesys-1.0.22.tar.gz
cd ~/Downloads/dklivesys-1.0.22
scripts/debian-build-deb

Install the package
As root in the virtual machine run

cd ~user/Downloads
dpkg -i dklivesys_1.0.22-1_all.deb

Install packages required by dklivesys

As root in the virtual machine run

dklivesys-pkg-common

Optional steps

  • [Optional Steps to Use DK tools Packages]
    As the name implies, the “DKtoolian” live system contains the DK tools.
    To build DK tools packages, we need a GPG key to sign the packages and an internal Web server on the virtualization host to provide the packages to the VM.
    This step is only required to build DKtoolian, you can skip it if you are just interested in Disklessian.
     

  • [Optional Steps to Build Net Boot Systems]
    To build network boot live systems we have to install a modified live-build package and we must make modified libklibc and live-boot packages available for live system build process.
    These steps are only required to build a net boot DKtoolian, you can skip them if you are just interested in Disklessian or USB/CD/DVD boot DKtoolian.


← Previous ↑ Home ↑ Live Systems → Next

Related

Wiki: Live Systems
Wiki: Optional Steps to Build Net Boot Systems
Wiki: Optional Steps to Use DK tools Packages

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.