FreeBSD is a powerful open-source operating system based on BSD Unix and developed by a large scale community.
You can install FreeBSD using direct access to a machine. This means, you have physical access to the machine such as operate keyboard, see the display on monitor directly, etc. In short, you are not using any medium to install and configure your machine. This is normal circumstance. But there is another method we can do, instead of installing FreeBSD by using physical access we can do indirect installation. The method we discuss is installation using remote SSH session. This article will cover how to do it.
Of course, you still need a Live CD (or live CD image, if you install for Virtual Machine). The one I use is FreeBSD-9.10RELEASE-amd64-dvd1.iso. Other than that, I use VirtualBox 4.2.6 for testing.
Despite of the fact we use virtual machine, this method should work on any machine.
Intro & Preparation
Boot the DVD (or the ISO). A bunch of text will appear in front of you. Ignore it if it doesn’t give you error.
On the welcome screen, you will have three options: < Install >, < Shell >, and < Live CD >. Choose the < Live CD > option. You will then be brought to a login screen (in CLI mode, of course). Enter “root” as username and no password required.
If you use non-English keyboard, invoke “sysinstall” tool to configure your keyboard mapping. In sysinstall, go to “Configure / Console / Keymap”.
If you use VirtualBox, VMWare, or other virtualization, make sure you have your machine connected with Bridged adapter (or something like that) not under NAT. This way, you can directly access your machine because the IP address will be on the same network as you.
Before starting SSH daemon, we have to create a writeable /etc space. We are using unionfs so that we could write on top of non-writable disk.
mkdir /tmp/etc mount_unionfs /tmp/etc /etc
Configure SSH daemon to allow remote login.
Find a line with “PermitRootLogin” and make sure it was written like this:
Then start the daemon.
You should also set the root password so that you can login.
There are two ways to configure network: manual configuration, automatic configuration.
This way, you want to configure IP address and other stuff manually. This is useful if you don’t have DHCP server in network. What you need is the free/unused IP address on your network, the netmask, and the default gateway on network.
Suppose you want to use 192.168.1.103 as your machine’s address with netmask 255.255.255.0 or /24 and the gateway 192.168.1.1.
ifconfig em0 inet 192.168.1.103 netmask 255.255.255.0 up route add default 192.168.1.1
This way, you want to configure IP address and other stuff automatically. This method rely on DHCP server in network, either by your router, or another specific machine.
How to Connect
You can connect to soon-to-be-installed-with-FreeBSD machine by using usual ssh connection. For example you are using Linux:
Then, you can continue to installation process by invoking