1. Boot Linux using PXE over LAN

    There are a few circumstances where PXE booting is desirable, such as mass booting or booting a foreign OS on a legacy computer (that does not have USB booting or disc drive). The question is how to boot an OS over LAN? PXE is a way, but the setup is not as straightforward as you might think, and this post will show you how.

    Things you should have.
    APXE boot capable Linux distro
    A PXE capable computer
    pxelinux.0 file
    A network switch (If you’re using a router disable the built-in DHCP)

    Firstly place the pxelinux.0 file and the extracted Linux distro image folder into a main directory, for example I dump everything in the C:\Users\AhHeng\Desktop\PXE directory. Download tftpd to setup a DHCP server on your computer. DHCP works by telling the PXE booting computer where the OS is located and how to access it.


     
    Open up tftpd and click on Settings. At the global tab make sure you have TFTP Server and DHCP Server enabled. 
     Click on the TFTP tab and at the advanced TFTP Options, tick ‘PXE Compabiliity’ and ‘Bind TFTP to this address’ (the LAN address of computer running tftpd). For the ‘Base Directory’ enter the full link to the main directory, for example mine is C:\Users\AhHeng\Desktop\PXE. 



    At the DHCP tab, you can setup the DHCP anyway you like. My IP pool starting address (the first IP address to be assigned) is 192.168.28.2, size of pool (number of IP that can be assigned) is 20, Mask (the subnet of the network) is 255.255.255.255, the others you can leave blank however the Boot file, must be pxelinux.0. Also at the DHCP Options, make sure you untick ‘Ping address before assignation’ and tick ‘Bind DHCP to this address’ (the address of computer running tftpd). Click OK. Then, set the server interface to the address of computer running tftpd.



    Next download FreeNFS and place the FreeNFS.exe at same directory of tftpd, and run it. The FreeNFS will serve the actual OS file system after tftpd told the PXE booting computer where to look for it. Enter the folder location where you extracted your Linux distro. For example, my Backtrack 5 is located at C:\Users\AhHeng\Desktop\PXE\BT5.

    Before you can start booting, create a folder called pxelinux.cfg (yes a folder with a file extension) at the main directory and in the pxelinux.cfg folder create a new text file. In the text file copy paste this whole thing

    TIMEOUT 100
    DEFAULT bt5
    PROMPT 1
    DISPLAY /isolinux.msg
    LABEL bt5
            KERNEL BT5/casper/vmlinuz
            APPEND initrd=BT5/casper/initrd.gz BOOT=casper boot=casper netboot=nfs nfsroot=192.168.1.2:/BT5

    In my case, this is correct, and should work on other Linux distro. The KERNEL option you see points to the kernel of the Linux distro to be booted, so for example my Backtrack 5 is placed at C:\Users\AhHeng\Desktop\PXE\BT5, the KERNEL option is BT5/casper/vmlinuz (mind the slash and backslash). The LABEL option you can put anything you like, but remember it because you have to enter this LABEL when booting .The APPEND option is the extra commands that are passed to the KERNEL

     initrd=BT5/casper/initrd.gz BOOT=casper boot=casper netboot=nfs nfsroot=192.168.1.2:/BT5

    Replace the’ BT5/’ with the name of your folder and the ‘192.168.1.2:/BT5’ with the address of the computer running tftpd, also replace the DEFAULT option to what you entered for LABEL. Then, save the text file with the name ‘default’ (without any file extensions).



    Go back to the main directory and create a text file called ‘isolinux.msg’, open it up and enter anything you like, such as ‘Type BT5 to load backtrack 5’ and save it. The message will be shown when booting.

    All said and done, connect your PXE booting computer to the network and set it to boot from network, and you should see something like this.

     
    And then this


    At the prompt, type in the LABEL option that you entered previously or wait for it to boot automatically.
    After all the scrolling the PXE booting computer will start to look for the NFS hosted file system, and start the live OS.


    Continue reading »
  2. How to host ftp server at home.


     
    You might often want to send files to your friends, or anybody or host a file, and people usually resort to online storage service such as Windows Live SkyDrive, or Mediafire and the such. But those services do not give you full control on how the files are served and accessing those sites are usually slow and clunky or require registration.

    This post will guide you step by step on how to set up a ftp server on your computer so you can access it anywhere.

    Step 1.
    Grab yourself Filezilla FTP server and install it. After installing it, you will be presented with a login prompt. This is the login prompt for the server control interface.

    Just leave the password blank and press 'OK'. Then you will be presented with the server control interface.

    Now you will have to setup the server for use. Of course you have to start adding user first. Click the icon with one user at the top bar.


    At the user account control dialog, go to the 'Shared Folder' page.

    Then click on 'Add' under 'Users'


    Then an 'add user account' dialog appears. Here you can enter your desired username. You can just leave the group as none.



    Tip: Use the username 'anonymous' if you want to make the server accessible without a password.

    You can add more users later if you want by repeating the steps.

    Press OK when you're finished.

    Then now you have to assign the folder accessible by that user. You can do that by clicking 'add' under the 'shared folder'.


    A 'Browser folder' dialog appears. Here you can specify the folder that is accessible by the user.

    For example, you can choose to share 'My Music' folder. Press 'OK' when you are done.
    You can choose to share multiple folders for that user by clicking 'add' and choosing another folder.

    After adding the folder for that user, you can specify actions allowed to be done on the folder by the user. The tick boxes beside the 'shared folders' allow you to control what the user can do to the folder.

    Description of the tickboxes.
    Files
    Read - allow user to see the folder
    Write - allow user to put files into the folder
    Delete - allow user to delete files in the folder

    Directories
    Create - allow user to create folders inside the folder
    Delete - allow user to delete folder inside the folder
    List - allow user to list folders contained inside the folder
    + Subdirs - apply the rules to the folders inside the folder.

    Tip: You can set different rules and permissions for different folders by clicking on the folder and ticking the desired boxes. You can also set shared folders and their properties for different users by selecting the user from the 'Users'

    After you're done, it's time to set a password for the user.

    You can do that by first, clicking the 'General' page.

    Under the 'account settings', tick the 'Password' box and make the password field active. After ticking, type in your desired password and remember. The other settings can be left as it is.

    Tip: If you have more than one user, select the user from the 'Users' to view and change settings for the specific user.

    When everything is done, just press OK.


    You FTP server is now configured and ready to be used. To test out your server, simply go to 'My Computer' and type "ftp://localhost" at the address bar.


    And then just press enter and a login prompt appears. Just supply it with the username and password you set earlier.

    After logging on you should see the contents of the folder you shared for that user.

    Part 2.
    Your ftp server is now only accessible on the local network, that is only the computers connected to the local network can see and access the ftp server. In order to make the server accessible outside the local network, just follow the steps below.

    Tip: If the computer is directly connected to the internet, you can skip these steps. How can I tell if my computer is directly connected to the internet?

    We now will setup port forwarding for your router. Firstly, go to the router configuration page of your router, which are usually http://192.168.1.1, http://192.168.0.1, http://192.168.1.2 or http://10.0.0.1. Just click on one of the addresses and if one of it responds then use that is the router configuration address.

    At the router configuration login, just supply it with the username and password. If you don't know them, just use the default credentials by referring it here.
    [If you happen to be a Malaysian streamyx user, and happen to be using a TM supplied router, the username is either "tmadmin", or "tmuser", with password "tmadmin" or "tmuser"]



     You should look for something called 'NAT' or 'Port Forwarding' or 'Virual Servers' For my router, it is 'Virutal Servers' located under the 'Advanced Setup'.


    At the virtual servers config page, click on 'Add'

    Then you should see something like this.


    Click on the 'Custom Service' radio button and give the forwarded port a name. The 'Server IP Address' is the address of your computer locally, just put in '192.168.1.254' as this address will be configured as a static address for your computer.

      
    Next is to specify the forwarded port. FTP uses port 21 to 23, so under both the 'External Port Start' and 'Internal Port Start', put in 21, while under the 'External Port End' and 'Internal Port End', put in 23. Select the 'Protocol' to 'TCP/UDP'.


     Next click on 'Apply/Save' to save your settings.


    Next is to configure a static local IP address for you computer, this is done by configuring the DHCP of your router to give the same local IP address for your network card.

    You should look for something like 'DHCP', 'LAN settings'. For my router it is called 'LAN' under the 'Advanced Settings'.


     At the LAN settings page, there is an option for me to assign static IP address for my network card.


     You should leave everything as it as, and click 'Add Entries'

    You'll be presented with something like 'Static DHCP IP lease', and you'll have to enter your MAC address and desired IP address.

    To get your MAC address, launch a command prompt by clicking on start and type 'CMD' and press enter.

    Then a command prompt appears. At the command prompt, type in 'ipconfig /all' and press enter.


    You should see a lot of things scrolling. Look for the MAC address of your network card. If you use cable, look for it under the 'Ethernet adapter Local Area Connection', if you're using wireless, look for it under the 'Wireless LAN adapter Wireless Network Connection'. The 'Physical Address' the MAC address.


    Key in the MAC address from the command prompt, and the IP address as '192.168.1.254'

    When you're done click on 'Save' to save your settings. And you should see your entry.

     Now unplug and replug your LAN cable (disconnect and reconnect if you're using wireless).

    We will now check if your FTP server is accessible from the internet. You can do that by going to http://canyouseeme.org

    Enter '21' at the 'What Port?' field.

    And click 'Check Your Port' and you should see this.

    If it's a success, it means that your ftp server is already public, your friends or anybody can access your ftp server from anywhere in the world.

    However, you wouldn't want to give your friends a variable and cryptic IP address such as 115.135.65.128, so you have to setup a Dynamic DNS. Dynamic DNS makes hard to remember IP addresses to static and easier to remember URL.

    To set up dynamic DNS, it involves a DNS provider and your router which will update the DNS provider about the current IP address. 

    Firstly, go to http://dlinkddns.com and create an account for yourself. Once logged in, click on 'Add Host'.


    Then create a desired URL for your dynamic DNS. Copy paste the Browser IP address to the 'New IP addres field'. Click 'Save' when you're done.



    Go back to your router configuration page, and look for something called 'DNS' or 'Dynamic DNS'. For me it's under the 'DNS'.


    Click 'Add' to add an entry.

    At the Dynamic DNS config page, select your DDNS provider as 'dyndns,org', or 'dlinkddns.com'. They are the same for the two. Enter the URL you created earlier to the hostname field (without www and http:// prefix), and supply it with the credentials you used for the account you created at dlinkddns.com.

    Click on 'Save' when you're done. You should see your entry.

     You're almost done. Just reboot your router through the config page.

    To access your ftp server from the outside, just type in 'ftp://[YOUR URL HERE].dlinkddns.com' into a browser's address bar or the address bar of 'My Computer'.



    Continue reading »
  3. "The User Profile Service failed the logon. User profile cannot be loaded" [SOLVED]

    This problem usually happens when you do a partial OS recovery on your computer or did not configure Windows properly during first boot, or as in the case when temporary user profile is disallowed in group policy.

    If you have another Administrator account that you can log into, go here http://support.microsoft.com/kb/947215 and follow the instructions.

    If you have a fresh install or fresh recovery of Windows 7 or Vista, try these steps.
    1. Restart your computer and press F8 continuously until you reach the Advanced Boot Options. If you see the Windows boot logo instead, repeat this step.
    2. Choose "Safe mode with Command Prompt" and press enter, and try to login.
    3. If you can login, a command prompt should appear, type

    net user administrator password /active:yes

    4. You should see "The command completed successfully", an administrator account with password "password" is created. Reboot your computer by typing

    shutdown -r -t 0

    5. After the reboot, login using administrator account, then try fixing your account using Method 1 from instructions here http://support.microsoft.com/kb/947215

    When you do a partial recovery (reverting the OS to factory state while preserving user data), the recovery tend leave some bits of old data and may result the inconsistency in user profile.

    When I tried to do a partial recovery using the OEM recovery manager, I faced this problem and tried to rectify the problem by doing the regedit method, but I did not have the .BAK or .BK entries. Thought about dumping that corrupted account and use the newly created account, but the new account is pretty broken anyway because that account is a what Windows define as default account and I cannot do any changes to it. So in the end I backed up everything to a second partition and did a full recovery, after that no more problem.
    Continue reading »
techteendaily One Line Description Avatar Logo a one place stopshop for some of your tech needs. Though this blog is not updated frequently, but it's information are still meant to be usable and feasible. As the blogger is a lazy person, and also there are no audience at the moment, so maintainence is kept to the lowest priority. If you want this blog to come alive, PLEASE TELL ME and POST COMMENTS to let me know that you care.