个人工具

UbuntuHelp:Installation/LocalNet

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 10:58的版本 (New page: {{From|https://help.ubuntu.com/community/Installation/LocalNet}} {{Languages|php5}} '''Other Languages: ComoNetbootInstall Espanol''' [new] good news! It works with Edgy Alternate and S...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


Other Languages: ComoNetbootInstall Espanol

[new] good news! It works with Edgy Alternate and Server CDs.

This is a work in progress. It is also a mix of Basic Internet Install and Local Net Install that are similar to just installing from the CD, and Hands Off Install that uses a preseed file to automate the whole thing.

sahara is the server (dhcp, tftp, http). shaz is the blank box that I am installing on.

0. Install Trivial File Transfer Protocol server and enable it (default tftp config uses inetd)
root@sahara:/ # apt-get install tftpd-hpa
root@sahara:/ # vi /etc/default/tftpd-hpa  
</code>

 0. Mount the CD (media or image) under the tftpboot dir<pre>
root@sahara:/var/lib/tftpboot/ubuntu/edgy$ mount -o loop edgy-alternate-i386.iso alternate/
</code>

 0. Setup Apache<pre>
root@sahara:~ # apt-get install apache2</code>

 0. Make a symlink from apache's doc Root to the CD<pre>
root@sahara:/var/www # ln -s /var/lib/tftpboot/ubuntu/</code>

 0. Install dhcp server.<pre> 
root@sahara:~ # apt-get install dhcp3-server
</code>

 0. Set the dhcp server to tell the clients what to boot.  I added a default host name, you don't need it but it comes in handy for other things.<pre>
root@sahara:~ # cat /etc/dhcp3/dhcpd.conf
subnet 192.168.1.0  netmask 255.255.255.0 {
        range 192.168.1.10 192.168.1.254;
         }
# put your DNS IP's here:
option domain-name-servers 192.168.1.7, 68.87.66.196 ;
filename="ubuntu/edgy/alternate/install/netboot/pxelinux.0";

root@sahara:~ # /etc/init.d/dhcp3-server restart
Stopping DHCP server: dhcpd3.
Starting DHCP server: dhcpd3.</code> 

 0. Boot up the client box, config the bios to net boot and you should get the Ubuntu screen and Boot: prompt. Yippee! 

The above steps should give you an interactive setup, very similar to if you had booted from the CD.

---
At this point in time my goal has shifted from a typical install like if you just booted from CD to a Hands Off Install where all the questions have been answered and fed to the installer as preseed.  I may get back to the interactive setup, but for now I am focused on using preseed.cfg.

----

My configs to make a Hands Off Install that does not pull anything from the internet.

Something changed in the last few weeks of dapper beta.  I was working, then I went on vaction, not it isn't.  That doesn't mean it won't work, just what I was doing before isn't working now, which is to be expected when you are working with beta.

A handfull of preseed options need to be passed via kernel options.  The kernel only supports 255 chars, so things are cramped.  To accomodate this, I dumped some of the paths and made symlinks.  That gave me just enough space for now.  Note that the path/name of the kernel gets appended, so even trimming that helped.

<pre>root@sahara:/var/lib/tftpboot # ln -s ubuntu-installer/i386/initrd.gz
root@sahara:/var/lib/tftpboot # ln -s ubuntu-installer/i386/linux</code>

/var/lib/tftpboot/pxelinux.cfg/default
<pre>
# pxelinux.cfg/default

# display u0buntu-installer/i386/boot-screens/syslinux.txt

default menu
prompt 1
timeout 150
ontimeout boothd

label menu
# makes a menu out of this file, allows editing the options on the client
        kernel menu.c32

label boothd
        # boot from the first HD
        # (this is what happens if nothing is pressed for 15 seconds)
        localboot 0

label ubuntu-breezy-normal
# ubuntu instaler
        kernel ubuntu-breezy/linux
        append vga=normal initrd=ubuntu-breezy/initrd.gz ramdisk_size=14984 root=/dev/rd/0 rw  --

label ubuntu-breezy-hands-off
# ubuntu instaler
        kernel ubuntu-breezy/linux
        append initrd=ubuntu-breezy/initrd.gz ramdisk_size=14984 root=/dev/rd/0 rw preseed/locale=en_US kbd-chooser/method=us netcfg/wireless_wep= netcfg/choose_interface=eth1 netcfg/get_hostname= preseed/url=http://192.168.1.7/preseed-breezy.cfg vga=6 --
</code>
netcfg/get_hostname= Is blank so that it will pick up the host-name supplied by the DHCP server.

netcfg/choose_interface=eth1 - for laptops, I want it to setup the wifi card, not the wired port.  Problem I am having is that some use eth1 and some wlan0.  What would be great is if the DHCP server could somehow pass this too.

note: The DHCP server can't pass it, but pretending that the MAC address of your wireless card is 12 : CD : 56 : AB : 78 : EF you can specify a custom pxelinux.cfg/01-12-dc-56-ab-78-ef (lowercase) instead. If you are using static dhcp, you can also use the IP address in hex for a per-machine or per-subnet or per-network configuration. See http://syslinux.zytor.com/pxe.php#config for more information.

Basically, say you have three wireless cards where the IP in hex translated to caf12d5e, caf12d6b, caf124ea, you could specify pxelinux.cfg/caf12d and pxelinux.cfg/caf12. The first two would match to the first config file and the third would match to the second config file.

note: this is from my new breezy installer, everything else on this page was from hoary.  

Using http://archive.ubuntu.com/ubuntu/dists/hoary/main/installer-i386/current/doc/manual/en/apcs01.html saved to /var/www/preseed.cfg, here are the important changes:
<pre>
d-i	mirror/country		string enter information manually
d-i	mirror/http/hostname	string 192.168.1.22
d-i	mirror/http/directory	string /ubuntu
d-i	mirror/suite		string hoary
d-i	mirror/http/proxy	string 
</code>


Here is my current dhcpd.conf <pre>
ping-check = 1;
log-facility local7;

option domain-name "sahara.net";
option time-servers  192.168.1.1;
option broadcast-address 192.168.1.255;

option domain-name-servers 63.240.76.4, 204.127.198.4;
option routers  192.168.1.1;

subnet 192.168.1.0  netmask 255.255.255.0 {
        range 192.168.1.10 192.168.1.254;
         }

# Hoary test boxes
group {
	filename="pxelinux.0" ;
	
	# 192.168.1.2 does not exist on my lan.
	# I am setting it like this to make sure the box doesn't find
	# a repo on the net to pull sources from.
	# It would be good I can figure out how to i
	#  limit these setting to the install phase 
	#  (including the 2nd part after the reboot )
	
	option domain-name-servers 192.168.1.2 ;
	option routers 192.168.1.2 ;

	host dwl650p { 
		hardware ethernet 00:05:5d:5a:81:f0 ; 
		option host-name "dwl650p" ; }
	
	# tsp2 6100 - a=wired, b=wifi
	host tsp2a { 
		hardware ethernet 00:00:39:fa:ff:f3 ;
		option host-name "tsp2a" ; }
	
	host tsp2b { 
		hardware ethernet 00:02:2d:b0:c8:6c ;
		option host-name "tsp2b" ; }

	host tsp1 { 
		hardware ethernet 00:00:39:88:31:a6 ; 
		option host-name "tsp1" ; }

        host e400 { 

		hardware ethernet 00:60:08:b0:62:0d ; 
		# fixed-address 192.168.1.181 ;
		option host-name "e400" ; }

       }
</code>

----
Get/run the installer from Linux.  These 4/5 commands download the insteller kernel and run it.  All you need is a functioning OS.  So if you can figure out how to get the 2 files (wget, usb stick, etc) onto the local fs (can be the ramdrive of a liveCD) and run something like kexec (or maybe LoadLin?) the installer can get the rest of the files from the Internet.

<pre>
sudo apt-get install tftp kexec-tools

wget http://us.archive.ubuntu.com/ubuntu/dists/edgy/main/installer-i386/current/images/netboot/ubuntu-installer/i386/linux
wget http://us.archive.ubuntu.com/ubuntu/dists/edgy/main/installer-i386/current/images/netboot/ubuntu-installer/i386/initrd.gz

sudo kexec --load linux --initrd=initrd.gz
sudo kexec --reset-vga --exec
</code>

----
If your box doesn't have the option to boot from lan (like one of mine) you can make a boot disk that will do that part.

http://etherboot.sourceforge.net

http://rom-o-matic.net

I am pleased to say that I was able to read, download, build, run, make the floppy in under 30 min.  

"Etherboot does not (yet) offer support for PCMCIA cards." so the older laptops will have to wait.  
----
Pile of PXE related links:

http://freshmeat.net/projects/syslinux/

http://syslinux.zytor.com/memdisk.php

http://support.3com.com/infodeli/tools/nic/mba.htm New Universal NDIS Driver for DOS

http://www.qualystem.com/en/dualboot.html

http://unattended.sourceforge.net/step-by-step.php

http://unattended.sourceforge.net/advanced.php#pxe

http://syslinux.zytor.com/archives/2003-June/002185.html

http://www.intel.com/design/network/drivers/int21143.htm

http://www.tux.org/pub/distributions/tinylinux/tomsrtbt/

http://www.winimage.com/winimage.htm

http://www.weird-solutions.com/docs/pxe_booting.pdf

http://www.weird-­solutions.com/bin/util/tftp_root.zip

 http://etherboot.sourceforge.net

http://marc.herbert.free.fr/linux/win2linstall.html Install GNU/Linux without any CD, floppy, USB-key, nor any other removable media.

http://osdev.berlios.de/netboot.html - Network-booting Your Operating System - the part I like: "...loads the GRUB, the second-stage loader, off the server." 
---
PPC Mac related links

http://www.macgeekery.com/hacks/how_to_install_debian_via_network_boot_from_a_mac

http://davespicks.com/writing/programming/mackeys.html#boot

SmartBootManagerHowto

CategoryDocumentation CategoryCleanup

[[category:UbuntuHelp]]