.. _Booting Into FreeNAS®:

Booting Into FreeNAS®
----------------------

The Console Setup menu, shown in
:numref:`Figure %s <console_setup_menu_fig>`,
appears at the end of the boot process. If access to the FreeNAS®
system's keyboard and monitor is available, this Console Setup menu
can be used to administer the system if the administrative GUI is
not available.

.. note:: The Console Setup menu can be accessed from within the
   FreeNAS® GUI by typing :command:`/etc/netcli` from :ref:`Shell`.
   The Console Setup menu can be disabled by unchecking the
   :guilabel:`Enable Console Menu` in
   :menuselection:`System --> Settings --> Advanced`.


.. _console_setup_menu_fig:

.. figure:: images/console1a.png

   Console Setup Menu


The menu provides these options:

**1) Configure Network Interfaces:** provides a configuration wizard
to configure the system's network interfaces.

**2) Configure Link Aggregation:** allows creating a new link
aggregation or deleting an existing link aggregation.

**3) Configure VLAN Interface:** is used to create or delete a VLAN
interface.

**4) Configure Default Route:** is used to set the IPv4 or IPv6
default gateway. When prompted, enter the IP address of the default
gateway.

**5) Configure Static Routes:** prompts for the destination network
and gateway IP address. Re-enter this option for each route needed.

**6) Configure DNS:** prompts for the name of the DNS domain and the
IP address of the first DNS server. When adding multiple DNS servers,
press :kbd:`Enter` to enter the next one. Press :kbd:`Enter` twice to
leave this option.

**7) Reset Root Password:** if you are unable to log in to the
graphical administrative interface, select this option and follow the
prompts to set the *root* password.

**8) Reset to factory defaults:** to delete **all** of the
configuration changes made in the administrative GUI, select this
option. Once the configuration is reset, the system will reboot. It
will be necessary to use
:menuselection:`Storage --> Volumes --> Import Volume` to re-import
any volumes.

**9) Shell:** starts a shell for running FreeBSD commands. To leave
the shell, type :command:`exit`.

**10) System Update:** checks for system updates. If any new updates
are available, they are automatically be downloaded and applied. This
is a simplified version of the :ref:`Update` option available in the
web interface. Updates are applied immediately for the currently
selected train and access to the GUI is not required. For more
advanced update options like switching trains, use :ref:`Update`.

**11) Create backup:** backs up the FreeNAS® configuration and ZFS
layout, and, optionally, the data, to a remote system over an
encrypted connection. The remote system must have sufficient space to
hold the backup and be running an SSH server on port 22. The remote
system does not have to be formatted with ZFS, as the backup will be
saved as a binary file. When this option is selected, it prompts for
the hostname or IP address of the remote system, the name of a user
account on that system, the user account password, the full path to a
directory on the remote system to save the backup, whether to also
back up all of the data, whether to compress the data, and a
confirmation to save the values. *y* starts the backup, *n* repeats
the configuration, and *q* quits the backup wizard. If the password is
left empty, key-based authentication is used instead. This requires
that the public key of the *root* user has been stored in
:file:`~root/.ssh/authorized_keys` on the remote system and that
they key is **not** protected by a passphrase. Refer to
:ref:`Rsync over SSH Mode` for instructions on generating a key pair.

**12) Restore from a backup:** restores from an existing backup
created with :guilabel:`11) Create backup` or
:menuselection:`System --> Advanced --> Backup`. It prompts for the
hostname or IP address of the remote system holding the backup, the
username that was used, the password (leave empty if key-based
authentication was used), the full path of the remote directory
storing the backup, and a confirmation that the values are correct.
*y* starts the restore, *n* repeats the configuration, and *q* quits
the restore wizard. The restore indicates if it can log into the
remote system, find the backup, and whether the backup contains data.
It then prompts to restore FreeNAS® from that backup. Note that if *y*
is pressed to perform the restore, the system will be returned to the
database configuration, ZFS layout, and optionally the data, at the
point in time when the backup was created. The system reboots after
the restore completes.

.. warning:: The backup and restore options are meant for disaster
   recovery. If you restore a system, it is returned to the point
   in time that the backup was created. If you select the option to
   save the data, any data created after the backup was made will be
   lost. If you do **not** select the option to save the data, the
   system will be recreated with the same ZFS layout, but with **no**
   data.

.. warning:: The backup function **IGNORES ENCRYPTED POOLS**. Do not
   use it to back up systems with encrypted pools.

**13) Reboot:** reboots the system.

**14) Shutdown:** halts the system.

During boot, FreeNAS® automatically attempts to connect to a DHCP
server from all live interfaces. If it successfully receives an IP
address, the address is displayed so it can be used to access the
graphical console. In the example seen in
:numref:`Figure %s <console_setup_menu_fig>`,
the FreeNAS® system is accessible from *http://192.168.1.119*.

If the FreeNAS® server is not connected to a network with a DHCP
server, use the network configuration wizard to manually configure the
interface as seen in
:ref:`Example: Manually Setting an IP Address from the Console Menu
<quick_manual_ip_topic>`.
In this example, the FreeNAS® system has one network interface (*em0*).


.. topic:: Manually Setting an IP Address from the Console Menu
   :name: quick_manual_ip_topic

   .. code-block:: none

      Enter an option from 1-14: 1
      1) em0
      Select an interface (q to quit): 1
      Delete existing config? (y/n) n
      Configure interface for DHCP? (y/n) n
      Configure IPv4? (y/n) y
      Interface name: (press enter as can be blank)
      Several input formats are supported
      Example 1 CIDR Notation: 192.168.1.1/24
      Example 2 IP and Netmask separate:
      IP: 192.168.1.1
      Netmask: 255.255.255.0, or /24 or 24
      IPv4 Address: 192.168.1.108/24
      Saving interface configuration: Ok
      Configure IPv6? (y/n) n
      Restarting network: ok
      You may try the following URLs to access the web user interface:
      http://192.168.1.108


Once the system has an IP address, enter that address into a graphical
web browser from a computer capable of accessing the network
containing the FreeNAS® system. The password for the root user is
requested as shown in
:numref:`Figure %s <quick_enter_root_pass_fig>`.


.. _quick_enter_root_pass_fig:

.. figure:: images/login1a.png

   Enter the Root Password


Enter the password created during the installation. You should then
see the administrative GUI as shown in the example in
:numref:`Figure %s <quick_graphic_config_menu_fig>`.


.. _quick_graphic_config_menu_fig:

.. figure:: images/initial1a.png

   FreeNAS® Graphical Configuration Menu


If you are unable to access the IP address from a browser, check the
following:

* Are proxy settings enabled in the browser configuration? If so,
  disable the settings and try connecting again.

* If the page does not load, make sure that you can :command:`ping`
  the FreeNAS® system's IP address. If the address is in a private IP
  address range, you will only be able to access the system from
  within the private network.

* If the user interface loads but is unresponsive or seems to be
  missing menu items, try using a different web browser. IE9 has known
  issues and will not display the graphical administrative interface
  correctly if compatibility mode is turned on. If you can't access
  the GUI using Internet Explorer, use
  `Firefox <https://www.mozilla.org/en-US/firefox/all/>`_ instead.

* If you receive :guilabel:`An error occurred!` messages when
  attempting to configure an item in the GUI, make sure that the
  browser is set to allow cookies from the FreeNAS® system.

This `blog post
<http://fortysomethinggeek.blogspot.com/2012/10/ipad-iphone-connect-with-freenas-or-any.html>`_
describes some applications which can be used to access the FreeNAS®
system from an iPad or iPhone.

.. index:: Initial Configuration Wizard, Configuration Wizard, Wizard


.. _Initial Configuration Wizard:

Initial Configuration Wizard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A configuration wizard automatically starts the first time the
FreeNAS® GUI is accessed. This wizard walks you through the steps
needed to quickly configure FreeNAS® to start serving data over a
network. This section describes these configuration steps. If you wish
to use the wizard again after the initial configuration, click the
:guilabel:`Wizard` icon.


:numref:`Figure %s <wizard7>` shows the first
wizard configuration screen.

.. _wizard7:

.. figure:: images/wizard.png

   Configuration Wizard

.. note:: You can exit the wizard at any time by clicking the
   :guilabel:`Exit` button. However, exiting the wizard will not save
   any selections. The wizard can always be run again by clicking the
   :guilabel:`Wizard` icon. Alternately, the FreeNAS® GUI can be used
   to configure the system, as described in the rest of this Guide.


This screen can be used to change the default language, keyboard map,
and timezone. After making your selections, click :guilabel:`Next`.
The next screen depends on whether or not the storage disks have
already been formatted into a ZFS pool.

:numref:`Figure %s <wizard1>` shows the
configuration screen that appears if the storage disks have not yet
been formatted.


.. _wizard1:

.. figure:: images/wizard1.png

   Volume Creation Wizard


.. note:: The wizard will not recognize an **encrypted** ZFS pool. If
   your ZFS pool is GELI-encrypted, cancel the wizard and use the
   instructions in :ref:`Importing an Encrypted Pool` to import the
   encrypted volume. You can then rerun the wizard afterwards, if you
   wish to use it for post-configuration, and it will recognize that
   the volume has been imported and will not prompt to reformat the
   disks.

Enter a name for the ZFS pool that conforms to these
`naming conventions
<http://docs.oracle.com/cd/E23824_01/html/821-1448/gbcpt.html>`_.
It is recommended to choose a name that will stick out in the logs
(e.g. **not** :file:`data` or :file:`freenas`).

Decide if the pool should provide disk redundancy, and if so, which
type. The :ref:`ZFS Primer` discusses RAIDZ redundancy in more detail.
If you prefer to make a more complex configuration, click the
:guilabel:`Exit` button to close the wizard and instead use
:ref:`Volume Manager`.

These redundancy types are available:

* **Automatic:** automatically creates a mirrored, RAIDZ1, or RAIDZ2
  pool, depending upon the number of disks. If you prefer to control
  the type of redundancy, select one of the other options.

* **RAID 10:** creates a striped mirror and requires a minimum of 4
  disks.

* **RAIDZ2:** requires a minimum of 4 disks. Up to 2 disks can fail
  without data loss.

* **RAIDZ1:** requires a minimum of 3 disks. Up to 1 disk can fail
  without data loss.

* **Stripe:** requires a minimum of 1 disk. Provides **no**
  redundancy, meaning if any of the disks in the stripe fails, all
  data in the stripe is lost.

Once you have made your selection, click :guilabel:`Next` to continue.

If the disks have already been formatted with ZFS and the disks have
**not** been encrypted, the next screen will instead prompt to import
the volume, as shown in
:numref:`Figure %s <wizard2>`.


.. _wizard2:

.. figure:: images/wizard2.png

   Volume Import Screen


Select the existing volume from the drop-down menu and click
:guilabel:`Next` to continue.

The next screen in the wizard is shown in
:numref:`Figure %s <wizard3>`.


.. _wizard3:

.. figure:: images/wizard3.png

   Directory Service Selection


If the FreeNAS® system is on a network that does not contain an Active
Directory, LDAP, NIS, or NT4 server, click :guilabel:`Next` to skip to
the next screen.

However, if the FreeNAS® system is on a network containing an Active
Directory, LDAP, NIS, or NT4 server and you wish to import the users
and groups from that server, select the type of directory service in
the :guilabel:`Directory Service` drop-down menu. The rest of the
fields in this screen will vary, depending upon which directory
service is selected. Available configuration options for each
directory service are summarized in Tables
:numref:`%s <ad_options>`
through
:numref:`%s <nt4_options>`.

.. note:: Additional configuration options are available for each
   directory service. The wizard can be used to set the initial values
   required to connect to that directory service. You can then review
   the other available options in :ref:`Directory Service` to
   determine if additional configuration is required.


.. _ad_options:

.. table:: Active Directory Options

   +--------------------------+---------------+-------------------------------------------------------------------------------------------------------+
   | Setting                  | Value         | Description                                                                                           |
   |                          |               |                                                                                                       |
   +==========================+===============+=======================================================================================================+
   | Domain Name              | string        | name of Active Directory domain (e.g. *example.com*) or child domain (e.g.                            |
   |                          |               | *sales.example.com*)                                                                                  |
   |                          |               |                                                                                                       |
   +--------------------------+---------------+-------------------------------------------------------------------------------------------------------+
   | Domain Account Name      | string        | name of the Active Directory administrator account                                                    |
   |                          |               |                                                                                                       |
   +--------------------------+---------------+-------------------------------------------------------------------------------------------------------+
   | Domain Account Password  | string        | password for the Active Directory administrator account                                               |
   |                          |               |                                                                                                       |
   +--------------------------+---------------+-------------------------------------------------------------------------------------------------------+


.. _ldap_options:

.. table:: LDAP Options

   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Setting                 | Value          | Description                                                                                           |
   |                         |                |                                                                                                       |
   +=========================+================+=======================================================================================================+
   | Hostname                | string         | hostname or IP address of LDAP server                                                                 |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Base DN                 | string         | top level of the LDAP directory tree to be used when searching for resources (e.g.                    |
   |                         |                | *dc=test,dc=org*)                                                                                     |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Bind DN                 | string         | name of administrative account on LDAP server (e.g. *cn=Manager,dc=test,dc=org*)                      |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Base password           | string         | password for                                                                                          |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+


.. _nis_options:

.. table:: NIS Options

   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Setting                 | Value          | Description                                                                                           |
   |                         |                |                                                                                                       |
   +=========================+================+=======================================================================================================+
   | NIS domain              | string         | name of NIS domain                                                                                    |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | NIS servers             | string         | comma delimited list of hostnames or IP addresses                                                     |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Secure mode             | checkbox       | if checked,                                                                                           |
   |                         |                | `ypbind(8) <http://www.freebsd.org/cgi/man.cgi?query=ypbind>`_                                        |
   |                         |                | will refuse to bind to any NIS server that is not running as root on a TCP port number over 1024      |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Manycast                | checkbox       | if checked, ypbind will bind to the server that responds the fastest; this is useful when no local    |
   |                         |                | NIS server is available on the same subnet                                                            |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+


.. _nt4_options:

.. table:: NT4 Options

   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Setting                 | Value          | Description                                                                                           |
   |                         |                |                                                                                                       |
   +=========================+================+=======================================================================================================+
   | Domain Controller       | string         | hostname of domain controller                                                                         |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | NetBIOS Name            | string         | hostname of FreeNAS® system; cannot be greater than 15 characters or the same as the                  |
   |                         |                | :guilabel:`Workgroup Name`                                                                            |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Workgroup Name          | string         | name of Windows server's workgroup                                                                    |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Administrator Name      | string         | name of the domain administrator account                                                              |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+
   | Administrator Password  | string         | input and confirm the password for the domain administrator account                                   |
   |                         |                |                                                                                                       |
   +-------------------------+----------------+-------------------------------------------------------------------------------------------------------+


The next configuration screen, shown in
:numref:`Figure %s <wiz_share_creation>`, is used to create network
shares.


.. _wiz_share_creation:

.. figure:: images/wizard4a.png

   Network Shares


FreeNAS® supports several types of shares for providing storage data
to the clients in a network. The initial wizard can be used to quickly
make shares using default permissions which should "just work" for
common scenarios. For more complex scenarios, refer to the section on
:ref:`Sharing`.

To create a share using the wizard, enter a name for the share, then
select the :guilabel:`Purpose` of the share:

* **Windows (SMB):** this type of share can be accessed by any
  operating system using a SMB client. Check the box for
  :guilabel:`Allow Guest` to allow users to access the share without a
  password. SMB shares created with the wizard can be fine-tuned
  afterward with :ref:`Windows (SMB) Shares`.

* **Mac OS X (AFP):** this type of share can be accessed by Mac OS X
  users. Check the box for :guilabel:`Time Machine` if Mac users will
  be using the FreeNAS® system as a backup device. AFP shares created
  with the wizard can be fine-tuned afterward with
  :ref:`Apple (AFP) Shares`.

* **Generic Unix (NFS):** this type of share can be accessed by any
  operating system using a NFS client. NFS shares created using the
  wizard can be fine-tuned afterward with :ref:`Unix (NFS) Shares`.

* **Block Storage (iSCSI):** this type of share can be accessed by any
  operating system using iSCSI initiator software. Enter the size of
  the block storage to create in the format *20G* (for 20 GB). iSCSI
  shares created with the wizard can be fine-tuned afterward with
  :ref:`iSCSI`.

After selecting the :guilabel:`Purpose`, click the
:guilabel:`Ownership` button to see the screen shown in
:numref:`Figure %s <wizard5>`.


.. _wizard5:

.. figure:: images/wizard5.png

   Share Permissions


The default permissions for the share are displayed. To create a user
or group, enter the desired name, then check the
:guilabel:`Create User` box to create that user and the
:guilabel:`Create Group` box to create the group. Check or uncheck the
boxes in the :guilabel:`Mode` section to set the initial access
permissions for the share. When finished, click the :guilabel:`Return`
button to return to the share creation screen. Click the
:guilabel:`Add` button to finish creating that share, which will then
appear in the :guilabel:`Name` frame.

The :guilabel:`Delete` button can be used to remove the share
highlighted in the :guilabel:`Name` frame. To edit a share, highlight
it, make the change, then press the :guilabel:`Update` button.

When finished making shares, click the :guilabel:`Next` button to
advance to the screen shown in
:numref:`Figure %s <wizard6>`.


.. _wizard6:

.. figure:: images/wizard6.png

   Miscellaneous Settings


This screen can be used to configure these settings:

* **Console messages:** check this box if you would like to view
  system messages at the bottom of the graphical administrative
  interface. This can be handy when troubleshooting a service that
  will not start. When using the console message view, if you click
  the console messages area, it will pop-up as a window, allowing you
  to scroll through the output and to copy its contents.

* **Root E-mail:** FreeNAS® provides an "Alert" icon in the upper
  right corner to provide a visual indication of events that warrant
  administrative attention. The alert system automatically emails the
  *root* user account whenever an alert is issued. **It is important**
  to enter the email address of the person to receive these alerts and
  other administrative emails. The rest of the email settings in this
  screen should also be reviewed and edited as necessary. Before
  leaving this screen, click the "Send Test Mail" button to ensure
  that email notifications are working correctly.

* **From email:** the from email address to use when sending email
  notifications.

* **Outgoing mail server:** hostname or IP address of SMTP server.

* **Port to connect to:** port number used by the SMTP server.

* **TLS/SSL:** encryption type used by the SMTP server.

* **Use SMTP Authentication:** check this box if the SMTP server
  requires authentication.

* **Username:** enter the username if the SMTP server requires
  authentication.

* **Password:** enter the password if the SMTP server requires
  authentication.

When finished, click :guilabel:`Next`. A message will indicate that
the wizard is ready to perform all of the saved actions. To make
changes, click the :guilabel:`Return to Wizard` button to review your
edits. If you click the :guilabel:`Exit without saving` button, none
of your selections will be saved. To save your edits, click the
:guilabel:`Confirm` button. A status bar will indicate when the wizard
has completed applying the new settings.

In addition to the settings that you specify, the wizard will
automatically enable :ref:`S.M.A.R.T. Tests`, create a boot
environment, and add the new boot environment to the boot menu. If you
also wish to save a backup of the configuration database to the system
being used to access the administrative graphical interface, go to
:menuselection:`System --> General`, click the
:guilabel:`Save Config` button, and browse to the directory where the
configuration will be saved. **Always back up your configuration after
making any configuration changes**.

The rest of this Guide describes the FreeNAS® graphical interface in
more detail. The layout of this Guide follows the order of the menu
items in the tree located in the left frame of the graphical
interface.

.. note:: It is important to use the GUI (or the Console Setup menu)
   for all configuration changes. FreeNAS® uses a configuration
   database to store its settings. While it is possible to use the
   command line to modify your configuration, changes made at the
   command line **are not** written to the configuration database.
   This means that any changes made at the command line will not
   persist after a reboot and will be overwritten by the values in the
   configuration database during an upgrade.
