LFS Environment Setup from Scratch

LFS Environment Setup from Scratch

To create a Linux System from Scratch you will need an existing UNIX based system with support for a number of packages that are mentioned herein. We will go through the the LFS environment setup here.

Let me re-iterate the objective of this build.

  1. It should be barebones – you will be able to add resource heavy stuff like fancy User environments and applications if you so desire. But the default system will function on something as little as 1 GB of RAM.
  2. It should be easily configurable and customizable
  3. The ability to build it should not be restricted to veteran Linux users

To satisfy the last objective, I will not be recommending you partition your hard drive and install Linux if you have not done so yet. If you are a Mac or Windows user, you can go ahead with installing a Virtualization software like Virtual Box and install any lightweight Linux distribution to get your environment requirements in place.

If you already have a Linux system running, that’s well and good as well.

But here’s how you will benefit the Virtual Box environment approach if you are a Linux newbie. With the drag and drop feature enabled, downloading packages that are required will be easier if you are using a Virtual Environment. Also the ability to create snapshots of the system helps in case you screw something up. It will save you a lot of time installing and NOT troubleshooting.

LFS environment setup
LFS environment setup Hard Disk allocation

But yeah, moving on.

You can use any Virtualization software as long as they allow you to get the job done. The Virtual Box and VMware are both options. I have gone with Virtual Box in this example.

No matter what options you choose, go ahead with the following specifications for your Virtual System –

  1. 10 GB of Virtual Hard disk space – You will probably need only 1 GB, but it is safer to go ahead with the default 10.
  2. 1 GB of Primary Memory (RAM) – We will make the system run smooth on 512 MB or less. But it’s ok for our environment to have a little more.
  3. Keep the rest values on default and they should be fine.

Make sure you have a working internet connection and the virtual network adapter in your Virtual Machine software is working fine.

LFS environment setup RAM allocation
LFS environment setup Primary memory allocation

For the base distribution, you can install any of the Linux Distributions. You have a lot of options. Stay away from the more shiny ones with the latest KDE or Gnome desktop environments. They will find your 1 GB allocation too low for running properly. Running any LXDE or XFCE or even a MATE environment is safer. I am going to go with the Lubuntu (LXDE+Ubuntu variant) as I am comfortable with the Debian and Ubuntu environment.

Preparing a good environment for Linux from Scratch

Installing the Operating System should be a breeze. For your basic LFS environment setup here are the steps in brief. You can check out a more detailed how to guide here. But the guided installation should do fine.

  1. Download Lubuntu 64 bit OS image from the website.
  2. Set the Virtual Machine optical drive to the ISO image file.
  3. Boot up the Virtual machine and chose to boot from the optical drive
  4. Allow the Linux image to boot and choose to install the operating system instead of just giving a Live Run
  5. Install Linux on the whole drive (10 GB virtual hard drive) and follow the next steps as you proceed.
  6. Complete the installation with your username and password
  7. Reboot and log in to your Lubuntu virtual system and test your virtual network adapter is working fine or not. Fire up Firefox and go to any website. If it works, you are set.

In case you run into any major issues, please do let me know.

By Sarthak Ganguly

A programming aficionado, Sarthak spends most of his time programming or computing. He has been programming since his sixth grade. Now he has two websites in his name and is busy writing two books. Apart from programming, he likes reading books, hanging out with friends, watching movies and planning wartime strategies.

Leave a Reply

Your email address will not be published. Required fields are marked *