How to become a 1EE7 Linux Hacker

Discussion in 'all things UNIX' started by Mrkvonic, Jun 15, 2006.

Thread Status:
Not open for further replies.
  1. Mrkvonic

    Mrkvonic Linux Systems Expert

    May 9, 2005

    In other words - building Linux From Scratch.

    If you decide to try out the things written in my thread, you will learn how the heart of Linux works, you will learn how to build and compile your own kernel (in fact your very own distro), you will learn everything that a leet man today needs to be dubbed a linux geek. This takes some time, but it's worth it.

    OK, so here it is:

    The site documents how a person can build their own custom Linux, entirely from sources. Everything is nicely summed up in a book called Linux From Scratch Book:

    Now, all you need to do is - follow the instructions in the book. However, to make things easier, it is possible to download the LFS live CD, which contains all the sources and tools needed to complete all of the instructions in the book.

    The only issue that remains is, where and how to test all of the above? I guess not everyone has Linux installed, or free unpartitioned space on their harddisks. For this reason, you will need VMware Player.

    Install it.

    Now, we will build a little virtual machine that will run host our linux.

    We will need a machine (a vmx file) that will run our virtual environment, we will also need a virtual hard disk (a vmdk file), and we will need to burn the live CD iso to a disk. Alternatively, it is possible to run the virtual machine by mounting the .iso file. This way, you will not have to meddle with burning CDs, inserting them while powering up the virtual machine etc. Furthermore, this guarantees that you will be able to run your machine on any pc, including those without a burner or even a physical CD-ROM.

    So, to run live CD as a mounted iso, please follow the below instructions:

    Here's the text output for your vmx file. Replace the name generic to anything you like (e.g. linux_from_scratch). Make sure the hard disk name you choose and iso name you choose are written correctly in the configurations below.
    You can copy the text into any text editor (e.g. Notepad) and save it with the suffix .vmx as an All Files type (not .txt!).

    config.version = "8"
    virtualHW.version = "3"
    ide0:0.present = "TRUE"
    ide0:0.filename = "generic.vmdk"
    memsize = "256"
    MemAllowAutoScaleDown = "FALSE"
    ide1:0.present = "TRUE"

    #ide1:0.fileName = "auto detect"
    #ide1:0.deviceType = "cdrom-raw"

    ide1:0.fileName = "generic.iso"
    ide1:0.deviceType = "cdrom-image"

    ide1:0.autodetect = "TRUE"
    floppy0.present = "FALSE"
    ethernet0.present = "TRUE"
    usb.present = "TRUE"
    sound.present = "TRUE"
    sound.virtualDev = "es1371"
    displayName = "Linux From scratch"
    guestOS = "other26xlinux"
    nvram = "generic.nvram"
    MemTrimRate = "-1"

    ide0:0.redo = ""
    ethernet0.addressType = "generated"
    uuid.location = "56 4d 5c cc 3d 4a 43 29-55 89 5c 28 1e 7e 06 58"
    uuid.bios = "56 4d 5c cc 3d 4a 43 29-55 89 5c 28 1e 7e 06 58"
    ethernet0.generatedAddress = "00:0c:29:7e:06:58"
    ethernet0.generatedAddressOffset = "0"

    tools.syncTime = "TRUE"
    ide1:0.startConnected = "TRUE"

    uuid.action = "create"

    checkpoint.vmState = ""

    OK, now we need a virtual hard disk. The best and the easiest way to create them is using the QEMU emulator.

    Download it and install it. Then, to create a virtual hard disk:
    Start > Run > cmd
    Go to the folder you installed QEMU, e,g, F:\QEMU
    Write the following command:
    qemu-img.exe create -f vmdk generic.vmdk 6G
    This will create a configuration file that will be your hard disk, with the size of 6Gb. If you want more or less change 6G to 4G, 8G, 7200M etc. I do not recommend less tha 6G, though.

    Copy the generic.vmdk and generic.vmx to a folder of your choice, e.g. C:\LFS. Now, copy the Linux From Scratch iso to this same folder.

    Now, you're set. Start VMware Player and run the generic.vmx (or renamed to whatever you like). You will boot from CD. Once booted, start executing the commands in the book. First though, create a primary and swap partitions using cfdisk command. cfdisk has a small GUI, and it's pretty straightforward. Just a tip, remember to change the type of the swap partition (82).

    And that's it.

    Now, you can start building your own distro.

    Have fun!
  2. Mrkvonic

    Mrkvonic Linux Systems Expert

    May 9, 2005
    I guess no one wants to be leet... :(
  3. NGRhodes

    NGRhodes Registered Member

    Jun 23, 2003
    Nope, too busy hacking bank websites !

    Seriously good website though !
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.