M.2 + VirtualBox Possible?

Status
Not open for further replies.

Miniwehats

Explorer
Joined
Feb 29, 2012
Messages
70
Hello,

Not sure if this is possible or not but I have a few extra m.2 SSDs around and I was wondering if I could use those to run a VM on VirtualBox Jail instead of my ZFS pool. Only reason would be for performance gains (If any at all).

Right now the VM runs decent but could be faster, not sure if this is an issue with CPU, RAM or just how the jail works with ZFS.

NAS Specs:

Intel i5 Haswell
16gb Ram
Raidz1

VM Specs:
3 cores
4gb Ram
90GB VDI
 

Miniwehats

Explorer
Joined
Feb 29, 2012
Messages
70
Don't see why not. Just create a new pool and add storage the VirtualBox jail: http://doc.freenas.org/9.3/freenas_jails.html#add-storage
OK thank you. I have always had a hard time wrapping my head around Jail storage. I have a 2nd dataset named Jail Storage and I point my Jails to that storage. (See SC). I think I am doing this correct but it does not look correct. Sorry nub question here just trying to understand how to set this up.

Screen Shot 2016-03-18 at 12.10.33 PM.png
Screen Shot 2016-03-18 at 12.10.51 PM.png
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I have a 2nd dataset named Jail Storage and I point my Jails to that storage.
That's an ... unconventional approach. Typically, you would create a dataset for each jail to use as storage, to maintain isolation. Pointing multiple jails at the same storage makes sense for something like a Sonar / SABnzbd combination.
 

Miniwehats

Explorer
Joined
Feb 29, 2012
Messages
70
That's an ... unconventional approach. Typically, you would create a dataset for each jail to use as storage, to maintain isolation. Pointing multiple jails at the same storage makes sense for something like a Sonar / SABnzbd combination.
Create a dataset for each jail to use as storage.... So I would install all Jails to the same root and then create a dataset for each Jail.

So right now I have all my media for Plex in Mnt/Vol0/Media.

If I was to install the Plex jail it would look like this:
Root: mnt/Vol0/Jail
Storage: mnt/Vol0/Plex Dataset

Would I need to move all my data into that "Plex Dataset" location?

Also when I add storage is the Source "mnt/Vol0/Plex Dataset"
and destination "mnt/Vol0/Jail/Plex/Media"?

Sorry for the nub questions but it has been hard understanding this portion of Jails and storage.
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
I have a 2nd dataset named Jail Storage and I point my Jails to that storage.
When I read this, my brain inserted the word "all" between "point" and "my". Is this in fact accurate, that all your jails use the same dataset for storage?

You might want to go read some of the FreeBSD documentation about jails, just for background.

The purpose of a jail is to isolate anything running in it from the rest of the system. Mounting storage in a jail is a way to give something running in it the ability to read or write outside the jail. This is useful for a number of reasons, not least because it means the jail can be deleted and recreated without losing the data. And where necessary, it allows multiple jails to access the same data ... but that's not always desirable.

Source: the path to the folder, as seen from the host system.
Destination: the path to the folder, as seen from inside the jail.

Simply mounting storage in a jail does nothing by itself. Having done so, you then configure whatever is running in the jail to use the Destination path for its data.

Any clearer?
 

Miniwehats

Explorer
Joined
Feb 29, 2012
Messages
70
When I read this, my brain inserted the word "all" between "point" and "my". Is this in fact accurate, that all your jails use the same dataset for storage?

You might want to go read some of the FreeBSD documentation about jails, just for background.

The purpose of a jail is to isolate anything running in it from the rest of the system. Mounting storage in a jail is a way to give something running in it the ability to read or write outside the jail. This is useful for a number of reasons, not least because it means the jail can be deleted and recreated without losing the data. And where necessary, it allows multiple jails to access the same data ... but that's not always desirable.

Source: the path to the folder, as seen from the host system.
Destination: the path to the folder, as seen from inside the jail.

Simply mounting storage in a jail does nothing by itself. Having done so, you then configure whatever is running in the jail to use the Destination path for its data.

Any clearer?
Well that is my problem lol apparently I am fucking dumb and cannot wrap my head around this shit. I have read the entire manual on Jails, I have watched multiple videos of people setting up different jails and it just wont sink in so I apologize for the many questions.

I only have one jail running right now which is Virtualbox. I used to have other jails like Transmission and Plex but I now can do all of that inside Virtualbox anyways so that is the only one I am running.

But my understanding of it now is all the jails can be installed in the same root dataset? Or do I need to change the root dir for each jail I install?

Each Jail I install I need to create a new Dataset for it, example would be VirtualBox has its own Dataset. Source would be that "VirtualBox Dataset" I created and destination would be inside the Jail dir like /media. That way if I drop an ISO into 'VirtualBox Dataset" it would show up in /media to access from the jail to install a VM.

I think I confuse my self as when I brows to my share from my PC I am able to see these Datasets as folders all in the same Dir. Jail, VirtualBox Dataset, etc.... But I need to think of those as separate datasets but it looks like they are all still under the same "parent" dataset if that makes sense?
 

Robert Trevellyan

Pony Wrangler
Joined
May 16, 2014
Messages
3,778
There is a single jails dataset setting in FreeNAS. That's where jails are created. Then there are the datasets you create for data storage for the jails. Maybe this is a source of confusion for you.

You're making it more complicated by running apps in VirtualBox that most people using FreeNAS run in jails. When doing so, you have to think about where the virtual machines are stored and where things like ISOs are stored. That just covers getting the VMs running. Then you also have to think about whether you want to give your VMs access to data that's outside the VirtualBox jail too. That required you to mount storage in the VirtualBox jail and then further to mount that storage in the VMs. The latter is something you can't control from the FreeNAS GUI.
 

Miniwehats

Explorer
Joined
Feb 29, 2012
Messages
70
There is a single jails dataset setting in FreeNAS. That's where jails are created. Then there are the datasets you create for data storage for the jails. Maybe this is a source of confusion for you.

You're making it more complicated by running apps in VirtualBox that most people using FreeNAS run in jails. When doing so, you have to think about where the virtual machines are stored and where things like ISOs are stored. That just covers getting the VMs running. Then you also have to think about whether you want to give your VMs access to data that's outside the VirtualBox jail too. That required you to mount storage in the VirtualBox jail and then further to mount that storage in the VMs. The latter is something you can't control from the FreeNAS GUI.

Yes I think I understand it now. As far as giving storage to the VMs that is fine and easy to do. Also inside the windows VM I am running it is easy to just mount my CIFS share that has all my media for Plex to access.

Only reason I set this up in a VM vs running plex as a jail was just ease to update Plex and the windows version is updated sooner than NAS version.

Thank you for clarifying these for me.
 
Status
Not open for further replies.
Top