VMware is one of the best and user-friendly virtualization software in the market. Their Workstation and VM Player can be installed on most of the client Operating Systems to virtualize the physical hardware and install multiple Operating Systems top of it.
Not only the server or client Operating Systems but even we can also install network storage Operating Systems on VMware as a virtual machine. Here I’m going to show how to install FreeNAS on VMware Workstation and configure iSCSI disks. This method gives the ideal test lab setup to have NAS as a virtual machine on single computer hardware. We can use this storage to setup Microsoft Windows server cluster.
What is NAS (Network Access Storage)?
In the physical environment, NAS is a hardware device with hard drives and it is accessible via the network port. The controller will have its own Operating System to manage the disks and allow the access. Every NAS devices have plenty of features and tools to make it scalable, secure and accessible.
These NAS devices support iSCSI, that can be used to set up a Windows failover cluster. But for the testing purpose in VMware, we can’t have the expensive physical NAS devices to configure a cluster with high availability in VMware. So, there is some free open source NAS software available to install on computers or servers to build a NAS system with existing hard disks and partitions. These free storage virtualization software make your computer hard disk as network access storage and allow other clients to access the disk directly through the network.
I found that these two famous free NAS software can be installed in the computer and make NAS.
Installing FreeNAS on VMware is simple and straight forward. But setting up and configuring the iSCSI disks involves several steps. Also, remember that the steps involved in configuring iSCSI disks in FreeNAS as shown below remain the same on any platform. For example, if you have the physical FreeNAS box, or install it on VirtualBox or any other virtualization software, you can follow the same below steps to set up disks.
How to Install FreeNAS Server on VMware workstation?
1) Download the latest stable version from the official site here. At the moment you can find FreeNAS 11.2 as on writing this guide.
NOTE: The current version requires a minimum 8GB of RAM. Since I have enough resources on my PC, I could configure a VM with 8GB RAM. If you do not have enough RAM, then you can try with lower capacity. It may impact the performance of VM.
2) Create a virtual machine in VMware workstation. Once you browse the downloaded FreeNAS ISO, it will automatically detect the OS version.
3) Set a hard disk size for the Operating System. Remember, this hard disk will be used to install the Operating System only. We can’t use this disk to create storage, disks and LUNs for sharing a purpose. We need to attach another hard disk again to this VM. We will discuss that later.
4) Set the appropriate hardware resources. I modified the RAM to 8GB and Processor numbers to 4.
Make sure that the ISO file is attached to CD/DVD drive.
5) Boot the system with the first option (default)
6) Select the Install/Upgrade option and press OK.
7) On the next screen, select the virtual hard disk to install. You need to choose the hard drive and press spacebar key to make the selection.
8) Select the Boot mode as ‘Boot via BIOS’ option to make the things simple.
You will see the installation screen. It is fast. The installation will be completed
9) Remove the loaded ISO file and reboot the virtual machine.
At this point, we have successfully installed the latest FreeNAS on VMware which is running on Windows 10 host.
Let’s see some more settings to make it work.
Network Settings in FreeNAS VM – Vmware
Once the VM booted, you can see the below screen which gives several options.
By default, the VM network is in NAT mode in VMware. I’m not going to explain more about VMware networking.
In the NAT mode, your virtual machines and host will communicate well even though the host and VM IP look different.
If you want you can change the network mode to ‘Bridge Mode’ so the FreeNAS virtual machine will get the same IP scheme of your host computer physical network.
In both cases, we need to configure static IP for FreeNAS storage. That is the ideal way to keep the IP unchanged for your storage device.
10) Enter 1 and continue the network configuration. Set up a manual IP which is not in the DHCP scope.
Here are the steps involved in setting up the IP.
Once the IP changes, it will display the web URL on the screen.
11) Open a browser and access the URL. Login with the root user name and password you set during the installation.
You must land on the FreeNAS management page without any issues.
Add Disk and Configure iSCSI in FreeNAS 11 on VMware
12) Now we are ready to configure the storage system and iSCSI disks. But we do not have any more drives than the OS disk. Hence we need to add another disk. You can add a few disks if you want.
Luckily VMware allows adding the virtual disks to a virtual machine while it is working. SCSI disks can be added.
I added another 10GB disk for testing purpose.
13) Make sure VMware and FreeNAS detected the new disk successfully. It should be listed under the disks.
14) Create a pool. Select and add the new disk to the pool, as shown below.
15) Now start the iSCSI service in FreeNAS. By default, it is off. Go to ‘Services’, select and switch on the iSCSI service.
16) Go to ‘Sharing’ and select ‘Block (iSCSI)’ to configure more options.
17) Click on ‘Portals’ and add a new one. If it is the first time you are configuring, most probably you need to add a new portal.
You can comment for your reference. Click on the drop-down and select the IP address of the FreeNAS VM.
18) Now click on ‘Initiators’ tab and add a new one.
If you do not want more restriction, then keep both ‘All’. Otherwise, add the client network where you will be accessing the iSCSI storage. I left ‘All’ and applied the settings.
19) Time to add targets. Click on ‘Targets’ and add a new one.
Give a name related to the type so that you can understand later. Here select the portal you created in the earlier step.
20) We need to create Extents to add the storage. Click on ‘Extends’ and add new.
Give an appropriate name, and select the type as ‘File’.
Browse the mount point where you intended to store the iSCSI disk and give a name at the end of the mount point. This method will allow hosting several LUNs in the same disk. Give the size of the extend. When host access this iSCSI target, it will read the disk size what you mention here. It should be less than the mount point size.
21) As the final step, add an ‘Associated Targets’. Make sure to select the correct names from the drop-down and add LUN ID. It can be any number between 0 to 256 but should be unique.
With those steps, we have successfully created an iSCSI disk in FreeNAS which is running on VMware workstation.
Connect and Test the iSCSI Target in FreeNAS from Windows
Make sure the network connectivity to the FreeNAS is working and iSCSI protocol allowed on the Windows firewall and any other network security protection software on Windows computer.
I’m going to test this from my Windows 10 computer. You can use the same method on Windows servers such as 2016, 2019 or any other earlier versions which have Microsoft iSCSI service.
22) Start the iSCSI initiator on Windows client and type the IP address of FreeNAS in quick connect. It will connect successfully.
23) Go to ‘Volumes and Devices’ and press ‘Auto Configure’. Windows will find the mount point with the device which is hosted on FreeNAS.
24) We are almost done. Now open the disk management under Computer Management in Windows 10. It will pop up the new volume it found via the iSCSI. Format, give a name and initialize it.
With the above clear steps with the images, you should be having a FreeNAS server on VMware workstation with Windows 10, 8.1 or any client OS. We created iSCSI disks successfully on FreeNAS that can be accessed by any client as long as the network to the virtual machine available.
Really good blog, this is what I was looking for, It will be appreciated if you post /mail using this iscsi in windows 2008 r2.
looking forward for your posts.
Have open filer volume which is attached to server 2008 and initialized and formatted and data is put in
for some reason it have been disconnected when connect it back using iscsi initiator the open filer volume is visible in the disk management of server 2008 but have no drive letter and it seem to be empty
when right click the only option highlighted is convert to dynamic disk
how to solve this problem and how to restore my data back??
Do not use dyanmic disks for iscsi using Windows iscsi initiator. They will not reconnect on reboot. Disk must be basic. I know this is true for Windows 2003 so I beleive it is also the case for 2008.
Do not use dyanmic disks for iscsi using Windows iscsi initiator. They will not reconnect on reboot. Disk must be basic. I know this is true for Windows 2003 so I beleive it is also the case for 2008.
To get back to basic disk you must delete the partition and recreate it. Make sure you copy your data to another disk or starage before deleting it. Also make sure you setup the iscsi initiator to use persistent targets / reconnect on reboot.
If you do not want to recreate a basic disk, there may be some scripts out there that will reconnect dynamic volumes on reboot.
Hi, I am using FreeNAS 0.7 Khasadar (revision 4919) and everytime I try and create a target I get Error Code 1 following your instructions. Is this a bug in this version? It only happens right at that step when I create a target. Also, I am using this on ESXi 4 so I don’t know if that will be an issue.
Thanks,
Edmund
I don’t think using on ESXi will be an issue. Better give little less size (512 MB to 500MB) when you allocate target disk. I don’t think it will be bug, because I use the same version. I can try if you send the screen shot of error, I would suggest, just for testing install and configure outside ESXi.
Good luck lets us know what happened.
Hi Dinesh,
The article is just great .
When i followed ur steps everything was perfect execpt when t tried to do the 31st step(Coniguring extender and target).iam not able to save the changes and i get error code 1…in step 32 when u say ” It will bring the pool you created as a directory. Click on it and press OK button at top right side” what do u mean by that..i dont see any pool in the parent directory..kindly explain me on this..thank u
I’m having the same problem as Edmund. I’m running freenas in a VM with 4 virtual disks in raid 5. Everything goes well until i create the target. I also get the “Error: The changes could not be applied (error code 1). The portal is working and i can connect to it with an initiator but the target kills the service and brings the portal down.
Allocating less disk space did not work for me.
I’m going to test it tomorrow on another PC. This is driving me nuts..
Extra info from the log:
istgt[3873]: istgt_lu.c:1223:istgt_lu_add_unit: ***ERROR*** LU1: LUN0: format error
istgt[3873]: istgt_lu.c:1473:istgt_lu_init: ***ERROR*** lu_add_unit() failed
istgt[3873]: istgt.c:1247:main: ***ERROR*** istgt_lu_init() failed
root: Failed to restart service iscsi_target
Too bad it doesn’t help me that much. 😮
I’m also getting the same error in latest version FreeNAS 0.7 (Khasadar). But here I used earlier version FreeNAS 0.7RC1 (Sardaukar). No major changes between both versions.
Download FreeNAS 0.7RC1 (Sardaukar) version at
http://www.softpedia.com/get/UNIX/Networking/Server-Applications/FreeNAS.shtml
it must be a bug in FreeNAS 0.7 (Khasadar) version, or different way to create SCSI-3 persistent targets.
I will check & update you all. But Windows 2008 R2 cluster working fine with this setup.
I also had this issue with FreeNAS 0.7 (Khasadar) but I downloaded FreeNAS 0.7RC1 (Sardaukar) and it worked like a charm. Very useful article. Thanks.
I have just finished creating the ISCSI targets under FreeNAS 0.7RC1 (Sardaukar)and agree this may be a bug in version 0.7 Khasadar (revision 4919.
Dinesh, this article is awesome. Really easy to follow the instructions. Nice work!
Hi,
It’s nice post.
>>LUN0: format error
I provide some fixes.
Please check iSCSI target updater (binary upgrade) in this thread:
http://sourceforge.net/apps/phpbb/freenas/viewtopic.php?f=53&t=4854&start=20#p24519
Splendid!, excellent!
Hi folks.
I completed all the steps from A to Z but when I’m trying to add the Iscsi into the VM host’s config via vsphere (click on CONFIGURATION , then STORAGE in the middle, then ADD STORAGE on upper right corner, then DICK/LUN option is checked, click NEXT, and then BAM!!! nothing shows up.
I did ALL that was in the article exactly by the book (except IPs and that I gave more significant names to me and my environement wich shoudn’t cause any trouble so far)
FreeNas version / revision:
FreeBSD 7.2-RELEASE-p6 (revision 199506)
0.7.1 Shere (revision 5024)
any hints on what’s going wrong?
Hi Tranthom,
You must check this post to connect FreeNAS iSCSI disks to vSphere,
https://www.sysprobs.com/connect-freenas-iscsi-disks-vmware-vsphere-4-esxi4
Thanks you so much for your post and now I can use but I add one more ISCSI FreeNAS into VMware ESXI it cannot from same iSCSI Adapter ?
i ve configured FreeNAS well, with partitions….
i ve got 3 VMs (1 DC, and 2 for cluster noded)….
when i’m trying to discover with iscsi initiator, it tells me that Connection is Failed. (Firewalls are disconnected on cluster nodes).
what may be a cause of this?
Dinesh – You Rock!! Thanks for you post followed the steps and all works great. I have a little different config as I am using vmware server 2 but all worked good. I had to reboot the NAS a few times for it to see new disks but no big deal. Thanks a bunch!
That’s cool, I helped you in some way.
Constantine,
Have you created LUNs, and iSCSI targets till last step mentioned here? Have you started iSCSI initiator service in FreeNAS? May be this is the silly question, can your VMs communicate to FreeNAS server? Can you ping to it?
If all Ok, I’m sure you will not get the issue again.
thank you Dinesh,
i solved my problem…
Hello! Thanks for the guide.
Just two notes. FreeNAS with ZFS needs at least 1GB RAM to be stable or else it’ll panic. (The screenshot above is from a virtual machine with 256mb RAM.)
It’s easier to create one big disk as in step 21 and then assign multiple LUNs to it as in step 33. I.e. if your disk is 10gb you can create five LUNs of 2gb each. There’s no need for individual physical disks.
@Mathias, Thanks for very useful notes. FreeNAS recommends 512MB Ram. Because of I was using two Windows 2008 R2 servers, windows 2003 server and some client OS as guest in my 3GB host, I had to allocate 256MB only. Anyhow, its just for testing purposes and worked well for R2 Fail over cluster.
I will try big disk with several LUNs.
I followed this directions and got the extent0 set up and from my XenServers I see the iSCSI 1GB drive and I have HA!! This is cool. But for the DATASTORE drive (10GB) I tried following the same steps again but I have problems and questions:
1) in step 29 – do I create a new TAG for the DataStore drive? (I did this)
but then in Step 31 – when I get my DataStore details it shows as “/mnt/DataShare/” and when I try to save I get an error : The following input errors were detected:
* The path ‘/mnt/DataShare’ is a directory.
What am I doing wrong?
Thanks!
@Joseph Moses,
Check the step 33, you have to give a name after /mnt/DataShare/disk1
Let me know if this works.
I cant seem to open the web gui , I tried the URL from my local computer. Any suggestions ?
@Prashanth,
Check the network connectivity to FreeNAS from your local computer. If you are using internet proxy, then add exception for FreeNAS IP.
Hi, Denish…
I’m not native english speaker. so, my English is poor …
But, your article is very very easy for me..
This is a GREATE GREATE document..
Thanks for your helps..
@ JohnBann, Thanks for your comment. This is what I wanted and started this blog.
Hi Dinesh,
I tried to ping the IP address of the storage server from my local machine.It doesnt respond. So , there is not network connectivity between them.
How can I set up a connection.
I am not so good with networks , Any help is appreciated friends.
Thanks
Prashanth