About Article Colors
Color Notation
Color Notation
Color Notation
Internal Link
External Link
Italic, Bold, Under-line & code
It should be almost the same for all Linux Distros or BSD Distros
In this case, we are about to install FreeBSD. I use Ventoy to create a bootable 60GB USB stick, which I can add several ISO images or extra folders/files. So, we start the FreeBSD installation and when asked about the package manager, make your choice. The Official FreeBSD recommendations are [use the pkg Binary system if you are not a developer.] So, if we are not going to install new software using the ports system and we are not developers (which is true in my case), then we go throught the easier way. If our choice is the "New way", we will not be able to use basic FreeBSD commands like freebsd-update fetch install. I use the ZFS disk partition system and apply all harden rules available. I could setup a static IP but is not needed at this point. I did create a new user and add it to the wheel group, to be possible to su -l in. Installation process finish. Reboot
First time Login
Login as root, and install the last update of pkg: pkg update. First I edit the /etc/ssh/sshd_config and change de default ssh port. I block root login and accept logins using passworld. After saving the changes, we start the ssh service by typing sysrc sshd_enable=yes and service sshd start. Then connect and add some basic applications that I always use, like git, curl, Vim and Tmux: pkg install tmux vim curl git. We are assuming that we need to give priority to the man pages information, before searching the web for more information. Read the off-line manual by typing: man man. It is useful to know that the default key bindings of Vim can be used to move throught the man pages.
The Scenario and Objectives
Lets imagine that we are behind our ISP router and we are just exploring the system before trying to expose it publicly. We are going to imagine that we are exposing our services but we are not. Only inside our intranet. We going to create several Virtual Machines using the vmm system that is included by default on all BSD distros. One for the HTTP server and other for our Database server. Maybe we are developers, but not low level developers. So we can create our site, for personal use or to make it public. Our machine characteristics are: Intel 12 CPUs with 12GB of RAM and 1TB of Disk space.
Since we already know what features we will use, we start reading the manual pages.
So we start with the obvious manual for this specific case. man vmm will tell us how to start configuring our system to be able to use this technology. Since we wish to have vmm active by default, we add the first suggestion of the manual to the /boot/loader.conf file. In case we wish to give more details about CPU usage for vmm system, we can add those options in this file, so they are loaded at boot time. Since we going to create two vms, we know that they will fight for resources, and we can prevent they consume all physical CPUs of our machine. But we can strict this later for each vm. Really small manual, which make reference to other key names that we should read. Then, man bhyve is our next manual. This manual describe how to use bhyve and we feel like we should create some sh scripts to manage this service that ask several options at once to run our vms. Hopefully, by the nature of those who are making a plan, you are adding some extra notes on some file, to understand the process and start building everything that is needed to start, before starting.
Note that FreeBSD doesn't use the same process used by OpenBSD. They have different approachs and we must continue using the manuals to figure how to setup our services. By reading the bhyve manual, we can explore many details that we should read, to understand each, in a deeper perspective. So we read more before starting to setup our server. man virtio to understand how hardware virtualization works, man tap and man netgraph to understand how the network virtualization works. Bhyve manual is extensive and give helpful examples. I continue without understanding how we going to create the virtual-disk-blocks, but the answer should be in the virtio man page. But is not.
Manuals don't help by speaking about "how to create disk files to be used by our vm's
This is the moment that you see that you don't have any manual reference about how to create new disk space to be used by your vm's, and therefor you need to visit the web. Giving suggestions to make those manuals batter. Gladly we are doing all this reading inside a ssh session and we have another computer to search the web and read the docs.freebsd.org site, to understand how we solve this doubt. FreeBSD makes reference to truncate application to create files of disk space to be used by our vms, while the previous manuals don't make any reference to that application. Please add reference to that application, so a Administrator can setup his machine without using the internet.
Maybe we want to automate the process for future usage
Because something can go wrong, because we may wish to create more vms, because we are lazy, we create several scripts to start and stop vms, create virtual disk space, start new vm or destroy them and delete them. But first start adding the necessary options and reboot your machine to start testing the commands and after you know how they work, you can start creating the scripts to make your life easier. Since you going to have few virtual network cards you may wish to add that information to some file.txt to remember later. Follow the examples. They are really good and you can use them as they are in most cases.
reboot and continue reading.
We already know that we can restrict Memory usage and CPU usage for each vm. It looks that we are already using our system, but we may wish to create a snapshot of our configurations using ZFS system for that. Is not the same as BTRFS (is what I think not what it really is, since ZFS is another big manual with many other manuals). So, we type: man zfs. Even if we are not exposing our server and internal virtual servers, we wish to read about FreeBSD firewall solution called pf. Therefor, we do the basic man pf to understand how to setup the pf service and man pf.conf to see all details that are possible to be used to configure our firewall. Both are rich manuals with many useful /examples to use.