FreeNAS Server on VMware Workstation with iSCSI Disks

Freenas iSCS

UPDATE- Read more here on setting up windows 2008 R2 cluster in VMware workstation using this iSCSI disks.

VMware is one of the coolest virtualization software. It supports most of the operating systems as guest operating system. Microsoft Server operating systems such as windows 2008 and windows 2008 R2 also can be installed in VMware workstation. Here I’m going to show how you can install FreeNAS server onVMware Workstation with iSCSI disks which can be used for your host and guest operating systems. This method will be used to install and configure MS Windows 2008 or Windows 2008 R2 cluster in VMware workstation.

What is NAS (Network Access Storage)?

Physically NAS is a hardware device with hard drives, and its accessible via network port.  In production environment there are famous NAS brands, such as,

HP
Synology
iomega

These NAS devices support iSCSI, which is required for cluster and high availability setup for servers.  But for the testing purpose in VMware we can’t have expensing physical NAS devices to configure cluster ot high availability servers in VMware. So, there is some free open source NAS software where you can use a computer as NAS. These free storage virtualization software make your computer hard disk as network access storage and allow other clients to access the disk directly through network.

I found these two free NAS softwares can be installed in computer and make NAS.

Openfiler
FreeNAS

This article explains how you can install FreeNAS on VMware workstation virtual machine to enable iSCSI target disks. Why I avoided Openfiler is, because of we will be using this NAS for Windows 2008 or Windows 2008 R2 server clusters. Openfiler doesn’t support SCSI-3 persistent reservation disks which is required for Windows 2008 and windows 2008 R2 server clusters but FreeNAS supports SCSI-3 persistent reservation disks.

How to Install FreeNAS Server on VMware workstation?

1)      Download the stable FreeNAS live CD ISO file here. It’s just 75MB ISO file.

2)      Create a virtual machine in VMware workstation, with following configuration.

Guest Operating System – Other – FreeBSD
Maximum disk size – 2GB

Memory – 2GB

Processor – 1 or 2 ( it doesn’t matter)
Network Adapter – Which ever work with your client computers.

FreeNAS server

FreeNAS server

3)      Select the downloaded FreeNAS ISO file under ISO image file in CD/DVD settings, and boot  the virtual machine with CD drive as first boot device.

4)      Boot the system with first option ( default)

FreeNAS server

5)      If the virtual machine settings and downloaded file is correct, then you next screen will the below one. That’s it, NAS operating is loaded and ready to use.

FreeNAS iSCSI

You can see the network address on NAS which will be given by VMware DHCP. Since this is Live CD version, its running from CD and RAM only. When you boot the NAS operating next time, it will disappear. So we have install it permanently on the virtual machine hard disk. It can be installed on external devices also, including flash device and USB drives.

6)      To install FreeNAS permanently on hard drive, type number 9 and press enter in above screen.

7)      Select the first option in first screen and press OK.

FreeNAS iSCSI

8)      Press OK for warning/instruction message.

9)      Installation media will be your virtual machine CD drive where we mounted the ISO file. Press OK in the next screen.

10)   Select the 2GB hard disk we created during the virtual machine setup. Once we installed FreeNAS on this hard disk, then it cannot be used for create volumes or share data. So how to create disks for cluster or as iSCSI targets. Do not worry; we will add hard disks later to virtual machine in live.

FreeNAS iSCSI

11)   Confirmation message will be shown as below after the installation succeeded.

FreeNAS iSCSI

12)   Shutdown the system by pressing number 8. Then un mount the installation ISO file under CD/DVD drive, then start the FreeNAS virtual machine.

13)   Now you can’t see the number 9 option. Type number 2 and press enter to change the IP address of FreeNAS network virtualization software.

FreeNAS iSCSI

14)   Select ‘No’ for DHCP option, give IPv4 address, you can select the Subnet mask by typing 24 or 16 or 8 in the next screen. Gateway, DNS and IPv6 are optional setup as per your requirements.

15)   One network settings confirmation message will be shown as below with accessible address.

FreeNAS iSCSI

Installation of NAS on VMware workstation and network setups is done. Now, interesting part; configuring disks, volumes and LUNs in your Network Access Storage (NAS).

16)   Access the above address in internet explorer from other client computer. You will be getting login screen for FreeNAS.

User Name is – admin

Password is – freenas

FreeNAS user name and password can be reset in console setup by selecting number 3.

storage virtualization

17)   Welcome screen will give the information of NAS. Still no disks configured in your NAS.

storage virtualization

18)   Let’s add the disks to FreeNAS now.  Just for example we will add two disks. One with 512MB for quorum disk and other one 10GB for data share.

19)   Add the above hard disks to FreeBSD virtual machine where we installed FreeNAS. You do not need to shutdown the FreeNAS. It can be added when it’s working. I’m assuming you know how to add additional hard disks to a virtual machine is VMware. (Select SCSI disk type, better select ‘Allocate disk space now’ to improve the performance.)

20)   To add a disk in NAS, Click on Disks on the menu and select management. Click + sign at right side in next screen.

addmanagement

21)   Select the newly added disk to virtual machine from drop down box. Lets add our quorum disk 512MB.

storage virtualization

You can give any description also for your reference. Since we are preparing NAS on VMware workstation as iSCSI target for Windows 2008 server cluster, select ZFS Storage pool device in file system as shown above. Press Add.

22)   Every time after any changes in FreeNAS you have press Apply changes button. Press the button in next screen.

storage virtualization

23)   Once the disk added successfully, the below screen can be seen.

successdisk

24)   Go to Disks in main menu and select ZFS.

ZFS

25)   Click on Virtual devices in next screen menu and Press + sign at right side. Give a name, leave the type as Stripe, and select the disk under devices. Then apply changes.

storage virtualization

26)   Click on Management tab next to Virtual Device in same screen. Give a name; leave others options blanks (you can add description). Press Add and Apply.

storage virtualization

27)   Now go to iSCSI Targets in Services (main menu)

virtualization software

28)   Enable the check box at right side and press save and restart button. It will start the iSCSI service in your FreeNAS virtual machine.

iscsienable

29)   Click on portals tab. It will pick up your FreeNAS IP address with 3260 port number. Do not change anything here.  Just press add and apply changes buttons.

portal

(I’m writing this article from two computers, so IP address of my FreeNAS is different than installation and configuration, ignore it)

30)   Now click on initiators tab and leave the all settings as it is and press add, apply changes.

initiatorgroup

31)   No go back to Targets tab and press + at right side under Extend. Press browse button as shown below.

target1

32)   It will bring the pool you created as a directory. Click on it and press OK button at top right side.

parentdirectory1

33)   You have to type a name for the extending disk. In this example I have typed ‘ quorum’ after the selection. It better to give slightly lesser the actual size. That’s why I have given 500 MB.

virtualization software

Press add and apply changes.

34)   To add the iSCSI target and LUNs in NAS, click on + mark at the right side under target in targets. Give a name for target, make sure Read/Write is selected under flags. Under LUNs, select the extended disk you created in earlier step. Leave the other settings and press add, apply changes.

virtualization software

35)   iSCSI target in your NAS VMware workstation settings will be appeared as below if all setup are correct.

virtualization software

Other clients including Windows 2008 server and windows 2008 R2 servers looking for iSCSI disks will be finding the disks in the name mentioned above.

Repeat the same steps to add disks to FreeNAS and configure NAS  iSCSI targets in VMware workstation.

I will be updating soon about how to do windows 2008 R2 cluster in VMware workstation using this iSCSI targets.

FreeNAS Server iSCSI disks in VMware Workstation – Download the FreeNAS now.

Recommended Posts

Comments

  1. Srujan Mandalapu says:

    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.

    • sayda says:

      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??

      • Jon says:

        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.

      • Jon says:

        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.

  2. Edmund says:

    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

  3. Dinesh says:

    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.

  4. Karthik M says:

    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

  5. Roy says:

    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..

  6. Roy says:

    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. :-o

  7. Dinesh says:

    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.

  8. theo says:

    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.

  9. Edmund says:

    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.

  10. Dinesh, this article is awesome. Really easy to follow the instructions. Nice work!

  11. aoyama says:

    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

  12. Romashkarom says:

    Splendid!, excellent!

  13. Tranthom says:

    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?

  14. Dinesh says:

    Hi Tranthom,
    You must check this post to connect FreeNAS iSCSI disks to vSphere,
    http://www.sysprobs.com/connect-freenas-iscsi-disks-vmware-vsphere-4-esxi4

  15. Luke says:

    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 ?

  16. Constantine says:

    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?

  17. Rob says:

    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!

  18. Dinesh says:

    That’s cool, I helped you in some way.

  19. Dinesh says:

    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.

  20. Constantine says:

    thank you Dinesh,
    i solved my problem…

  21. Mathias says:

    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.

    • Dinesh says:

      @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.

  22. 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!

  23. prashanth says:

    I cant seem to open the web gui , I tried the URL from my local computer. Any suggestions ?

    • Dinesh says:

      @Prashanth,
      Check the network connectivity to FreeNAS from your local computer. If you are using internet proxy, then add exception for FreeNAS IP.

  24. JohnBann says:

    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..

  25. Prashanth says:

    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

  26. Prashanth says:

    Hi ,

    I got it working now. I just started the web interface from one of my nodes which I am gonna put in the cluster.

    Thanks
    Prashanth

  27. Prashanth says:

    Ok… My next hurdle, lol…. I get this connection failed message when I try to add the target portal in the ISCSI initiator properties in my windows nodes.
    Any ideas friends ?

    Thanks
    Prashanth

  28. aazpf1 says:

    yes Prashant. me too.
    I can ping the FreeNAS machine from another VM, and from this same VM i can open the FreeNAS interface,
    but i cannot find the target from iSCSI initaitor. exception is set in fw.
    any suggestion please.
    great job BTW!!!!

  29. Prashanth says:

    @aazpf1 : I figured out about the connection failure message. You know when we add portal in the web gui for configuring disks. I had given the same port number for both disks. 3260. One was my data disk and other I created for quorum. So I went and changed the port number for one disk to 3261.And I was able to connect. Hopefully this helps.

    @Dinesh — This is an awesome article, helped me to create win2008 cluster. I am very thankful for your efforts in posting this article and helping others. Good job friend.

    • Dinesh says:

      @Prashanth,
      Good, finally you managed to setup disks and cluster.
      Yes, setting up latest 2008 or R2 cluster in single computer is fun and excited, useful for learning also.

  30. Ram says:

    Hi Dinesh,

    Thanks for a such a great article.

    I am having a problem while trying to add a 1 GB disk. I followed the same steps and at 31st step, when I click on browse button, the UI hangs for while and nothing turns up as you said ‘It will bring the pool you created as a directory. Click on it and press OK button at top right side.’

    Could you pls help me figure out the issue here ?

    Awaiting for ur response.

    • Dinesh says:

      @Ram, any luck?

      If you follow the all steps correctly then all should be OK.

      Do you have any pop-up blocker in your internet browser? It may stop the next screen.
      Let me know.

  31. Ram says:

    Hi Dinesh,

    Sorry for the delay in response and yes, it is working fine now.

    Thanks for checking.

  32. JRSS says:

    Hi,

    I have 2 servers and boths can see on disk created on freenas.
    The disk are divied in 3 partitions : /ocr1 /ocr2 /ocr3.

    I mounted and formated these partitions with ocfs2 format.

    After create a file on on partition on server1, i go to server2 and the file is not there. if i reboot the server2 the file is there.

    Any help?????

    Thanks in advanced

    • Dinesh says:

      @JRSS,
      You didn’t mention which server OS you are using.
      Anyhow, I used FreeNAS shared disks with Windows OSs only and never had any issues. Even both servers read the shares correctly and I managed to setup fail over cluster also.
      I’m sure your servers are not Windows OSs. I can suggest one thing, if you are facing this issue only on server2 all the time, then some thing could be wrong on this server disk connectivity or reading/refreshing intervals.
      I’m not sure though. Sorry my friend.

  33. anuj says:

    thanks mate u made my day

  34. Tomeu says:

    Hello, I’ve have recently tested this tutorial with the same error 1.

    I solved adding 2 discs to the virtual machine that holds FreeNas, as if they were two partitions.

    Install FreeNas in one of them , and iSCSI drive ZFS on the other, and the error 1, won’t appear.

    good luck.

  35. san says:

    iSCSI SAN with CDP (Snapshot Continus Data Protection), free iSCSI SAN software for windows.

  36. Hello:

    Thank you for writing this and including all the screenshots. It helped a lot. I used most of your instructions to install FreeNAS on VMware ESXi 4.1. I used the file FreeNAS-amd64-LiveCD-0.7.2.5543.iso which will work on Intel 64-bit even though it has “amd64″ in the file name. I was able to get my Server 2003 VM to connect to the iSCSI target. Eventually I will set up a Windows Server 2003/Exchange Server 2003 two-node cluster (yeah, I know that’s old, but we use it at work so I’d like to try to set one up at home).

    In your instructions you used two disks – one for quorum and one for data. I don’t know if you ever tried, but you can use one disk and create multiple extents and targets from it.

  37. TN says:

    Please do not confuse between NAS and SAN. FreeNAS provides iSCSI SAN for Windows clustering.

  38. Pavan Goda says:

    Hi Dinesh,

    Thanks for your contribution, this blog seems to be very helpful.
    I am currently trying to install “FreeNAS-8r5698-amd64.iso” in my Windows XP SP3 32 bit O/S through VMWare Workstation 6.5.3 and got ‘BTX halted’ error at the very first step, can you please help me.

  39. Liam Toh says:

    You have a wonderful site here, but I cannot see the pictures, they are blank. When I right-click and select show pictures, nothing happens.

    Regards,
    Liam

    • Dinesh says:

      Liam,
      Thanks a lot for the information.
      Two days ago I moved this complete site to different hosting server, which caused the issue. Its fixed now.
      Enjoy now. Sorry for the inconveniences.

  40. Juniper says:

    Hi this tutorial is great but I have downloaded the latest freenas (version 8) and the layout and options are completely different. Is it posible to update the tutorial with screenshots and instructions based on this version. For example, I cannot find the disk button and I cannot find the version you used!!

    I probably should be able to work it out but do not have experience in storage.

    thanks

    J

    • Juniper says:

      Update: I can see you have a tutorial on how to install freenas 8 but I am looking for the configuring of disks and presenting it element.

  41. nicola says:

    Hi,

    I have 2 Windows 2003 ent servers and boths can see on disk created on freenas.
    The disk are divied in 2 partitions.

    I mounted and formated these partitions in wondows 2003 server

    After create a file on on partition on server1, i go to server2 and the file is not there. if i reboot the server2 the file is there.

    Any help?????

    Thanks in advance

    • Hi Nicola: A LUN cannot be accessed at the same time by two servers (at least not with Windows Server 2003). Whichever server connects to the LUN first will lock it for its own use. When you rebooted server2, it took the LUN connection away from server1, so that’s probably why you were able to see the file. You should have the servers set up in a cluster. When you fail over the disk from server1 to server2 (using Cluster Admin) it will allow server2 to access the disk. That is the safest way to share a LUN between two servers–you must use some type of cluster program, otherwise you can corrupt the disk and cause other problems.

  42. Bogeyman says:

    Thank you for taking the time to write an absolutely awesome article and to share it with the rest of us! You da man!

  43. Rrh says:

    Hello. I have configured my win 2008 r2/freenas clustering environment in vmware wkst 7. When I run the cluster validation test on each indiv node separately (I have 2 nodes) it passes all tests. When I run the validation test and select the 2 nodes together the test fails on storage and networking. Can anyone tell me why this may be happening? Thanks.

  44. Guruprasad says:

    Hi Dinesh,

    I have follows your steps to install NAS OS, however am not able to access the Web GUI.

    My host machine subnet is 255.255.248.0 accordingly whine configuring LAN for freeNAS i gave 21 as subnet (As this the CIDR no for the above mentioned subnet)
    Please let me know how to solve this.
    Thanks,
    Guru

  45. Very fantastic info can be found on site .

  46. Geat job! Do you have any plans to review Openfiler when guys would catch up with SCSI-3 reservation thing?

    Anton

  47. Pramod says:

    I have downloaded freenas latest version and tried installing the iso file in vmware workstation by creating new VM as other freeBSD 32bit/64 bit. It pops with initial screen and ends with BTX halt. How can i solve this issue? My LAPtop OS is windows 7. Please help me.

  48. Raul B. says:

    The images has been lost ¿Problems?

    Saludos

  49. Alex Reyes says:

    hi Dinesh, thank you so much for this article, it is very useful.
    It seems to be that only available download of freeNAS is version 8.0 from RC1 to release version.
    I installed this and after installation and configure NICs I am unable to see web page giving an error as done but with errors.
    I tried different browsers but still unable to see web admin page.

    Thank you!

Speak Your Mind

*