Step 1 - Obtaining OpenBSD
There are 3 popular methods for obtaining OpenBSD:
- Purchase a hard copy - Show your support for the open source community and keep the OBSD project going.
- Using OpenBSD's ftp installer - This tutorial explains the ftp installation and requires an online connection.
- Using the OpenBSD 4.3 ISO image - The ISO image will contain the entire OS (including sets).
Purchasing a hard copy of OpenBSD will get you the entire OS, along with the source code, installation instructions and other miscellaneous things on 3 CDs. But if you are a first time user just download the installer and take OpenBSD out for a test drive before you decide to buy.
Step 2 - Installation Program
In order to remote install OpenBSD an installation program from openbsd.org will be used. This installation program will be loaded onto a computer using either a floppy disk or CD-R, the CD-R being created by an ISO image.
There are different ISO images and floppy files for laptops, servers and desktop PCs. Go here to determine which file is right for you.
Note: The entire OpenBSD 4.3 installation (including sets) will be packaged as a single ISO image (install43.iso) and will be made available for download on the OpenBSD ftp servers and mirrors.If you have a fast connection I recommend downloading the install43.iso file (202 megs in size). Using this file for an install will contain all installation sets and WILL NOT require an internet connection.
If you are using a desktop PC you will more than likely use one of these:
Floppy file for desktop PCs (remote install): ftp://ftp.openbsd.org/pub/OpenBSD/4.3/i386/floppy43.fs
CD-R image for desktop PCs (remote install): ftp://ftp.openbsd.org/pub/OpenBSD/4.3/i386/cd43.iso
CD-R install image for desktop PCs (local install): ftp://ftp.openbsd.org/pub/OpenBSD/4.3/i386/install43.iso
I will not go into detail on the proper way to copy these files to a floppy or CD-R so they are bootable. But briefly:
To create a bootable floppy disk using Windows XP (NTFS) you will need the program, ntrw.exe.
Create the floppy with the following command format: ntrw <image file> <floppy drive>
So at a command prompt (DOS prompt) type: ntrw floppy43.fs a:
To create a bootable floppy disk using Linux use the following command: cp floppy43.fs /dev/fd0
To create a bootable CD-R from an ISO image with Windows XP a tutorial can be found here.
To create a bootable CD-R from an ISO image with Linux a tutorial can be found here.
Note: If you are a Linux user and have downloaded an entire Linux distro on a set of ISOs (such as Fedora and Slackware) then you will notice the bootable ISO for OpenBSD (cd43.iso) is different. The OpenBSD ISO is 4 megs in size and acts as an installation program that will go on-line to download the entire operating system after the initial system setup.Step 3 - Starting The Remote Installation
Okay now we have either a bootable floppy disk or a bootable CD-R which contains the installation program.
You should also remember to have your computer connected on-line unless the OpenBSD sets are located locally. This connection will be configured during the installation process in order to do a remote install.
Boot your computer up using the install floppy or CD-R.
The screen below starts after the boot process and shows the start of the installation program, red text is user input:
erase ^?, werase ^W, kill ^U, intr ^C, status ^T (I)nstall, (U)pgrade or (S)hell? i Welcome to the OpenBSD/i386 4.3 install program. This program will help you install OpenBSD. At any prompt except password prompts you can escape to a shell by typing '!'. Default answers are shown in []'s and are selected by pressing RETURN. At any time you can exit this program by pressing Control-C, but exiting during an install can leave your system in an inconsistent state. Terminal type: [vt220] <enter> kbd(8) mapping? ('L' for list) [none] <enter> IS YOUR DATA BACKED UP? As with anything that modifies disk contents, this program can cause SIGNIFICANT data loss. It is often helpful to have the installation notes handy. For complex disk configurations, relevant disk hardware manuals and a calculator are useful. Proceed with install? [no] yes Cool! Let's get to it. You will now initialize the disk(s) that OpenBSD will use. To enable all available security features you should configure the disk(s) to allow the creation of separate filesystems for /, /tmp, /var, /usr, and /home. Available disks are: wd0. Which one is the root disk? (or done) [wd0] <enter> Do you want to use *all* of wd0 for OpenBSD? [no] yes Putting all of wd0 into an active OpenBSD MBR partion (type 'A6')...done. You will now create an OpenBSD disklabel inside the OpenBSD MBR partition. The disklabel defines how OpenBSD splits up the MBR partition into OpenBSD partitions in which filesystems and swap space are created. The offsets used in the disklabel are ABSOLUTE, i.e. relative to the start of the disk, NOT the start of the OpenBSD MBR partition. # Inside MBR partition 3: type A6 start 63 size 80292807 Treating sectors 63-80292870 as the OpenBSD portion of the disk. You can use the 'b' command to change this.
Step 4 - Partitioning
Looking at the table below, notice that my hard drive is already sliced up into 3 partitions (partition C is not counted).
Initial label editor (enter '?' for help at any prompt)
> p g
device: /dev/rwd0c
type: ESDI
disk: ESDI/IDE disk
label: Maxtor 2F040L0
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 16383
total bytes: 38.3G
free bytes: 0.2G
rpm: 3600
16 partitions:
# size offset fstype [fsize bsize cpg]
a: 5.0G 0.0G 4.3BSD 2048 16384 328
b: 0.2G 5.0G swap
c: 38.3G 0.0G unused 0 0
d: 5.0G 5.2G 4.3BSD 2048 16384 328At this point I'm going to delete all partitions (except for partition C, which represents the entire disk) for a clean install. Remember that this type of installation will erase any information already on the hard drive.
> d a > d b > d d > p g device: /dev/rwd0c type: ESDI disk: ESDI/IDE disk label: Maxtor 2F040L0 bytes/sector: 512 sectors/track: 63 tracks/cylinder: 16 sectors/cylinder: 1008 cylinders: 16383 total bytes: 38.3G free bytes: 38.3G rpm: 3600 16 partitions: # size offset fstype [fsize bsize cpg] c: 38.3G 0.0G unused 0 0
Now let's create the partitions that will be used to install OpenBSD. Remembering that partition C can not be deleted or modified since it's a representation of the entire disk only. Also, partition B will always be assigned as the swap partition.
> a a offset: [63] <enter> size: [80292807] 10g Rounding to nearest cylinder: 20971377 FS type: [4.3BSD] <enter> mount point: [none] / > a b offset: [20971440] <enter> size: [59321430] 1.1g Rounding to nearest cylinder: 2307312 FS type: [swap] <enter> > a d offset: [23278752] <enter> size: [57014118] 2g Rounding to nearest cylinder: 4194288 FS type: [4.3BSD] <enter> mount point: [none] /tmp > a e offset: [27473040] <enter> size: [52819830] 6g Rounding to nearest cylinder: 12582864 FS type: [4.3BSD] <enter> mount point: [none] /var > a g offset: [40055904] <enter> size: [40236966] 10g Rounding to nearest cylinder: 20971440 FS type: [4.3BSD] <enter> mount point: [none] /usr > a h offset: [61027344] <enter> size: [19265526] 9g Rounding to nearest cylinder: 18874800 FS type: [4.3BSD] <enter> mount point: [none] /home > w > q No label changes. Mount point for wd0d (size=2097144k)? (or 'none' or 'done') [/tmp] <enter> Mount point for wd0e (size=6291432k)? (or 'none' or 'done') [/var] <enter> Mount point for wd0g (size=10485720k)? (or 'none' or 'done') [/usr] <enter> Mount point for wd0h (size=9437400k)? (or 'none' or 'done') [/home] <enter> Mount point for wd0d (size=2097144k)? (or 'none' or 'done') [/tmp] done No more disks to initialize. OpenBSD filesystems: wd0a / wd0d /tmp wd0e /var wd0g /usr wd0h /home The next step *DESTROYS* all existing data on these partitions! Are you really sure that you're ready to proceed? [no] yes /dev/rwd0a: 20971376 sectors in 20805 cylinders of 16 tracks, 63 sectors 10239.9MB in 64 cyl groups (328 c/g, 161.44MB/g, 20608 i/g) /dev/rwd0d: 4194288 sectors in 4161 cylinders of 16 tracks, 63 sectors 2048.0MB in 13 cyl groups (328 c/g, 161.44MB/g, 20608 i/g) /dev/rwd0e: 12582864 sectors in 12483 cylinders of 16 tracks, 63 sectors 6144.0MB in 39 cyl groups (328 c/g, 161.44MB/g, 20608 i/g) /dev/rwd0g: 20971440 sectors in 20805 cylinders of 16 tracks, 63 sectors 10240.0MB in 64 cyl groups (328 c/g, 161.44MB/g, 20608 i/g) /dev/rwd0h: 18874800 sectors in 18725 cylinders of 16 tracks, 63 sectors 9216.2MB in 58 cyl groups (328 c/g, 161.44MB/g, 20608 i/g) /dev/wd0a on /mnt type ffs(rw, asynchronous, local, ctime=Wed Nov 1 01:47:50 2006) /dev/wd0h on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Wed Nov 1 01:47:50 2006) /dev/wd0d on /mnt/tmp type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Wed Nov 1 01:47:50 2006) /dev/wd0g on /mnt/usr type ffs (rw, asynchronous, local, nodev, ctime=Wed Nov 1 01:47:50 2006) /dev/wd0e on /mnt/var type ffs (rw, asynchronous, local, nodev, nosuid, ctime=Wed Nov 1 01:47:50 2006)
Step 5 - Network Configuration
My computers are connected to a Linksys router (192.168.1.1), the router is connected to a DOCSIS cable modem and why I'm using Class C IP addressing. Your setup will vary here but this is a typical configuration for any network connection, so you shouldn't have any problems figuring things out.
System hostname (short form, e.g. 'foo'): home Configure the network? [yes] <enter> Available interfaces are: fxp0. Which one do you wish to initialize? (or 'done') [fxp0] <enter> Symbolic (host) name for fxp0? [home] <enter> The media options for fxp0 are currently media: Ethernet autoselect (100baseTX full-duplex) Do you want to change the media options? [no] <enter> IPv4 address for fxp0? (or 'none' or 'dhcp') 192.168.1.7 Netmask? [255.255.255.0] <enter> IPv6 address for fxp0? (or 'rtsol' or 'none') [none] <enter> No more interfaces to initilaize. DNS domain name? (e.g. 'bar.com') [my.domain] openbsd101 DNS nameserver? (IP address or 'none') [none] <enter your nameserver IP address> Use the nameserver now? [yes] <enter> Default IPv4 route? (IP address, 'dhcp' or 'none') 192.168.1.1 add net default: gateway 192.168.1.1 Edit hosts with ed? [no] <enter> Do you want to do any manual network configuration? [no] <enter> Password for root account? (will not echo) ILikeMonkeys Password for root account? (again) ILikeMonkeys
Step 6 - Retrieval Of Sets
Now I'm asked where the installer should find the sets or "parts" of the operating system. There are several locations to pick from, so I've decided to get the sets from a remote FTP server.
Note: If you're installing using the ISO install method (install43.iso) then for the 'Location of Sets' question you will need to select 'cd' (the default).Let's install the sets! Location of sets? (cd disk ftp http or 'done') [cd] ftp HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] <enter> Display the list of known ftp servers? [no] yes Getting the list from 129.128.5.191 (ftp.openbsd.org)...
At this point a list of FTP servers will be displayed, pick a server near you, which will obviously speed up your download time. Next the installer asks me what sets I want to install.
Server? (IP address, hostname, list# or 'done') [q] 5 Using ftp5.usa.openbsd.org/pub/OpenBSD Redwood City, CA, USA Server? (IP address, hostname , list#, 'done' or '?') [ftp5.usa.openbsd.org] <enter> Does the server support passive mode ftp? [yes] <enter> Server directory? [pub/OpenBSD/4.3/i386] <enter> Login? [anonymous] <enter> Select sets by entering a set name, a file name pattern or 'all'. De-select sets by prepending a '-' to the set name, file name pattern or 'all'. Selected sets are labelled '[X]'. [X] bsd [X] bsd.rd [ ] bsd.mp [X] base43.tgz [X] etc43.tgz [X] misc43.tgz [X] comp43.tgz [X] man43.tgz [X] game43.tgz [ ] xbase43.tgz [ ] xetc43.tgz [ ] xshare43.tgz [ ] xfont43.tgz [ ] xserv43.tgz Set name? (or 'done') [bsd.mp] all [X] bsd [X] bsd.rd [X] bsd.mp [X] base43.tgz [X] etc43.tgz [X] misc43.tgz [X] comp43.tgz [X] man43.tgz [X] game43.tgz [X] xbase43.tgz [X] xetc43.tgz [X] xshare43.tgz [X] xfont43.tgz [X] xserv43.tgz Set name? (or 'done') [done] <enter> Ready to install sets? [yes] <enter> Getting bsd ... 100% |**************************************************| 5972 KB 00:26 Getting bsd.rd ... 100% |**************************************************| 4887 KB 00:25 Getting bsd.mp ... 100% |**************************************************| 6020 KB 00:23 Getting base43.tgz ... 100% |**************************************************| 41437 KB 02:39 Getting etc43.tgz ... 100% |**************************************************| 1210 KB 00:08 Getting misc43.tgz ... 100% |**************************************************| 2238 KB 00:14 Getting comp43.tgz ... 100% |**************************************************| 76666 KB 01:36 Getting man43.tgz ... 100% |**************************************************| 7473 KB 00:30 Getting game43.tgz ... 100% |**************************************************| 2548 KB 00:12 Getting xbase43.tgz ... 100% |**************************************************| 10344 KB 00:51 Getting xetc43.tgz ... 100% |**************************************************| 90772 00:03 Getting xshare43.tgz ... 100% |**************************************************| 2024 KB 00:10 Getting xfont43.tgz ... 100% |**************************************************| 32456 KB 02:41 Getting xserv43.tgz ... 100% |**************************************************| 19365 KB 01:26 Location of sets? (cd disk ftp http or 'done') [done] <enter>
Total time was just under 12 minutes for a 208 meg download. Making me appreciate cable modems more and more. And now we finalize the installation:
Start sshd(8) by default? [yes] <enter> Start ntpd(8) by default? [no] yes Do you expect to run the X Window System? [no] yes Change the default console to com0? [no] <enter> Saving configuration files...done. Generating initial host.random file...done. What timezone are you in? ('?' for list) [Canada/Mountain] America/Los_Angeles Setting local timezone to 'America/Los_Angeles'...done. Making all device nodes...done. Installing boot block... boot: /mnt/boot proto: /usr/mdec/biosboot device: /dev/rwd0c /usr/mdec/biosboot: entry point 0 proto bootblock size 512 /mnt/boot is 3 blocks x 16384 bytes fs block shift 2; part offset 63; inode block 24, offset 1704 using MBR partition 3: type 166 (0xa6) offset 63 (0x3f) done. CONGRATULATIONS! Your OpenBSD install has been successfully completed! To boot the new system, enter halt at the command prompt. Once the system has halted, reset the machine and boot from the disk. # halt syncing disks... done The operating system has halted. Please press any key to reboot.
Remove the bootable floppy disk or bootable CD-R, then reboot. Have fun and enjoy.
If you notice any errors, please let me know.
Other OpenBSD Tutorials
- Tips & Tricks - suggestions and configurations
- Patching - patching and kernel building