How to attach a iscsi to a Virtualbox VM

I got a freenas server where I’m putting all my VMs and I wanted this time to use a ISCSI share to perform the OS installation. This is how I discover my ISCSI targets:

marius@laptop1:~$ sudo iscsiadm -m discovery -t sendtargets -p freenas.local

I have created a VM on Virtualbox but I haven’t created any disks.
The following command will attache a ISCSI target to my VM:

marius@laptop1:~$ VBoxManage storageattach omr1 --storagectl "SATA" --port 0 --device 0 --type hdd --medium iscsi --server freenas.local --target "" --tport 3260
iSCSI disk created. UUID: e97eb93d-c6be-4e29-829a-1169b1b9b1f6

Now we are good to perform the OS installation on ISCSI disk.

Leave Comment

Your email address will not be published. Required fields are marked *