We are going to get FreeNAS installed using VirtualBox today. This will most likely be the longest post of the series as I’ll be doing quite a bit of hand holding. Since we are using a virtual disk there won’t be much you can mess up and the worst that can happen is you’ll have to start over. So if you feel like playing around with it yourself go right ahead but if you are having trouble I’ll be right here holding your hand and walking you through how it should be set up.
Before we dive in and get FreeNAS running in a virtualized environment we need to get that environment set up. We’re going to be using VirtualBox so head on over to the downloads page and download the one that is appropriate for you. I’m working on an Intel Mac which means my screenshots may look different than what you’ll be looking at but for the most part everything will be the same. If you are on a PC go for the x86 version unless you know for sure you are running AMD 64 bit hardware then go ahead and get that one.
While you’re downloading VBox it’s also a good time to start downloading the latest FreeNAS release too. So head on over to their downloads page and look for the LiveCD. Once again the i386 version will be just fine for you unless you know as a fact you have AMD64 hardware. A LiveCD is basically an image that can be burned to CD or DVD that you can boot your system up with and run just like you would had you actually went through the trouble of installing it. It’s great for things like trying out linux or even booting into Linux to troubleshoot a computer problem. With FreeNAS you could run the whole server off nothing but that CD and a usb or floppy disk to save your configuration to. For our purposes we’re going to go ahead and install the Full installation of FreeNAS though so we can do some other fun things later.
Once you get VirtualBox downloaded go ahead and install it just like you would any other program. The default options should work just fine. Go ahead and launch it. You should now be presented with a screen that looks like this probably after they bug you about your contact info (you can skip it):
What we want to do know is set up a new virtual machine. We are going to tell this program the different types of things we want in a virtual machine like memory and hard drive space. To start with press the big blue button labeled ‘New’ which will start the New Virtual Machine Wizard. Click next and then give your machine a name. I’ll be using ‘FreeNAS Test’ without the ‘ of course. To configure the OS Type You should choose BSD as the Operating System and FreeBSD as the Version. One page down! Hit next.
It should now be asking you the amount of base RAM you want. It recommends that I use 128MB and it is actually already set for me. the exact amount FreeNAS requires escapes me at the moment but the hardware footprint it needs to run is very small and you’ll do just fine at 128MB.
You should now be coming to the Virtual Hard Disk portion of the wizard. We’ll want to create a new disk so press the button labeled New. This will bring us into an entirely new wizard designed to set up our disk. For the disk we have a couple of options; dynamically expanding or fixed. I always choose dynamically expanding which means that as you use more space on the virtual machine the size of the disk will grow with you as you need it so your not wasting space. Click Next and enter how large you would like your disk to be and give it a name. The name ‘FreeNAS Test’ was already filled in for me and I’m keeping it as well as the size of 2GB which I will also keep the same. Keep moving along and it will verify that you are creating the disk and tell you where it will be located because in essence, your virtual machine is just a file on your computer.
Now the disk should have automatically populated in the drop down menu and you can now hit next. If it didn’t just select the drop down menu and select the disk we just created. That bring us to this screen verifying all the things we just told it to do:
Now you’ll notice that you have a Virtual Machine showing up on the left hand side of the VirtualBox window and you may be tempted to hit Start and boot up. Not quite yet, we still have a couple more things to configure.
First click on CD/DVD-ROM and we want to point it to the FreeNAS file we downloaded earlier. Tick the box for Mount CD/DVD Drive, and click on the radio button for ISO Image File. In the Media Manager you’ll want to click on add and find the file you downloaded earlier to add it. You’re looking for the file that starts with ‘FreeNAS’ and ends with ‘.iso’. Once you select it and click through you’ll see it show up under your virtual hard disk.
Now look a little farther down for ‘Network’. More than likely the adapter type that is chosen is correct but you’ll want to change ‘Attached To:’ to say ‘Host Interface’. Once you’re done with that we are finally ready to start the machine so go ahead and hit the green arrow labeled ‘Start’!
You should be presented with some information about what they call the host key. Make a note of what this is for you. If I recall correctly it’s right-ctrl for Windows. You’ll need to press this to release the keyboard and mouse back to the host Operating System (OS). Once you get booted up you’ll see a black and white interface with some menu options:
Remember when I said this is a LiveCD? You are running FreeNAS right now! Although, you won’t be able to do much since we haven’t set anything up yet. Instead of configuring this LiveCD we’re going to go ahead and install it for ourselves. Go ahead and press 9 and hit enter. Another menu will come up with a few more options and a little more color. We are looking for option 3 or the one that says “Install ‘full’ OS on HDD + DATA + SWAP Partition” so go ahead and choose that. It’s going to tell you it’s going to create everything for you and the data on the disk will be lost. This is ok because it’s the virtual disk you created not your actual hard disk. Press OK and and then OK again to tell it to use the VBOX CD. If you created the virtual hard disk like I said you’ll now see asking where to install the OS and something like “ad0 2048MB <VBOX HARDDISK/1.0>”. Keep hitting OK here. Here is where we are going to change it up a bit. We are going to want some additional space later to play with some things so lets bump up the OS Partition size from 128 to 256. That should be enough room. Don’t worry about a swap partition. It’s the equivalent of a pagefile in windows and I’ve never seen it being utilized in any of my FreeNAS installs but if you want it and you know what you are doing then by all means, it can’t hurt. Now it’s going to give you some important information about getting your first disk set up and ready to go which looks something like this:
This is some pretty important information and some you may want to write down had I not just posted a picture of them here. Don’t worry, I’m also going to walk you through what they are telling you to do. So go ahead and press enter and then exit the install menu and you’ll be back to the original black and white menu that came up. Press 7 to reboot the system confirming that that is really what you want to do.
Once you are rebooted and back to that good old black and white menu go ahead and press 2 for Set LAN IP Address. Now we will use the default settings so pressing enter 3 times should get this set up for you. Use DHCP to set the IP, say no to configuring IPv6, you’ll see the IP for the web GUI and then press enter the third time to continue after making a note of the web address for the GUI.
I’m in a hospital right now so my IP is a little funky but you’ll probably see something like 192.168.0.100 but as long as you have some numbers in that configuration you should be fine. Go to a new tab in your web browser and put that address in. If you’ve followed my instructions you should now be prompted for a username and password. The default username is “admin” and the password is “freenas”. Now you will see your shiny new GUI!
We’re almost done here with the most basic set up. Just bare with me. We now want to add the disk like the instructions told us to do earlier. Hover over Disks and click on Management. To the right you’ll see a plus symbol, click on it. In the drop down make sure the disk that you were told to add earlier is selected. In my case it’s ad0. For the description type in FreeNAS Test Disk. Leave everything else except for the last item, Preformatted File System, and set this to UFS since the installer took care of that for us. Later on if you add a disk to the system you’ll set this to unformatted and format the disk through that option in the Web GUI. Click on Add and then make sure you click on Apply changes so that they take effect.
Now that we’ve added the disk let’s set a mount point so we can access it. hover over Disk and click on Mount Point. Once again click on the plus off to the right. the type is Disk, the Disk drop down should be set to the disk we just added. for partition you’ll notice there are some comments. Number 2 fits our description, “2* second MBR partition (DATA partition) if you select option 2 during installation on hard drive (all versions).” so go ahead and select that. file System is UFS and for the sharename put freenas. Enter a description if you like and then leave everything else the same as you click add. Don’t forget to apply your changes now! You’ll notice that a lot of adding and removing and configuring stuff deals with the plus symbol off to the right or other symbols like a minus and some tools and after you’ve changed something you always want to apply the changes.
We have the disk set up and mounted but how do we access it now? We need to set up a CIFS/SMB share so that other computers including the one you installed the virtual machine on can access it. This is the equivalent of sharing a folder in windows by right clicking on it and enabling sharing in Windows. So mouse over Services and click on CIFS/SMB. At the top off to the right you’ll want to enable this service. If you know your Workgroup name is different go ahead and change it but leave everything else the same and scroll to the bottom to press Save and Restart.
It should tell you that everything had been applied and now all you have to do is set up what shares you want the service to have access to. Right now we only have the one disk so we’ll add it. Click on the shares tab and the plus off to the right. For the name type FreeNAS and give it a description. We need to browse to the path of the share so click the 3 dots by Path. You’re only option should be freenas because that’s what we named our disk. Click on that and hit ok and the path will be filled in for you. Something like “/mnt/freenas/”. Leave everything else the same and click Add and then Apply changes.
Congratulations! You now have the most basic set up completed. At this point you may want to save your configuration so if you play around and break something you can always fix it. You’ll find this by hovering over System and click on Backup/Restore.
What you can do with this setup is connect to that disk from any computer on your network. The instructions are different from operating system to operating system but generally you want to go into my network places and browse for network computers. you should see one that is labeled FreeNAS and clicking on it will show our mounted Disk with no files on it. You also may just want to mount the drive my going into My Computer, clicking on tools and the Mount Network Drive. Assign it a drive letter, browse to the drive, and then click on OK or finish and it will then show up in My Computer just like your other Hard Drives.