This configures the IP address and port through which FreeNAS will expose the block devices.
The initiator configures the client for access to the block device.
The target relates a Portal with an Initiator, so that your chosen clients can communicate with the correct server IP/port.
An extent is a concept in FreeNAS that exposes a zvol for use in the iSCSI environment. Be sure to read the tip on LUN RPM - in my case I was creating an iSCSI target for a Windows VM, so I chose SSD.
This step correlates An extent will associate the zvol we created earlier with the target we just configured, allowing that target access to that block device.
The last step toward having an operational iSCSI server using FreeNAS is quite possibly the most difficult technical hurdle you may ever encounter. Navigate to the Sharing tab, and toggle "iSCSI" on.
When you create your VM as usual, but don't add a hard drive. You'll get a warning
You are about to create a new virtual machine without a hard drive. You will not be able to install an operating system on the machine until you add one. In the mean time you will only be able to start the machine using a virtual optical disk or from the network.
which you should ignore.
Next, we've got to drop down to the command line, as the VirtualBox GUI doesn't expose the necessary controls for adding iSCSI devices. The command is thus:
VBoxManage storageattach # subcommand to add storage to a VM windows # the name of your virtual machine --storagectl "SATA" # storage interface type --type hdd # device drive type --device 0 # local emulated hardware device index --port 0 # local emulated hardware device port --medium iscsi # use iSCSI --server 10.0.0.2 # FreeNAS server address (from the portal we configured in 1.2) --tport 3260 # FreeNAS server TCP port (from the portal we configured in 1.2) --target "iqn.2005-10.org.freenas.ctl:windows-target"
--target specification, this is pretty easy to figure out. In our (simple) case, it's comprised of two separate elements of the format
B is the Base Name from the "Target Global Configuration" tab under Sharing > Block (iSCSI) > Target Global Configuration, and
T is the Target Name from step 1.4 above.
And that's it. You should now be able to boot your VM (VirtualBox should prompt you for install media as per usual). In my case the performance was surprisingly good, even without any tuning, but watching my network monitor, it was obvious that a sub-Gigabit LAN would have kneecapped the speed.
If something goes wrong, you can look in the VirtualBox GUI under File > Virtual Media Manager and after running the
storageattach command above, you should see an entry for the iSCSI drive. If there is an error, you'll see a warning sign and an error message on hover.
UPDATE: See also Extending Windows C: Drive using VirtualBox and iSCSI with FreeNAS