Accessing a Virtualized TrueNAS Directly From It's Host

buonomono

Cadet
Joined
Nov 26, 2021
Messages
2
Hi All,

I am thinking of starting a TrueNAS array on a VM (I don't want to spend the money on a second machine, and already have tons of HDD space in my current machines case). My goal is to be able to access my array from my OSX laptop (which is why I am using TureNAS and not just a windows share), and my windows pc (which the TrueNAS VM will run on). Considering the array would be on my local pc, my original impression was that I would be able to read and write to the share at similar speeds, as if it was a local array (I would like to use it as a second hard drive of sorts and run games / host a plex server off of it). However, I overlooked the fact that gigabit ethernet does not transfer at 1GB/s but 125 Mb/s (I would like to accomplish 500 Mb/s on the host pc). I don't need fast speeds on any other device except for the windows pc hosting the TrueNAS VM. My impression was that since my windows pc is hosting the VM, and they share the same motherboard, that the two would be "connected" by an absurdly fast ethernet connection, and it would be as if the two had something like a 10gb ethernet connection between the two. After testing this out with a spare drive, I am realizing that this is not the case. Is there a way for me to force the two machines to talk directly since they share the same ethernet port / motherboard? Is this not possible to do since TrueNAS is in a VM? Lastly, if that is the case, can anyone think of a possible workaround possibly using a windows file share that my mac can access when I am away? I am a tad concerned about that last approach. I have heard that security wise it is not a good idea, but if there is a way to do it safely I am all ears.

Note: I tested this out using TrueNAS Core installed on VMWare with an SSD passed through as its storage drive. The drive shouldn't be the bottleneck here, but until I get drives in I won't be able to test this with the 6 HDD's and the 2 SSD cache's I plan to use.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
It depends on what sort of virtual networking setup you have.
With something like a controller passed through with VT-d (either physical or a virtual function of an SR-IOV device), the guest's network really does begin at the switch, making it functionally independent of the host.
With something like a bridge setup, you could conceivably get higher performance than nominal line speed between guest and host, but they both need to be able to handle it software-wise and the machine needs to be up to the task.

Keep in mind that "sharing the Ethernet port" is not what you strictly want here. If things get as far as that port, you're limited to its line speed. What you need is for the VM network to be a virtual network within the host, bridged to the outside world via the host's connection to said network.
 

buonomono

Cadet
Joined
Nov 26, 2021
Messages
2
It depends on what sort of virtual networking setup you have.
With something like a controller passed through with VT-d (either physical or a virtual function of an SR-IOV device), the guest's network really does begin at the switch, making it functionally independent of the host.
With something like a bridge setup, you could conceivably get higher performance than nominal line speed between guest and host, but they both need to be able to handle it software-wise and the machine needs to be up to the task.

Keep in mind that "sharing the Ethernet port" is not what you strictly want here. If things get as far as that port, you're limited to its line speed. What you need is for the VM network to be a virtual network within the host, bridged to the outside world via the host's connection to said network.
Thank you,

That was super helpful. I gave my VM two network adaptors (the primary being my home network, and the secondary being the Host-Only network inside VMware), and all worked once I figured out the virtual networks subnet. Originally I was not seeing any improvements when writing to a file share. I was thinking this might have been due to SMB so I tried out an iSCSI share instead. To my amazement the write speeds were very fast. The read speeds however were slower than the network share. I assume this is because truenas is using a write cache with the ram. This leads me to believe that the virtual disk I am testing this out within the vm is to blame for the slow read speeds (It is a vdisk on a nvme drive, but that is the only other bottleneck I can think of other than the processing) (I would try it with a spare SSD but I do not have one).

Thanks again for all the help!
 
Top