Archive for the 'Linux' Category

The AskApache blog has a great comprehensive guide to .htaccess. A must read for anyone who does a lot of work with Apache.

http://www.askapache.com/htaccess/apache-htaccess.html

Wow - I get so frustrated when I try to copy some files over old ones and I get:

[root@server1 wordpress]# cp -Rf * ../public_html/
cp: overwrite `../public_html/license.txt'? y

-R is recursive, but -f is supposed to copy over without confirmation. What could it be?!

Check out your alias command using ‘alias’:

[root@server1 wordpress]# alias
alias cp='cp -i'

Sure enough - alias is set on Redhat Based systems into -i, or interactive mode. Remove this alias with ‘unalias cp’ and it will be removed.

Happy copying!

In case you were wondering, I just invented the phrase PVPN - Personal Virtual Private Network.

I use Hamachi to connect my work, home and laptop PCs and I’ve found it invaluable over the past few years for a number of reasons. Music over VPN, Remote Desktop/VNC over VPN, and more. So now, I’d like to join my N800 to this growing network to make easy and secure access and file transfer wherever I am connected.

Fortunately the folks at Logmein have compiled a client for the N770, and this also works on OS2008 on the N800 (Let me know on the N810).

This is an alternate take on the wiki article at Logmeinwiki.

Note: For the commands below I will have assumed that you have already installed the openssh server so you can access the N800 via an SSH client with root access. You can also use the built in Xterm and gainroot but it is a pain in the ass typing all of those commands in via the touchpad. If you are using gainroot some of the directories below will change, for example Hamachi will install in /home/user/.hamachi instead of /root/.hamachi. Also I downloaded the client to my memory card in /media/mmc2/ but you can put it anywhere.

Your login should look like this:

BusyBox v1.6.1 (2007-09-27 18:08:59 EEST) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

Nokia-N800-51-3:~#

Make sure wget is installed:

apt-get install wget

Make to get the latest Logmein Client from http://files.hamachi.cc/linux/nokia-770/.

Just follow my process below for installing the Hamachi client and joining your network.

Nokia-N800-51-3:/media/mmc2/tmp# wget http://files.hamachi.cc/linux/nokia-770/hamachi-0.9.9.9-20-lnx-n770.tar.gz
--10:31:47-- http://files.hamachi.cc/linux/nokia-770/hamachi-0.9.9.9-20-lnx-n770.tar.gz
= `hamachi-0.9.9.9-20-lnx-n770.tar.gz'
Resolving files.hamachi.cc... 72.5.76.16
Connecting to files.hamachi.cc|72.5.76.16|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 116,020 (113K) [text/plain]

100%[==========] 116,020 256.95K/s

10:31:48 (256.33 KB/s) - `hamachi-0.9.9.9-20-lnx-n770.tar.gz' saved [116020/116020]

Nokia-N800-51-3:/media/mmc2/tmp# tar zxvf hamachi-0.9.9.9-20-lnx-n770.tar.gz
hamachi-n770-0.9.9.9-20/
hamachi-n770-0.9.9.9-20/LICENSE
hamachi-n770-0.9.9.9-20/README
hamachi-n770-0.9.9.9-20/LICENSE.tuncfg
hamachi-n770-0.9.9.9-20/LICENSE.openssh
hamachi-n770-0.9.9.9-20/LICENSE.openssl
hamachi-n770-0.9.9.9-20/hamachi
hamachi-n770-0.9.9.9-20/tuncfg/
hamachi-n770-0.9.9.9-20/tuncfg/Makefile
hamachi-n770-0.9.9.9-20/tuncfg/tuncfg.c
hamachi-n770-0.9.9.9-20/tuncfg/tuncfg
hamachi-n770-0.9.9.9-20/CHANGES
hamachi-n770-0.9.9.9-20/install
Nokia-N800-51-3:/media/mmc2/tmp# cd hamachi-n770-0.9.9.9-20/
Nokia-N800-51-3:/media/mmc2/tmp/hamachi-n770-0.9.9.9-20# sh install

install: line 7: HAMACHI_DST: not found
Copying hamachi into ..
Creating hamachi-init symlink ..
Copying tuncfg into /sbin ..

Hamachi is installed. See README for what to do next.

Nokia-N800-51-3:/media/mmc2/tmp/hamachi-n770-0.9.9.9-20#
Nokia-N800-51-3:/media/mmc2/tmp/hamachi-n770-0.9.9.9-20# cd
Nokia-N800-51-3:~# tuncfg
Nokia-N800-51-3:~# hamachi-init
Initializing Hamachi configuration (/root/.hamachi). Please wait ..

generating 2048-bit RSA keypair .. ok
making /root/.hamachi directory .. ok
saving /root/.hamachi/client.pub .. ok
saving /root/.hamachi/client.pri .. ok
saving /root/.hamachi/state .. ok

Authentication information has been created. Hamachi can now be started with
'hamachi start' command and then brought online with 'hamachi login'.
Nokia-N800-51-3:~# hamachi start
Starting Hamachi hamachi-lnx-n770-0.9.9.9-20 .. ok
Nokia-N800-51-3:~#

Hamachi is now running on our little tablet!

But it has not joined our network at this point, so we follow the logmein Hamachi documentation to do so.

Nokia-N800-51-3:~# hamachi set-nick DaveN800
Setting nickname .. ok
Nokia-N800-51-3:~# hamachi login
Logging in ....>....... ok
Nokia-N800-51-3:~# hamachi join YourNetwork
Password:
Joining YourNetwork .. ok
Nokia-N800-51-3:~# hamachi go-online YourNetwork
Going online in YourNetwork .. ok
Nokia-N800-51-3:~#

And now…checking other Hamachi clients, shows our little device is online!

hamachi on n800

Now we need to tell our tablet to put hamachi online whenever we restart the system and also set the keepalive lower.

To lower the keepalive:

Nokia-N800-51-3:~/.hamachi# echo "KeepAlive 20" >> ~/.hamachi/config

This is all great, and you should be online now. But you would need to start Hamachi on every reboot which isn't going to cut it. We will add the Hamachi start process to the init scripts. Add the following lines to the file '/etc/init.d/rcS' right before the line which says 'exit 0'

<code>/sbin/tuncfg;/usr/bin/hamachi -c /root/.hamachi start

In order to do this, use VI.

vi /etc/init.d/rcS

  • Press capitol ‘G‘ to scroll to bottom of the file
  • type ‘i‘ to enter insert mode
  • hit up a few times to a blank line before exit 0, or hit enter at the beginning of the line to create a new line.
  • Paste the above line into the file
  • Press “esc” using the special xterm button, or hit escape if you are using ssh.
  • type “:wq!” — this command enters the command, mode, tells it to write the file, then quit and execute

That should be all you need! Power off the N800 and power it back up. After restarting your N800 you should see it connect to your PVPN Hamachi network and be online!

Let me know if you have any problems or comments about the above installation procedure!

Adding swap space is pretty easy. This will add more, but slower ram; helping you when dealing with large files. In general, linux likes to have twice the amount of swap space as RAM. Since the N800 has 128M memory, I’m adding 256M. We’ll see how this perform in the long run.

Before, no swap in use:

Nokia-N800-51-3:~# free
total used free shared buffers
Mem: 126828 87248 39580 0 1012
Swap: 0 0 0
Total: 126828 87248 39580

Performing commands to add swap file and use it on reboots:

Nokia-N800-51-3:~# cd /media/mmc2/
Nokia-N800-51-3:/media/mmc2# dd if=/dev/zero of=./.swap bs=1024 count=262144
262144+0 records in
262144+0 records out
Nokia-N800-51-3:/media/mmc2# mkswap /media/mmc2/.swap
Setting up swapspace version 1, size = 268431361 bytes
Nokia-N800-51-3:/media/mmc2# swapon /media/mmc2/.swap
Nokia-N800-51-3:/media/mmc2# echo "/media/mmc2/.swap none swap sw 0 0" >> /etc/fstab
Nokia-N800-51-3:/media/mmc2# cat /etc/fstab
rootfs / rootfs defaults,errors=remount-ro,noatime 0 0
/dev/mmcblk0p1 /media/mmc1 vfat rw,noauto,nodev,noexec,nosuid,utf8,uid=29999 0 0
/media/mmc2/.swap none swap sw 0 0
Nokia-N800-51-3:/media/mmc2# vi /etc/init.d/rcS

-- add this line before exit 0: swapon -a

Nokia-N800-51-3:/media/mmc2# reboot

Broadcast message from root (pts/0) (Sat Mar 8 17:20:49 2008):

The system is going down for reboot NOW!

Swap file is now in use:

Nokia-N800-51-3:~# free
total used free shared buffers
Mem: 126828 98020 28808 0 1044
Swap: 262136 0 262136
Total: 388964 98020 290944

Also, you can add up to 128k by going into Settings->Memory. But that is a little too easy isn’t it?

When I bought the Nokia N800 a key feature is not only the ability to surf the internet with Wifi but also to pair it with your phone via bluetooth and access the internet anywhere. have a Cingular 8525 (I guess now an AT&T 8525) which has 3G internet available, but it did not work out of the box with the N800.

To begin with some definitions, there are 2 ways that you typically connect to a phone for internet. Bluetooth DUN (Dial Up Networking) and Bluetooth PAN (Personal Area Network). Bluetooth DUN is the “old” way to connect, and some of the updates Microsoft is pushing out to their Windows Mobile devices are disabling it. Unfortunately, this is the way that the N800 uses to connect to the internet.

To fix this problem, some maemo hackers put together a package called “maemo-pan“. This package enables the ability to connect to a bluetooth PAN and use the shared internet. The announcement and directions are here. In summary:

  • Go to the system preferences and add your phone in the phone settings. Do not enter the wizard for configuring the dialup settings. PAN does not use them.
  • Start internet sharing on your phone. It depends on your phone how and where to do this. On Windows Mobile 5, open the Start menu and select “internet connection sharing” from there.
  • Make sure that Bluetooth is enabled on your internet tablet. Now open the connection dialog and you will see that there is a new connection called “Bluetooth-PAN”. Select it and you will be connected to the internet via PAN.
  • When you’re finished, just close the connection the usual way. Wasn’t this easy? :)

Now on the 8525, this didn’t work for me flat out. I was using rom named “vp3G” which was Windows Mobile 6.0 which was released before the official AT&T one. I don’t know if this was causing my problem or not. I couldn’t get the N800 to find the 8525. I could get the 8525 to find the N800 but I still could not get bluetooth pan working.

I decided to flash the 8525 to a new cooked rom, because it had been several months since I had done so. To hedge my bets, I picked a ROM that included the old Bluetooth DUN package. There is an excellent webpage with far more information than I could provide on the subject of Flashing your 8525/Hermes - see MrVanx’s ROM Flashing Guide here. I chose Schap’s WM6.1 4.40 ROM. After the flash was complete - I tried to pair the two and had much better results.

I first paired them and it seemed to take this time. After that, I click “Internet Sharing” in the Programs on the 8525 and enabled it. Then I went onto the N800 and selected “bluetooth-pan” as the type of connection. Voila - it worked! I was surfing on a nice 3G connection. So for anyone out there trying to get this work without success - keep trying! It definately works but takes some configuration.

On a side note - being able to access an internet tablet via SSH is very cool. Here is top while playing Borat:

Mem: 124908K used, 1920K free, 0K shrd, 8K buff, 39452K cached
Load average: 1.56 1.20 0.98
PID USER STATUS VSZ PPID %CPU %MEM COMMAND
1574 user RW 26000 1573 69.7 20.4 mplayer
742 root SW< 15132 331 5.5 11.9 Xomap
864 root SW< 2176 331 2.3 1.7 esd
1573 user SW 11788 1 1.1 9.2 atabake
1592 root RW 1960 1578 0.9 1.5 top
1556 user SW 24556 1 0.3 19.3 python
788 root SW< 0 6 0.3 0.0 dsp/0
594 messagebus SW< 2428 331 0.1 1.9 dbus-daemon
1018 user SW< 40840 943 0.0 32.1 maemo-launcher

If you upload those new fancy-shmancy file formats to your web server - namely .docx, .pptx and .xlsx - and you are running Apache; chances are that your web server doesn’t know how to serve those files because they are unknown file formats. Your browser may try to download them as a .zip file (IE) or just display the binary format (Firefox) which ends up looking like jibberish with some XML data.

It’s relatively easy to fix this problem, you just need to tell apache how to handle those files.

Find the file mime.types, this may be in /etc/ or in /etc/httpd/conf/.

Add the following line to this file:

application/vnd.openxmlformats docx pptx xlsx

In one line:

echo "application/vnd.openxmlformats docx pptx xlsx" >> /etc/httpd/conf/mime.types

Restart both Apache and your web browser. Clearing the cache doesn’t work (I learned the hard way :))

Your file should now be downloaded properly to your PC.

When doing a PostgreSQL database server upgrade, you first need to backup all of the databases because the format changes from version to version.

Postgresql documentation states you need to run the command:

pg_dumpall > outputfile

I ran this, and received the error message:

pg_dumpall: could not connect to database "template1": FATAL: role "root" does not exist

So after some head scratching and googling without any results; I noticed that I had created a user for postgres; namely ‘postgres’. I sued to that user and ran the command - what do you know - it works fine! I’m glad that error message was so clear.

So, the thing that the documentation does not state - make sure you are running under the Postgresql user before running the backup command.

I recently formatted my laptop and installed Windows first, using half of the hard drive, and then installing Ubuntu 7.10 on the other half. It had been a while since I tried Ubuntu - it has a come a long way - but that is another story.

The install worked fine, however at the end, it just sort of hung while installing grub. GREAT. I reboot and it kicks me to a (grub) standard prompt.

It took me a while to figure this out, but you can manually boot Ubuntu via the grub prompt. The tricky part is finding out the right commands since your system is totally inaccessible.

You can find your available hard drive name by typing:

> root ( <tab>

pressing tab will list your available hard drives and partitions and hopefully your Ubuntu ext3 partition.

Continue setting the root boot partition. This includes your partition with all /boot files. For example, mine was installed onto the root / filesystem, and not a separate filesystem.

> root (hd0,2)
>

This sets your root that grub uses.

You then need to set the kernel. Use:

> kernel /boot/vmlin <tab>

Tab will show you the available files to use. Also you can use this at any level to explore your filesystem. So for example:

> kernel /boot/vmlinuz-2.6.15-20-386

But wait before you hit enter!

You will get a pivot root error - the kernel doesn’t know where the rest of your file system is. In a file called device.map in your /boot directory, this location should be specified. In my case, it is listed as /dev/sda3. This is important for your kernel. Fortunately, GRUB has a ‘cat’ command you use to get the text output of this file. We also set this to a read-only filesystem - Ubuntu takes care of setting it back to rw when it boots.

So the final kernel line is:

> kernel /boot/vmlinuz-2.6.15-20-386 root=/dev/sda3 ro
>

Now we need to set the initrd file - hopefully you by now know to use to find this if you do not know it off of the top of your head:

> initrd /initrd.img-2.6.15-20-386
>

And finally, type ‘boot’ to begin the boot process:

> boot

Hopefully ubuntu will boot for you now without problems. Again, if you get a pivot root or ‘unable to mount root VFS’ error - you need to check the root=/dev/sda3 line part of the grub commands. This means that the kernel could not find your main filesystem.

Once you are logged into Ubuntu - use the following command to regenerate menu.lst for you. Once this is rebuilt, you will be presented with the normal Grub menu and you won’t need to follow the process above!

sudo update-grub

If you need to compile ffmpeg for PHP (for example, to allow PHP to process video similar to how YouTube does) - then follow this Howto from Nazly. For a CentOS machine with custom PHP, it works great.

Ffmpeg PHP Extension Compile Instructions

The technology has been around for a while to do unattended OS installs, using kickstart on redhat for example. These installs are typically done remotely. Kickstart is basically done off of an image file, which can be inserted via a floppy, CD, or now a USB Keychain drive.

datacenter-web.jpg

Another technology that has been around a while is pxeboot. Using pxeboot, you can boot images directly from a supported network card. Most network cards have a built in bootp interface. The network card first looks for a bootp (aka dhcp) server to assign an IP address and load an image. It then uses the trivial ftp protocol to look for a boot image, called pxelinux. Then pxelinux loads the correct installer image. So the process looks like this:
Power on->Boot from Network->Bootp->Tftp->pxelinux->Boot Image Loads
After loading the boot image, the system is on its own as far as doing the install. Best of all, this means that as long as the OS has an unattended boot image, it can be loaded from this method. For anyone running a datacenter, this is excellent! It provides a way to do these installs from the next city, the next state, or even halfway across the world!

Setting up the bootp server

fot80-web-1nato-boot.jpg

The bootp protocol is supported in Redhat’s (and I imagine others) dhcp server.

For this exercise, I am going to assume you are using yum. But, you can do these installs the same with sudo apt-get install or installing the rpms/debs manually.

First, install dhcpd:
yum install dhcpd
Then setup the dhcp server
# vi /etc/dhcpd.conf

ddns-update-style interim;
# deny unknown-clients;
not authoritative;

option domain-name "ks.domain.com";
option domain-name-servers 10.0.2.1;
option subnet-mask 255.255.255.0;

allow bootp;
allow booting;

option ip-forwarding false; # No IP forwarding
option mask-supplier false; # Don't respond to ICMP Mask req

option subnet-mask 255.255.255.0;
option broadcast-address 10.0.2.255;
option routers 10.0.2.1;
option domain-name-servers 10.0.2.2;
option netbios-name-servers 10.0.2.2;

subnet 10.0.2.0 netmask 255.255.255.0 {
option routers 10.0.2.1;
range 10.0.2.10 10.0.2.100;
authoritative;
allow unknown-clients;
next-server 10.0.2.2; # name of your TFTP server
filename "pxelinux.0"; # name of the bootloader program
}

group {
next-server 10.0.2.2; # name of your TFTP server
filename "pxelinux.0"; # name of the bootloader program
}

You can see from this code that we are setting up the install network on the 10.0.2.x private network.

The image filename the dhcp server tells the network card to boot off is pxelinux.0.

TFTP Server

The TFTP server is necessary to grab the initial image files from. I recommend either tftp-hpa for linux, or tftpd32 for Windows. For the rest of this article, I will assume that you are using tftp-hpa on linux.

After compiling tftp-hpa from source, enable it adding/editing /etc/xinet.d/tftp like so:

service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}

Restart xinetd. The tftp server is now serving files from /tftpboot/

PXELinux

PXELinux is a software package from H. Peter Anvin. It loads other OS images from its initial boot interface. See his site for more information on this powerful package. Download the pxelinux package and extract pxelinux.0 to /tftpboot/. Then create the directory /tftpboot/pxelinux.cfg.

When the system boots, it looks for an configuration file (similar to syslinux syntax) in the pxelinux.cfg directory. First it tries to match by the MAC address of the network card, the it goes by a hexadecimal representation of the IP address, then it loads default. for example, if the Ethernet MAC address is 88:99:AA:BB:CC:DD and the IP address 192.0.2.91, it will try (in order):

/tftpboot/pxelinux.cfg/01-88-99-aa-bb-cc-dd
/tftpboot/pxelinux.cfg/C000025B
/tftpboot/pxelinux.cfg/C000025
/tftpboot/pxelinux.cfg/C00002
/tftpboot/pxelinux.cfg/C0000
/tftpboot/pxelinux.cfg/C000
/tftpboot/pxelinux.cfg/C00
/tftpboot/pxelinux.cfg/C0
/tftpboot/pxelinux.cfg/C
/tftpboot/pxelinux.cfg/default

Notice the mac address has 01- preceeding it, and each colon is replaced by a - dash.

Now, to make sure I don’t inadvertantly install over a good os, I make sure to keep a default file in this directory with the following contents:

default linux
label linux
localboot 0

This tells the system to boot off of the hard drive.

A CentOS Remote install

centos1.png

CentOS is one of the easier OSes to install via this method. I will use this for an example during this article.

We first need a CentOS image to boot from and use for the install image. Lets put this image in the tftpboot directory in a location called images/CentOS/4.4_i386. Rsync is a good choice to use, but you can really use anything you want to transfer the image (off of a CD for example). Here is a set of commands that works for me:

mkdir -p /tftpboot/images/CentOS/4.4_i386
cd /tftpboot/images/CentOS/
rsync -r rsync://mirror.linux.duke.edu::centos/centos/4.4/os/i386 4.4_i386

Then copy the boot images from the CentOS directory to the tftpboot directory:

cd /tftpboot/
cp /tftpboot/images/CentOS/4.4_i386/i386/isolinux/initrd.img initrd_centos_4.4.img
cp /tftpboot/images/CentOS/4.4_i386/i386/isolinux/vmlinuz vmlinuz_centos_4.4

Its ok to leave those guys alone. If you would ever need to update them to include other drivers, you can do so but that is beyond the scope of this article.

Lets create a /tftpboot/Kickstart/ks.cfg file now:

lang en_US
langsupport en_US
keyboard us
mouse none --device null

#important - where to load the images from
network --device=eth0 --bootproto dhcp --hostname ks.hostname.com
nfs --server 10.0.2.2 --dir /tftpboot/images/CentOS/4.4_i386

rootpw changeme
firewall --disabled
authconfig --enableshadow --enablemd5
timezone --utc America/NewYork
bootloader
reboot

# clears the master boot record and all partitions on the hard drive
zerombr yes
clearpart --all

# creates your partitions.
part /boot --fstype ext3 --size=300 --ondisk=sda
part /tmp --fstype ext3 --size=2000 --ondisk=sda
part / --fstype ext3 --size=2000 --grow --ondisk=sda
part swap --fstype swap --size=2000 --ondisk=sda

%packages --resolvedeps
@ legacy-network-server
@ legacy-software-development
@ server-cfg
@ system-tools
@ network-server
@ editors
@ admin-tools
@ text-internet
mdadm
kernel
grub
e2fsprogs
expect
ncompress

%post
rpm --import /usr/share/doc/centos-release-4/RPM-GPG-KEY-centos4
echo "co:2345:respawn:/sbin/agetty -h -t 60 ttyS0 9600 vt102" >> /etc/inittab
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

For a comprehensive guide on the options for this file, check out the Redhat 9 Kickstart options HOWTO which is still good for our purposes.

In the above code we are loading the OS from a nfs share.

If nfs is not installed you’ll need to do that first:

yum install nfs
chkconfig nfs on

Add the following line to /etc/exports

/tftpboot 10.0.2.0/255.255.255.0(sync)

Start up nfs

service nfs start

Putting it all together

Now, lets use the above to put this automated installer to work!

You’ll need to set up your hardware on the network along with the installation system. You’ll need to set up the boot order to let the machine boot off the network firstly; then HD, CD or floppy next. If it boots to the disk first, the machine will never contact the automated installer and will just try (and fail, if the HD is blank) to boot off the the HD.

You will also need to mark down the MAC Address of the network card the server will be booting off of. This will be retrieved from the actual hardware; off of the boot menu; or as a last resort you can boot it off of your DHCP server and then check the log for when this server hits the installer machine.

Lets create our pxelinux boot file. It should be named based off of the Ethernet MAC Address. For example: /tftpboot/pxelinux.cfg/01-88-99-aa-bb-cc-dd

Note that the mac address has an 01 in the very beginning of it; sometimes this is not included when you write down the mac address of the system.

default linux
serial 0,9600n8
label linux
kernel vmlinuz_centos_4.4
append ksdevice=eth0 console=tty0 console=ttyS0,9600n8 load_ramdisk=1 initrd=initrd_centos_4.4.img network ks=nfs:10.0.2.2:/tftpboot/Kickstart/ks.cfg

You may have noticed that this file specifies a few things. The initrd and vmlinuz files we copied, handle the kickstart of the image. /tftpboot/Kickstart/ks.cfg is the kickstart configuration file and is needed to do the actual unattended install. If you do not need remote serial console access during this install, you should remove the string “console=ttyS0,9600n8″ which simply adds output to the serial port.

That is it! Now that all of the files are set up; you can boot/power cycle the server. This is what should happen:

  1. Server boots and looks for DHCP server on its network interface. Installer server responds and assigns server an IP address
  2. Server begins looking for a pxeboot configuration for what to do. It (hopefully) finds the file /tftpboot/pxelinux.cfg/01-88-99-aa-bb-cc-dd and boots using this
  3. It loads vmlinuz_centos_4.4 and the initrd initrd_centos_4.4.img.
  4. Kickstart config is told to load from the nfs share nfs:10.0.2.2:/tftpboot/Kickstart/ks.cfg
  5. Kickstart install begins like a normal Kickstart install from a floppy or CD install

Here is a catch: After the installation starts; remove the pxeboot.cfg file. If you do not remove/move this file, when the machine reboots after the install it will just do the remote installation again, resulting in an infinite install loop.

Bonus: Windows Unattended Installation

xplogosharp.jpg

In order to perform this same process but with Windows; we use the Unattended installation system.

Follow the directions for basic installation of this system.

Once you have it installed; copy :unattended install:/linuxboot/tftpboot/* to /tftpboot/

Then create a pxeboot.cfg file with the following lines:

default unattended
label unattended
kernel bzImage
# Add options (z_user=..., z_path=..., etc.) to this line.
append initrd=initrd_unattended

The Unattended installer will then work off its own installer system; which will automatically provision Windows versions - I’ve tested 2003 but it should also work for 2000 and XP installs.

In order to customize the installs further, you can use nLite to slipstream service packs and hotfixes; as well as make other changes to the default install.

Conclusion

Using this method allows you to deploy lots of installs with minimal datacenter presence. Once you have the hardware set up and ready to go; you just need to create the pxeboot config file and power cycle the machine. This has great benefits if you are far away from the datacenter; or what to deploy a lot of machines without doing manual installs. If you have any other solutions that will automate installations in a similar manner; please let me know!

  • Welcome to systemBash, a technology and system administration blog by David Drager. If you enjoy this sort of content, can can subscribe to the RSS using the link to the right.