Setting Up iSCSI With FreeNAS So Any Computer Can Have Additional Virtual Internal Hard Drives

Six hard disk drives with cases opened showing...

Six hard disk drives with cases opened showing platters and heads; 8, 5.25, 3.5, 2.5, 1.8 and 1 inch disk diameters are represented. (Photo credit: Wikipedia)

Did you know you can use FreeNAS to host iSCSI service?  OK, what is this service anyway?  To tell the truth, I’m so new to this that I’m scared to talk of it, because I don’t want to have this wrong and steer you wrong.  Anyhow, I think I know how this service works inside FreeNAS.  Let me sum this up, it’s like using FreeNAS’s storage volumes to act as hard drives on different computers.  So, to make this clearer, let say you have a FreeNAS server with plenty of ZFS disk space and you had already created the necessary ZFS Datasets to act as if these ZFS Datasets are different partitions (i.e., ZFS volumes or hard disks); you can basically set up iSCSI service through FreeNAS to make these ZFS Datasets to act as if they are internal hard drives of any other computer you have access.  Once you set a computer to connect to iSCSI service’s volumes (i.e., extents) and with appropriate permissions, the users who log onto this specific computer will be able to use FreeNAS’s ZFS Datasets (i.e., ZFS volumes) as if there are additional internal hard drives on the computer.  How neat, right?  Unfortunately, I think the setup for iSCSI is rather confusing, and you have to really understand iSCSI to not make mistakes when setting up iSCSI service in FreeNAS.  I’m myself not exactly sure of how setting up iSCSI, therefore I can’t really make a video about iSCSI.  Luckily, I’ve found an instructive video of teaching you how to setup iSCSI in FreeNAS.  Please enjoy the video out right after the break!

Using FreeNAS With VirtualBox To Create A True Personal Storage Cloud?


FreeNAS (Photo credit: Wikipedia)

Besides using third party online cloud services such as Dropbox or Pogoplug, you can always set up your own personal cloud at home.  In my opinion, a personal cloud should not route your data to any third party service, and so even Pogoplug touts as a personal cloud solution — your data still route through their network first.

OK, before we go even further into this post, I should make clear that a cloud can mean many things.  To some people, a cloud should be able to sync things.  To others, a cloud should automate things such as push and pull data — similar to iCloud.  Then there are folks who think cloud as expandable/scalable storage (either automatically or manually).  To me, a personal cloud can be all of the above and more.  Unfortunately, to have a personal cloud to do all of the above and more, one might have to go through a third party cloud service which touts as personal cloud — this to me isn’t truly a personal cloud!

In this blog post, I prefer to create a personal cloud that I host on my own machines.  Although the solution I’m going to talk about isn’t as elegant as iCloud or Dropbox, but at least this solution is somewhat capable of allowing you to interact with your personal cloud as if it’s an unlimited/scalable storage cloud (but manually scalable).  Our solution has to be manually scalable since when we want more storage capacity we have to add more storage means.  When I say more storage means, I mean we have to add either more hardware or to configure our personal storage cloud software to handle larger storage capacity.

So, what is our personal storage cloud solution?  Virtualizing FreeNAS!  Yes, FreeNAS is just a software which specializes in allowing people to create a free network-attached storage server.  When one uses FreeNAS natively (i.e., not virtualizing it), then it’s just a free network-attached storage server solution.  Now, imagining one can install FreeNAS onto VirtualBox, suddenly everything changes as one can begin utilizing FreeNAS as a personal storage cloud solution!

How is the virtualization of FreeNAS can provide us a personal storage cloud solution?  We can always add more virtual hard disks with the largest virtual hard disk size.  At this point in time VirtualBox allows largest virtual hard disk to be around 2 Terabytes.  You might be curious, what if you don’t have enough real disk space to support the humongous capacity (i.e., stringing together many large virtual hard disks under one virtual machine) of virtual hard disks right?  Well, the marvelous thing about virtualization is that you don’t actually have to have exactly the amount of real hard disk space until the virtual hard disks are actually growing that large.  In the worst case scenario, you can always move the virtualization of your FreeNAS onto a system with large enough storage capacity (i.e., move the VirtualBox virtual machine which runs FreeNAS and all of the attached virtual hard disks to a physical system which has larger storage capacity).

Meanwhile, working with FreeNAS in VirtualBox will not harm your real system in anyway, because it’s virtualization!  You can play with FreeNAS in VirtualBox without fear, and this leads to allowing you to understand FreeNAS better (i.e., practice makes perfect).  To tell the truth, I just get to know FreeNAS, therefore I will have to play with FreeNAS a lot more through VirtualBox’s virtualization before I can confidently post an excellent FreeNAS tutorial in thorough detail.

What I know so far about installing FreeNAS with VirtualBox is that it’s easy!  Just make sure that you specify FreeNAS as a BSD operating system type and FreeBSD as the operating system which FreeNAS is based on.  This means FreeNAS is a unix type of operating system, but it’s designed for creating network-attached storage server.  During the setup of a new VirtualBox virtual machine for FreeNAS, don’t forget to configure the settings to add however many additional virtual disks — this allows you with the ability to create storage volumes with specific virtual disks within FreeNAS’s control panel (i.e., FreeNAS graphical user interface control panel which can be accessed through a web browser through a local IP address or an external IP address).

When done installing FreeNAS through VirtualBox, you will see a black screen with scrolling letters and you will see options that you can choose so FreeNAS can be configured — you should pick the option which allows you to set up how FreeNAS should advertise its IP address (i.e., Configure Network Interfaces).  In unique situation when you cannot use DHCP to automatically lease/borrow a dynamic IP address from a router for your FreeNAS virtual machine, you can always fall back to the option which allows you to enter a shell.  Inside a shell, you can set up a temporary static IP so you can access FreeNAS’s graphical user interface control panel through a browser.  Here is how you set up a temporary static IP for FreeNAS — enter this command [ifconfig eth0 netmask], but do not use the square brackets and make sure you replace the static and netmask IP addresses with the ones that work with your router’s configuration.

Once done set up a temporary static IP for FreeNAS, you can access FreeNAS’s graphical user interface control panel through a browser.  Within FreeNAS’s graphical user interface control panel, you can access Network > Interfaces to add a permanent static IP address for your FreeNAS virtual machine (i.e., VirtualBox virtual machine).  This way, whenever you reboot your FreeNAS virtual machine, it will boot up with the same static IP address, consequently allowing you to access FreeNAS with the same static IP address.

By the way, I forgot to tell you that you should choose Bridge Adapter when you set up the network adapter for your FreeNAS virtual machine through VirtualBox Manager, because NAT adapter will advertise FreeNAS services on VirtualBox’s virtual IP address which might start as something like 10.x.x.x.  NAT type of IP addresses might prevent you from accessing FreeNAS’s graphical user interface control panel through a browser.

I’ll post more on FreeNAS once I get to be expertly using it, OK?  For now, at least we know that FreeNAS can be virtualized into an unlimited personal storage cloud in virtualization sense.  In reality, we still have to add more hardware to cope with growing disk space of virtual disks.  Even with FreeNAS, it’s illogical to think we can have unlimited personal storage cloud in absolute sense unless you have unlimited amount of money to buy unlimited amount of hardware (i.e., disk drives) to support the unlimited growing disk space of virtual hard disks.

For your information, FreeNAS is free to download and install and use, therefore there is no harm in trying it out — virtualizing FreeNAS for personal storage cloud or natively using it.  What’s even more wonderful is that virtualizing FreeNAS with VirtualBox is also free, therefore you can virtualize FreeNAS to your heart’s content without paying a dime.  What isn’t free is buying more hard disks to handle the growing virtual disks for your system!

What About VirtualBSD 9?

Daemon (BSD)

Image by K W Reinsch via Flickr

Just recently, I’ve been playing with a new Unix distribution known as VirtualBSD.  Apparently, I like it!  VirtualBSD isn’t the same as other BSD distributions such as FreeBSD.  How come?  Well, let say you cannot directly install VirtualBSD onto a machine/computer, but you have to use virtualization for it.  So, VirtualBSD is meant to be used with VMware.  Don’t sweat VirtualBox users, because the developers of VirtualBSD also have you guys in their mind, and so they had created a script which will help you convert VirtualBSD for VMware into VirtualBSD for VirtualBox.

People might wonder why the developers force users to use virtualization for VirtualBSD.  Well, I think the developers want to encourage more users to use BSD/Unix type of operating systems; by not making users to go through the long process of installing a BSD/Unix type of operating systems, instead users can just add VirtualBSD virtual hard disk onto a new virtual machine, launch it, and have a BSD/Unix type of operating systems to play, learn, and experiment with.  Nonetheless, adding VirtualBSD 9, the latest VirtualBSD version at we speak, onto VirtualBox would not be totally hassle free, but it’s still a lot faster than having to install an operating system.

I’ve created a video on VirtualBSD 9 which you can watch right after the break.  The video will guide you through the process of adding VirtualBSD 9 onto VirtualBox virtual machine.  For the bonus, the video will show you how to use portsnap to fetch and update ports tree collection so you can install Linux applications/software onto VirtualBSD (a Unix type), and how to add and remove users on VirtualBSD 9.  So, if you really want to learn how to use BSD but do not really want to go through the trouble of installing it, then I suggest you check out my video right after the break so you know how to get VirtualBSD 9 up and running quickly.  Enjoy!

How To Enable Guest Additions For PC BSD 9 Guest Virtual Machine Under VirtualBox

Image Copyright By Vinh Nguyen

PC BSD 9 just came out.  Users who want to install PC BSD 9 as a VirtualBox guest virtual machine might not know how to install VirtualBox guest additions.  Well, this post is going to show you how to do just that!  Before we get going, you must know that you have to obtain Ports Collection.  Usually, you can obtain Ports Collection by allowing the installation of PC BSD 9 to automatically do that for you.  If you haven’t done so, then you must look up through Google for how to manually obtain Ports Collection for PC BSD 9.

You should open up a terminal and become root.

  1. Type the command [cd /usr/ports/emulators/virtualbox-ose-additions && make install clean]
  2. Type the command [nano /etc/rc.conf]
  3. Add the two lines below into /etc/rc.conf file
    1. vboxguest_enable=”YES”
    2. vboxservice_enable=”YES”
  4. Use Ctrl+X  to save the file and exit nano editor
  5. Open up PCBSD Control Panel
  6. Open up Display
  7. Choose General tab.  Make sure you choose the new video driver as vboxvideo.  Pick the right screen resolution.  Choose Advanced tab and check the box that says Monitor Settings.  Click Apply to save everything.

When your machine is done with its rebooting, you should now be able to see PC BSD 9 enters the correct screen resolution by using VirtualBox guest additions.  Also, if you still see a problem, I think you should use right Ctrl + F to enter fullscreen mode, and if fullscreen mode is at the right screen resolution, then you know VirtualBox guest additions is working for PC BSD 9.

Lastly, you should learn how to use Ports Collection to install additional software that PC BSD 9’s AppCafe might not carry.  Of course, you can always use AppCafe to install whatever is available inside AppCafe.

PC BSD 9 enables firewall by default.  Nonetheless, you should go into PCBSD Control Panel > Firewall Manager and configure it to your own liking.  Make sure you do not allow any incoming connection even though some incoming connections might be enabled by default under the Exceptions tab.  Well, that was how it was done by me.  You might do it differently with your firewall!

I can go on forever, but this post is specifically addressing the installation of VirtualBox guest additions for PC BSD 9 VirtualBox guest virtual machine.  So, let me end this here, and good luck to you in installing guest additions for PC BSD 9 under VirtualBox.