Having a custom Linux distro can be the coolest thing ever. Most of you will probably be satisfied with any particular Linux distribution, but I know I'm not the only one out there who wants it to have custom configurations and programs preloaded while leaving the bloatware behind.
The good thing? A custom distro doesn't have to be a fantasy. Linux is based on open-source software and user-contributed content, so setting up your own version isn't all that hard. The hardest part is getting started, because it's hard to find the exact details on the internet.
That's what this Null Byte is here for! We're going to create a custom, live Arch Linux CD that can have all of your personal configurations and software pre-installed.
- An installed version of Arch Linux on the computer that you're making this on.
- 10GB of drive space (just to be safe).
- A blank CD or DVD (depending on the size of the finished disc).
- Root privileges on the computer.
Commands for the terminal are written in bold.
Step 1 Create a Chroot Base System
First off, we need to create what is know as a chroot. A chroot is a root Linux file system within another. So by creating one, we can put ourselves inside our OS-in-progress and paint the house from the inside, so to speak.
- Download the necessary tools:
su && pacman -S devtools git make --needed
- Create a chroot with base-packages:
mkarchroot /tmp/chroot base
- Clone the Archiso package:
git clone git://projects.archlinux.org/archiso.git
- Compile Archiso to your chroot:
make -C archiso/archiso DESTDIR=/tmp/chroot install
- Enter our chroot:
mkarchroot -r bash /tmp/chroot
Step 2 Customize the ISO & Packages
Now we are going to customize the OS from the inside out. We can customize the whole OS from here, but we are going to go over packages, configuration files, and a window manager.
- Create a loopback interface:
mknod /dev/loop0 b 7 0
- Configure a server to download packes from, this one is the most up-to-date:
echo 'Server = http://ftp.osuosl.org/pub/archlinux/$repo/os/x86_64' >> /etc/pacman.d/mirrorlist
- Let's download any packages we want! Here are the required ones:
pacman -S devtools libisoburn squashfs-tools
I would recommend installing the following packages for the average user.
With this list of packages, you will have a few graphical tools as well as a graphical user interface on the disc already.
Next, we can create our user and change any configuration files that we want. Some common files I like to change are:
It's incredibly convenient to have all of your custom settings out of the box. You can't do that with Windows!
Step 3 Build the ISO
After you have done all the customizing you desire, we can build the ISO for burning.
- cp -r /usr/share/archiso/configs/baseline /tmp
- cd /tmp/baseline
Now, you will be out of your chroot, with the built ISO at the file path of:
Congratulations! You now have your own custom live media! Bring any questions and interesting conversations over with you to the Null Byte IRC!
Want to start making money as a white hat hacker? Jump-start your hacking career with our 2020 Premium Ethical Hacking Certification Training Bundle from the new Null Byte Shop and get over 60 hours of training from cybersecurity professionals.
Other worthwhile deals to check out: