====== Installing MINIX 3 ======
This page describes the process of installing MINIX 3.
If you want to run MINIX 3 on a virtual machine instead of natively, see the installation page for your VM of choice before reading this page:
* [[.:runningonvmware|Running MINIX 3 on VMware]]
* [[.:runningonqemu|Running MINIX 3 on Qemu (and KVM)]]
* [[.:runningonbochs|Running MINIX 3 on Bochs]]
* [[.:runningonparallels|Running MINIX 3 on Parallels]]
* [[.:runningonvirtualbox|Running MINIX 3 on VirtualBox]]
* [[.:runningonvirtualpc|Running MINIX 3 on Microsoft VirtualPC 2007]]
===== Preparation =====
Please make sure your system meets the [[.:hardwarerequirements|Installation Requirements]] first. If you already have the CD-ROM (e.g., from the book), you can skip steps 1.1 and 1.2, but it is wise to check the [[http://www.minix3.org/download|download page]] to see if a newer version is available.
You may need to change the //Boot Order// in the BIOS so that the machine boots off the CD-ROM, as opposed to the hard disk.
==== Download the MINIX 3 CD-ROM image ====
Download the MINIX 3 CD-ROM image from the VMware.
==== Create a bootable MINIX 3 CD-ROM ====
Decompress the downloaded file. You will get a CD-ROM image file with extension //.iso//. The //.iso// file is a bit-for-bit CD-ROM image. Burn it to a CD-ROM disk to create a bootable MINIX 3 CD-ROM. Please consult your CD burning program's documentation to learn how to burn //ISO// images to CD-ROM media.
If you are running Windows and do not have a CD-ROM burning program, take a look at [[http://alexfeinman.brinkster.net/isorecorder.htm|ISO Recorder]] for a free one and use it to create a CD image.
==== Create a bootable MINIX 3 USB Memory Stick ====
Download the compressed USB image (e.g., usb_image-3.1.2a.zip) from the [[http://www.minix3.org/download|download page]] to your hard drive. Then, uncompress the USB image. Now you should "copy" the image file to your USB stick sector by sector. On Linux systems you can use the //dd// command. For windows systems you can download [[http://www.chrysocome.net/dd|DD for Windows]].
**WARNING: Please be careful when copying the image to your USB stick. If you specify the wrong output device when running //dd//, you could lose precious data. Please triple-check the arguments to the //dd// command before running it.**
On Windows you may run the following command to copy the image to your USB stick (assuming the USB stick is //f://): \\
dd if=usb_image-3.1.2a of=\\.\f: --progress
On Linux you may run the following command to copy the image to your USB stick (assuming the USB stick is ///dev/sdb//): \\
dd if=usb_image-3.1.2a of=/dev/sdb
==== Determine which Ethernet Chip you have ====
MINIX 3 supports several Ethernet chips for networking over LAN, ADSL, and cable. These include Intel Pro/100, RealTek 8029 and 8139, AMD LANCE, and several 3Com chips. During setup you will be asked which Ethernet chip you have, if any. Determine that now by looking at your system's documentation.
Alternatively, if you are using Windows, go to the device manager as follows:
Windows XP: Start > Control Panel > System > Hardware > Device Manager
Windows Vista: Start > type device > The Device Manager shows up
System requires double clicking; the rest are single. Expand the + next to "Network adapters" to see what you have. Write it down. If you do not have a supported chip, you can still run MINIX 3, but without Ethernet.
If you are running Linux, you can run the following command to find out which Ethernet card you have.
lspci | grep Ether
==== Partition your hard disk ====
You can boot the computer from your CD-ROM if you like and MINIX 3 will start, but to do anything useful, you have to create a partition for it on your hard disk. But before partitioning, be sure to **back up your data to an external medium like CD-ROM or DVD** as a safety precaution, just in case something goes wrong. Your files are valuable; protect them.
Unless you are sure you are an expert on disk partitioning with much experience, it is strongly suggested that you read the tutorial on [[.:diskpartitions|disk partitioning]]. If you already know how to manage partitions, create a contiguous chunk of free disk space of at least 200 MB, or if you want the sources, 1 GB. If you do not know how to manage partitions but have a partitioning program like //Partition Magic//, use it to create a region of free disk space. Also make sure there is at least one primary partition (i.e., Master Boot Record slot) free. The MINIX 3 setup script will guide you through creating a MINIX partition in the free space, which can be on either the first or second IDE disk.
**WARNING: If you make a mistake during disk partitioning, you can lose all the data on the disk, so be sure to back it up to CD-ROM or DVD before starting. Disk partitioning requires great care, so proceed with caution.**
===== Booting =====
By now you should have allocated some free space on your disk. If you have not done so yet, please do it now unless there is an existing partition you are willing to convert to MINIX 3.
==== Boot from the CD-ROM ====
Insert the CD-ROM into your CD-ROM drive and boot the computer from it. If the computer boots from the hard disk instead of the CD-ROM, boot again and enter the BIOS setup program to change the order of boot devices, putting the CD-ROM before the hard disk.
**NOTE: If you have problems booting from the CD-ROM, check that your BIOS is set to IDE/Legacy mode if you have SATA devices.**
==== Boot over network using PXE ====
It is possible to boot your computer over network. This requires a host and a client computer. See [[.:bootingovernetworkusingpxe|this page]].
===== Running the setup script =====
When the //login// prompt appears, login as root. Press //Enter// when prompted for a password.
To start the installation of MINIX 3 on the hard disk, type
setup
After this and all other commands, be sure to type ENTER (RETURN). When the installation script ends a screen with a colon, hit ENTER to continue. If the screen suddenly goes blank, press CTRL-F3 to select software scrolling (should only be needed on very old computers). Note that CTRL-key means depress the CTRL key and while holding it down, press "key."
===== Installing to the Hard Disk =====
These steps correspond to the steps on the screen.
==== Select keyboard type ====
When you are asked to select your national keyboard, do so. This and other steps have a default choice, in square brackets. If you agree with it, just hit ENTER. In most steps, the default is generally a good choice for beginners. The //us-swap// keyboard interchanges the CAPS LOCK and CTRL keys, as is conventional on UNIX systems.
==== Select your Ethernet chip ====
You will now be asked which (if any) of the available Ethernet drivers you want installed. Please choose the numerical option (e.g., 1) that corresponds to your driver. The setup script will then save the corresponding driver keyword (e.g., fxp) and some options in the system file ///etc/inet.conf//.
If you are running MINIX 3 in a Virtual Machine, see the following table to determine which selection to make:
|**Virtual Machine** |**NIC Selection** |
|KVM |3. Realtek 8139 based card (also emulated by KVM) |
|QEMU |5. Realtek 8029 based card (also emulated by Qemu) |
|Bochs |6. NE2000, 3com 503 or WD based card (also emulated by Bochs) |
|VMWare |7. AMD LANCE (also emulated by VMWare and VirtualBox) |
|VirtualBox |7. AMD LANCE (also emulated by VMWare and VirtualBox) |
|VirtualPC |10. DEC Tulip 21140A in VirtualPC |
The following table tells you shows all the NIC options, as well as the driver name that corresponds to each option.
|**NIC Selection** |**Corresponding Driver Name**|
| 0. No Ethernet card (no networking) |(n/a)|
| 1. Intel Pro/100 |fxp|
| 2. 3Com 501 or 3Com 509 based card |dpeth|
| 3. Realtek 8139 based card (also emulated by KVM) |rtl8139|
| 4. Realtek 8169 based card |rtl8169|
| 5. Realtek 8029 based card (also emulated by Qemu) |dp8390|
| 6. NE2000, 3com 503 or WD based card (also emulated by Bochs) |dp8390|
| 7. AMD LANCE (also emulated by VMWare and VirtualBox) |lance|
| 8. Intel PRO/1000 Gigabit |e1000 |
| 9. Attansic/Atheros L2 FastEthernet|atl2 |
|10. DEC Tulip 21140A in VirtualPC |dec21140A |
|11. Different Ethernet card (no networking) |(n/a) |
The installer says, "You can always change your mind after the setup." If you do, you will need to know the driver code above and adjust ///etc/inet.conf// by hand. Instructions are in the [[:FAQ]]. The latest details can be deduced from a close reading of the script ///bin/setup//.
==== Create or select a partition for MINIX 3 ====
You will first be asked if you are an expert in MINIX 3 disk partitioning. If so, you will be placed in the //part// program to give you full power to edit the Master Boot Record (and enough rope to hang yourself). If you are not an expert, press ENTER for the default action, which is an automated step-by-step guide to formatting a disk partition for MINIX 3.
=== Select a disk to install MINIX 3 ===
An IDE controller may have up to four disks. The setup script will now look for each one. Just ignore any error messages. When the drives are listed, select one. and confirm your choice.
If you have two hard disks and you decide to install MINIX 3 to the second one and have trouble booting from it, see [[.:installationtroubleshooting|Installation Troubleshooting]].
=== Select a disk region ===
Now choose a region to install MINIX 3 into. You have three choices:
- Select a free region
- Select a partition to overwrite
- Delete a partition to free up space and merge with adjacent free space
For choices (1) and (2), type the //region number//. For (3) type:
delete
then give the region number when asked. This region will be overwritten and its previous contents lost forever.
=== Confirm your choices ===
You have now reached the point of no return. You will be asked if you want to continue. If you do, the data in the selected region will be lost forever. If you are sure, type:
yes
and then ENTER. To exit the setup script without changing the partition table, hit //CTRL-C//.
==== Reinstall choice ====
If you chose an existing MINIX 3 partition, in this step you will be offered a choice between a Full install, which erases everything in the partition, and a Reinstall, which does not affect your existing ///home// partition. This design means that you can put your personal files on ///home// and reinstall a newer version of MINIX 3 when it is available without losing your personal files.
==== Select the size of /home ====
The selected partition will be divided into three subpartitions: //root//, ///usr//, and ///home//. The latter is for your own personal files. Specify how much of the partition should be set aside for your files. You will be asked to confirm your choice.
==== Select a block size ====
Disk block sizes of 1-KB, 2-KB, 4-KB, and 8-KB are supported, but to use a size larger than 4-KB you have to change a constant and recompile the system. If your memory is 16 MB or more, use the default (4 KB); otherwise, use 1 KB.
==== Wait for files to be copied ====
Files will be automatically copied from the CD-ROM to the hard disk. Every file will be announced as it is copied. When the copying is complete, MINIX 3 is installed. Shut the system down by typing:
shutdown
Always stop MINIX 3 this way to avoid data loss as MINIX 3 keeps some files on the RAM disk and only copies them back to the hard disk at shutdown time.
You can now remove any CD-ROM or floppy disk and turn off the computer. When you boot up again, you will be running MINIX 3.
If you are running a virtual machine, you will need to unmount the ISO image and tell the VM to boot from the hard disk. See the installation page for your VM for how to do this.
===== Next Steps =====
Note! The Minix 3 installation does not install the things like X11 and GCC automatically. You have to do this after reboot. Type shutdown and reboot and then follow these instructions on Post installation.
Now that you've installed MINIX 3, you can go about configuring it. If you plan on booting multiple operating systems (i.e., you didn't install the MINIX boot loader to your Master Boot Record), you should read [[.:multipleoperatingsystems|Running Multiple Operating Systems]].
You should also read [[.:postinstallation|Post Installation]] for some configuration tips and instructions on how to install packages. To do anything useful, you will need to install some packages as the base system is very barebones.
==== Rebooting from the disk but you need the CD in the VM... ====
If you just installed into a VM like Qemu you have to reboot to the hard disk. Since you probably want to install all the packages like X11 and GCC from the CD(You do not have to download them as extras), then you can simply change the boot sequence in your VM. For Qemu change the boot priority for the hard disk to higher than the CD, then reboot and you can use the pkgin_cd command to install some or all of the packages like X11 and GCC. The full install of all the packages does use some hundreds of megabytes so that is why it is done like this. See the [[.:postinstallation|Post Installation]] guide for more details.