XigmaNAS: Complete Guide to Installing and Configuring a NAS from Scratch

Currently we can have a home or small office NAS server from manufacturers such as QNAP, Synology or ASUSTOR among other manufacturers. However, you can also mount a NAS with the hardware you want, you will only have to install an operating system oriented to a NAS server, such as XigmaNAS. This operating system is one of the best we can find to use as a NAS server, it comes with a large number of services already installed, and it will even allow us to install any software that is compatible with FreeBSD. Do you want to know everything about this NAS-oriented operating system and how to configure it from scratch?

XigmaNAS

In the following index of contents you will be able to access the specific configurations that we deal with in this tutorial, and in this article we are going to explain the main characteristics of this very complete operating system, we are also going to teach you how to install on a machine virtual, although in a real server it would be exactly the same, you will also be able to see the main general options of the operating system and later, we will get fully into the storage configuration with the ZFS file system. Finally, we will teach you how to configure in a basic way the different services that the operating system incorporates, such as the Samba server, FTP, DLNA, SSH, BitTorrent client and more.

Index of contents:

  • Main features
  • Installation and commissioning
  • General operating system options
  • Storage configuration with ZFS
  • User and group settings
  • Samba server configuration
  • FTP server configuration
  • DLNA Server Settings
  • SSH server configuration
  • OpenVPN server configuration
  • BitTorrent Transmission Client Settings
  • UPS configuration with NUT
  • Dynamic DNS Configuration

Main features

XigmaNAS is a FreeBSD-based distribution that is specifically geared to function as a high-performance NAS server. This operating system can be installed on any x64 platform, thanks to FreeBSD we will have compatibility with a wide variety of hardware. NAS stands for Network Attached Storage, and this operating system greatly facilitates the use and configuration of different servers for easy access via Samba, FTP, NFS, and many other network protocols. This operating system allows Windows, Linux or Mac clients to connect locally or remotely and work with files on a network.

Other very important characteristics of this operating system is that it incorporates ZFS (OpenZFS), the most advanced file system that currently exists. It also allows you to configure different RAIDs at the software level, allows you to encrypt the disk with AES-XTS, configure SMART and enable email reports. This operating system incorporates the following services:

  • CIFS / SMB (Samba)
  • Active Directory Domain Controller (Samba)
  • FTP (Proftpd)
  • NFS
  • TFTP
  • AFP
  • RSYNC
  • Unison
  • iSCSI (initiator and target)
  • At the network level we have HAST, CARP, Bridge and Link Aggregation, it also supports 802.1Q and WoL VLANs.

Other extra features of this operating system are the following:

  • UPnP
  • BitTorrent client with Transmission
  • Integrated firewall and ability to create static routes
  • iTunes / DAAP server
  • iPerf3 to measure local network performance
  • RRDtool for graphical statistics
  • IPMItools
  • Syncthing
  • DLNA media server with Fuppes and miniDLNA (one or the other).
  • Web server with HTTP and HTTPS (Lighttpd)
  • VirtualBox with VNC server and also phpVirtualBox and noVNC (HTML5 / WebSocket VNC client) for managing the VM.
  • NUT to monitor UPS (Uninterruptible Power Supply).
  • Internal file manager in the operating system.

We would also like to highlight that XigmaNAS will allow us to install any FreeBSD package manually, to further increase the capabilities of this great operating system. All configurations are made through the graphical user interface, except for the additional software that you decide to install.

As for the development of this operating system, it is more alive than ever and every month they release one or more updates to the operating system, incorporating the latest versions of the internal software, and correcting different bugs, software security flaws and many other improvements to do so. really fast. We currently have two versions of XigmaNAS, the XigmaNAS 12.1 version is based on FreeBSD 12.2, and the XigmaNAS 11.4 version is based on the FreeBSD 11.4 version, therefore, depending on which base to choose, we must install one or the other. Our recommendation is that you use the XigmaNAS 12.2 version.

XigmaNAS allows two installation modes, the «Embedded Installation» allows us an integrated installation on an SD card, USB key or an SSD / HDD. In this installation mode, you cannot install additional software or advanced system-level settings. In the case of installing the operating system in “Full Installation” mode, we will carry out a normal installation where we will have a part for “DATA” where we will have all the additional software that we can install, and also a “Swap” in case we are short of memory RAM. Both installation methods allow for an easy update, but it must be done “manually” by downloading the latest version, and it is not nearly automatic like on commercial NAS.

Installation and commissioning

The download and installation of this operating system is very simple, the first thing we have to do is enter the official website of XigmaNAS , and click on the button from «Download». It will automatically take us to Sourceforge and we can download the latest version of the operating system. We can choose between several types of downloads, the ideal one is the LiveCD or LiveUSB version 12.2, as you can see below:

In our case we are going to install this operating system in a virtual machine with VMware, to install several virtual hard drives and to be able to correctly configure the ZFS that we have available in the operating system. The installation is typical of loading the ISO image, selecting FreeBSD x64 as the operating system and configuring the CPU cores, RAM, and, above all, putting a total of 7 hard drives, the first one for the installation of the operating system, and the another 6 for data storage.

When we have configured the VM correctly, something like the following should appear:

The operating system will load and we will have to press the number 9 key to proceed with the installation or update. In the next menu we can choose between “Install Embedded” or “Full”, as we have explained before, for the vast majority of users with the first one is enough, but if you want to install additional software on a dedicated data partition, you should choose the «Full» version.

When choosing this version, we can choose between creating an MBR or GPT, the normal thing is to use MBR because we will use a low capacity disk. Once we have made the selection of “Install Full MBR”, it will tell us everything that is going to be done on the real hard drive. Next, we have to select the source of the data (the CD) and also the destination (the hard drive that we want to use for the operating system, this hard drive does not allow data to be shared as storage). Once the disk is selected, we define the size of the operating system partition, then the size of the SWAP memory, and finally, it will do all the necessary operations to install the operating system in its “Full” version.

When it asks us to restart the operating system, we will restart and the operating system will automatically load us, now we will have to configure the network interface so that it obtains IP address through DHCP. This is done by entering with the username “root” and password “xigmanas”, we choose option number 2 and follow the wizard, indicating that we want DHCP in the interface.

Once it is configured, we will already have an IP provided by the DHCP server, and we can access via the web with http: // IP_que_nos_indique

In our case, we have put http://192.168.248.135 in the browser. Later in the operating system configuration, we can configure the HTTPS protocol instead of HTTP.

The username to access the administration via is “admin”, and the password is “xigmanas”. Once entered, we will fully enter the graphical user interface of the operating system:

Once we have seen how this operating system is installed and how you can enter your operating system via the web, we are going to see the general options.

General operating system options

All the configurations you can imagine are available through the graphical user interface of the operating system, but if you install additional software through the official FreeBSD repositories, then you will have to manage everything through the console or via SSH.

In the ” System / General Configuration ” menu we can change the administrator username, configure the HTTPS protocol, the administration port, and we can even limit by allowed hosts so that other subnets do not access the server, we also have the possibility of set the language, time and computer name. Other configurations are to put the DNS servers, configure the graphical user interface via web with icons and other CSS options, and also change the administrator password.

In the “System / Advanced Configuration” section we can configure all the operating system parameters in more detail, we can configure system, performance and console options, we can also configure the SMTP server to send us emails, configure the weekly email report Through a CRON, monitor different parameters of the operating system, configure the SWAP space, execute commands before starting the system or after starting, configure the cron in a personalized way, and also define different variables in the loader.conf, rc. conf, sysctl.conf and the syslog.conf.

Other options available in the general configuration are the possibility of adding new software packages, managing network interfaces at the physical level, the possibility of configuring VLANs, bridging, and even configuring a LAGG with LACP and other link aggregation protocols.

Finally, we can configure the network in detail with its IPv4 and IPv6 address, configure access control to the hosts, create static routes, configure the HTTP or FTP proxy, and activate the firewall of the NAS server itself. As you have seen, we have dozens of configuration options at the management level.

Once we have seen all the available options, we are going to configure the storage with the ZFS file system that we have in this XigmaNAS operating system based on FreeBSD.

Storage configuration with ZFS

The ZFS file system is one of the most advanced that exist for NAS servers, this file system has a high performance, and above all, it provides great data integrity. It has some unique features like copy on write, the ability to create multiple pools and datasets, and even snapshots natively. Other very important features are that it has real-time compression, and also deduplication to save a large amount of disk space.

Format the disks with ZFS

The first thing we have to do is format the 6 hard drives that we have installed in the VMware, the format that we must use is ZFS. To do this, we go to “Disks / Administration”, and click on the “Import disks” button, so that it automatically detects all disks and we can format them. Once it recognizes them, we go to the HDD format section, select all of them, and choose the file system «ZFS storage» in all of them, click on next and we will have to put a volume label, we can put something like « Disk-number-% n »so that they are named sequentially. It is very important that the name does not have spaces or strange characters, only the characters that allow us.

Once we have done it, we will get a record with all the actions that the ZFS operating system has performed, and when we return to the “HDD Options” section we will see that the file system used is “ZFS Storage Pool”.

Once the disks are formatted with ZFS, we are going to create the virtual devices, configuring the different levels of Stripe, Mirror or RAID-Z.

ZFS – Pools (Virtual Device)

In the section “Disks / ZFS / Device pool (pools)” we click on “Virtual device”, here we will have to click on the “+” button to add new virtual devices. In the next menu we will choose one or more disks, and the buttons for “STRIPE”, “Mirror” and the different RAID-Z levels will start to activate depending on the number of disks. At the bottom there is a small legend that will recommend the different RAID-Z levels that we can configure depending on the number of disks.

We must remember the operation of the different levels:

  • STRIPE: It is a RAID0 of the chosen disks
  • Mirror: it is a RAID1 of the chosen disks, but we can configure more than 2 disks as a mirror.
  • RAID-Z1 – Allows one disk to fail, assuming all disks have the same capacity, total capacity is the sum of all disks minus the capacity of one disk.
  • RAID-Z2 – Allows two disks to fail, assuming all disks have the same capacity, total capacity is the sum of all disks minus the capacity of two disks.
  • RAID-Z3: Allows three disks to fail, assuming all disks have the same capacity, total capacity is the sum of all disks minus the capacity of three disks.
  • Spare: not in use, if a disk fails, it takes action and does a resilvering to remake the entire pool.
  • Cache: used as a cache, it is recommended to use an SSD.
  • LOG and LOG (Mirror): this is where the ZFS logs (ZIL) are stored, it is recommended to use an SSD.

In ZFS we can configure several virtual devices with different configurations, to later create a pool associated with a specific virtual device.

ZFS – Pools (Administration)

Once we have created two virtual devices, we are going to create the pools, in our case, we have created a pool with a virtual device in mirror of two disks, and another pool with a virtual device (vdev) with a RAID-Z2 of four discs. When creating it we can give it the name we want, by default we will have it in / mnt but we can change the mount point. We can also give you a description, a very important detail is the name to choose, because it is possible that not all characters are allowed.

Finally, we can see how the mirror and the raidz2 has been initialized correctly, and we can begin to configure the datasets or volumes by blocks.

Before creating the dataset, the “Tools” section is where we can perform different advanced actions with ZFS, without having to execute any command through the console or SSH, everything is done through a small configuration wizard with a graphical user interface . If we want to remove a disc or add a new one, we can do it quickly and easily with this list of tools to make life easier.

The “Information” section is where we can see the general status of ZFS with the different pools and also the configured vdev.

ZFS – Datasets

The datasets allow us to create the file system within a ZFS storage space, it is very easy to do, and it has many configuration options, such as configuring compression, deduplication, disk quotas, permissions, advanced ACLs and much more. . In ZFS there are two types of dataset, the «filesystem» which is the default dataset and which allows storing normal files and directories, but we also have «zvol» which is a block device, to use virtual disks for virtualized environments and other uses .

To create a new dataset, we go to the “Datasets” section, add a new one with the “+” button, give it a name, which pool it should belong to, the compression and the compression algorithm to use (LZ4 is recommended or the new one that will be integrated into ZFS soon), if we want deduplication, if we want synchronous options, the atime, access permissions, the owner of this dataset and much more. The most normal thing is to configure in detail how we want the dataset, although later we will be able to modify certain options, but it is much better to do it from the beginning, especially the compression issue.

Of course, we can create a second dataset in another pool or in the same one as before, it does not matter. We will have exactly the same settings as before.

ZFS – Snapshots

Snapshots, or also known as Snapshots, will allow us to go back in case of deleting files by mistake or by ransomware, ZFS allows us to take almost unlimited snapshots, so configuring it so that we have a snapshot every day is the most normal thing to do. , and even every certain hour. Once we have the snapshot, we can restore it, clone it to see what has changed and other management options.

ZFS – Current Settings and Preferences

In the “Configuration” section we will be able to see a summary of the device grouping (pools), the virtual devices (vdev), and also the dataset (datasets) that we have configured, in addition, if we have created volumes (dataset zvol ) we can also see it here.

At this time we should already have the storage configured, we can access this storage via samba, FTP or any other protocol.

User and group settings

The configuration of users and groups is done as in any Linux operating system, but in this case, through the graphical user interface. In the case of XigmaNAS, the administrator group is “wheel”, and we can configure the users with the following options:

  • Username
  • Full name
  • Password
  • Description
  • User ID
  • Console: is access via SSH allowed to this user? If it is not allowed, it says “No login”.
  • Main home directory
  • Primary group
  • Secondary groups, in this case, it is recommended that all users be in the ftp group to be able to use samba and FTP.
  • User portal: web administration of the operating system
  • File manager: different configuration options.

As you can see, creating a user is really easy, and creating a new group of users too.

Samba server configuration

The SMB server is one of the main protocols that we must configure to exchange data through the local network. XigmaNAS allows us to configure if we want this SAMBA server to be the master or not, in addition, we can also configure authentication through local users or through an Active Directory that we already have. Of course, we will have to name it, the workgroup, and we will also have to configure advanced options.

Some more advanced options are the possibility to configure the policy for the guests, if they are allowed or not allowed, we can also configure the extended attributes, the asynchronous I / O, the default mask of the files and directories, the maximum protocol for the server, and even additional parameters that are not in the graphical user interface. If we want more options, we will have to enter them manually in the “Additional parameters” section.

The most important thing is in the “Shared elements” section, if we want a user to access their home directory directly via Samba, we will have to put the following:

  • Path:% H
  • Name:% U
  • Comment: Home% H
  • Visible: Yes
  • Guest: No

In this way, we will be allowing access to all local users to your home, but we will be able to create more shared elements easily.

FTP server configuration

The FTP server is another of the fundamental services in a NAS server. XigmaNAS makes use of the popular Proftpd software, so we will have great performance and hundreds of advanced configuration options. In this section we can configure the port of the FTP server, maximum number of clients, connections by hosts, login attempts, expiration in seconds, if we allow access via root directly, if it allows access as anonymous or only authenticated users, allow a group of users specifically and the banner.

As for the advanced configuration, we can configure the mask of the files and directory, if we want the FXP protocol, allow the resumption of transfers, if we want to have chroot, reverse DNS lookup, TCP Wrapper, passive ports, if we want to limit the upload and download bandwidth, if we want to use the TLS protocol to protect the FTP connection, the level of record that we will have in the syslog, and we can even define additional parameters in an advanced way thanks to the use of Proftpd.

Finally, in the “Modules” section we can make use of several modules to further protect the server from possible attacks, for example, we can ban a user who wrongly enters the password 3 or more times, for a certain time. All of these modules are really very configurable.

DLNA Server Settings

Regarding the DLNA media server, we have two softwares in the operating system itself, but we can only have one active. We have Fuppes or miniDLNA, the most normal is to use miniDLNA since it works really well. In these menus we will simply have to put the source of the multimedia files, the physical interface and the port, but all the default settings are perfectly, except for the path for the files and the multimedia database that we must configure in the dataset that we want.

SSH server configuration

The SSH server incorporated in this operating system is OpenSSH, how could it be otherwise. We can configure the SSH port, if we want to enable wired authentication, with challenge-response, use keyboard or public key, if we want to allow root via SSH, and we can even put the private key, activate compression, and also enable the protocol SFTP for secure data transfers.

Finally, we have a section of “Additional parameters” where we can configure the SSH protocol in detail thanks to OpenSSH, here we can put all those parameters that we do not have through the graphical user interface.

OpenVPN server configuration

Unfortunately this NAS server does not have a built-in VPN server. Normally the VPN servers must be in the firewalls or in the router directly, and not in a NAS since we will have to redirect one or more ports, and make the corresponding static route in the router. However, other NAS-oriented operating systems do incorporate an OpenVPN server and even IPsec.

If we want to install OpenVPN on this NAS, we must do it completely manually, entering via SSH or by console, and doing all the settings to create a CA and the server certificates by hand. In this article we have a complete tutorial on how to configure an OpenVPN server from scratch, in the case of XigmaNAS, to install it we must execute the following as root user:

pkg install openvpn

In the installation, it will ask us to install the Easy-RSA, liblz4, lzo2 packages and also OpenVPN itself, we indicate that “yes” and it will automatically download the packages from the repositories and install it. Once installed, we will have to create a directory in the following path where both the OpenVPN server configuration file and the certificates will be: / usr / local / etc / openvpn /

Once we have everything here, we must go to the “System> Advanced> rc.conf” section and add:

  • Variable: openvpn_configfile
  • Value: /usr/local/etc/openvpn/server-ovpn.conf
  • Description: OpenVPN configuration file

We also have to add:

  • Variable: openvpn_if
  • Value: tun
  • Description: OpenVPN TUN

And finally:

  • Variable: openvpn_enable
  • Value: YES
  • Description: Enable OpenVPN at startup

To check that everything is correct, we can execute “openvpn /usr/local/etc/openvpn/server-ovpn.conf” to start the server, and we can see it in the general syslog log of the operating system. If it has started correctly, we can try to restart the system to verify that it starts with the system startup correctly.

BitTorrent Transmission Client Settings

Transmission is the most popular and widely used BitTorrent client for Linux and Unix operating systems. In XigmaNAS we also have this software available and we can make a large number of configurations through the graphical user interface, but if we want to make more specific and advanced options, then we will have to do it manually by editing the Transmission configuration file.

UPS configuration with NUT

NUT is a software that allows us to monitor uninterruptible power systems, also known as UPS or UPS. This NUT allows us to send notifications by email if the power goes out, and also configure the NAS server itself to turn off if in a certain time, it has not returned to electricity. Logically we will need to connect via USB cable from the UPS to the server, in order to monitor it correctly.

Depending on the UPS model used, we will have to make a NUT configuration or another, but almost always the controller to use is the “blazer_usb” as you can see here. Of course, we can add more advanced additional parameters, define an email for notifications and more.

Dynamic DNS Configuration

Dynamic DNS is very important in NAS servers, to access remotely via the web by HTTPS or via FTP / FTPES and transfer files, thanks to DDNS or Dynamic DNS, although in our home we have a dynamic public IP address, it will always be bound to a domain (host) on different providers. XigmaNAS incorporates a long list of DDNS service providers such as DYN, No-IP and many others, in fact, it allows a “personalized” profile in case we do not have it on this list.

So far we have come with this complete XigmaNAS configuration tutorial at a basic level, we hope that this great operating system allows you to have a very powerful NAS with the hardware you want.