'Adding storage to Jail' - permissions error?

Status
Not open for further replies.

SPFrancher

Cadet
Joined
Sep 18, 2016
Messages
6
Hi

I am following https://doc.freenas.org/9.3/freenas_jails.html 13.2.1.2 to give my Ubuntu 14.04 VM access to a dataset in the Freenas storage area.

Freenas sees the folders created in the VM, but from within the VM they aren't there.

I have attached a couple of screenshots, from Freenas and from the Jail, to illustrate what I am seeing.

From Freenas:
upload_2016-9-18_22-56-56.png


Inside the VM:
Code:

root@Ubuntu1404Xeo:/mnt# ls -l
total 0
nasowner@Ubuntu1404Xeo:/mnt$ ls -l
total 0


I think this is some sort of permissions issue, but I am not sure how to proceed, and help would be very much appreciated.

Best regards

SP
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
I don't think it's a permissions issue. Is Video_Share a dataset (did you select it using the file tree?)? What does the Jails->Storage tab look like? Does Video_Share show as mounted?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Try creating the mount point inside the jail. For a long time the create directory checkbooks hasn't worked.

Sent from my Nexus 5X using Tapatalk
 

SPFrancher

Cadet
Joined
Sep 18, 2016
Messages
6
Hi Guys

Thanks very much for your responses. My Jails -> Storage tab shows both 'newtest' and 'installfiles' as mounted. I did add Video_Share using the file tree in the jail 'Add Storage' dialogue.

So, I went in and created the 'newtest' folder <is that the same as 'creating the mount point'?> inside the jail, and added a couple of text doc's. I deleted the 'newtest' storage from the Jail in Freenas, then re-added it using the 'Add Storage' dialogue. Looking at Video_Share from Windows, I can't see the files I had created in the Jail's 'newtest' folder - guess they didn't make it on to Video_Share. Looking the other way, from the Jail, I couldn't see the video files on the Video_share dataset.

I'm really keen to get this figured out, so your help is much appreciated.

SP
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Adding the text document in the jail means nothing. When you mount to that directory they will not be accessable. In the jail what happens if you type 'mount'?

Sent from my Nexus 5X using Tapatalk
 

SPFrancher

Cadet
Joined
Sep 18, 2016
Messages
6
...back for more! Think I am getting closer:

In the Jail:

Code:
nas@Ubuntu1404:/usr/share/mount$ sudo apt-get install nfs-common portmap
nas@Ubuntu1404:/usr/share/mount$ sudo mount -t nfs Free.Nas.IP.Address:/mnt/FreeNas/Video_Share
/usr/share/mount
mount.nfs: Connection timed out 

I tried doing a mount_nullfs instead of a mount but Ubuntu doesn't recognise that command.

I think I am getting closer, but any further help very much appreciated.

Edit: there is some info here about editing /etc/exports but it seems that is more relevant to FreeNas than the Jail. Using the shell in FreeNas, there doesn't seem to be an /etc/exports file.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Let's back up a bit. Is your Ubuntu installation a jail, or a VirtualBox VM (in a VirtualBox jail)? If the former, how did you do it? Linux jails haven't been supported for a long time.

If it's the latter, then you have two ways to expose a directory/dataset on the FreeNAS box to the Ubuntu installation:
  • Share the directory as a network share (CIFS/SMB or NFS, your preference), and mount it in the VM using its native capabilities. This method has nothing to do with adding storage to the jail, but does require good networking between the VM and the FreeNAS box.
  • Use VirtualBox's Shared Folders feature.
It looks like you're running a VirtualBox jail, with an Ubuntu VM inside that jail, and you're trying to do what my first bullet point suggests (which is probably the easier way to go). If that's correct, here are a few things to look at:
  • Do you have an NFS share set up for /mnt/FreeNas/Video_Share?
  • Is the NFS service running on your FreeNAS box?
  • Do the settings of the NFS share allow the VM's IP address to connect?
  • Does your Ubuntu VM have a good network connection to your FreeNAS box? Can you ping the FreeNAS IP address, for example?
 

SPFrancher

Cadet
Joined
Sep 18, 2016
Messages
6
Hi danb35

Thanks very much for your post - very helpful. Ubuntu in a VirtualBox VM (sorry - was a bit sloppy of me).
  • I've now set up a NFS share for /mnt/FreeNas/Video_Share. Hadn't done that before as I assumed (!) the 'Add Storage' sorted that out.
  • NFS service was running on FreeNas already.
  • I think settings are correct for VM to connect
    upload_2016-9-22_22-35-43.png

  • Code:
    nas@Ubuntu1404:~$: ping -c 4 172.xxx.xxx.xx2 (FreeNas IP)
    4 packets transmitted, 4 received, 0% packet loss...
That's with the VM network adapter set to Bridged full promiscuity mode.

But trying to sudo mount from within the VirtualBox Ubuntu VM gives the same time out error.

permissions on the dataset itself are as follows:
upload_2016-9-22_23-0-19.png


making progress - thank you!

SP
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I've now set up a NFS share for /mnt/FreeNas/Video_Share. Hadn't done that before as I assumed (!) the 'Add Storage' sorted that out.
Nope, completely different things. What you're trying to do really doesn't have anything to do with adding storage to your jail, and I'd probably delete that storage mountpoint--it unnecessarily clutters things.

Try clearing out the "authorized IP addresses" field on the NFS export, and see if that makes a difference.
 

SPFrancher

Cadet
Joined
Sep 18, 2016
Messages
6
Most excellent! Cleared out the authorized IP addresses, re-booted the VM and FreeNas, and I can now see the share! Thank you very much indeed.

I can't quite write to the share from the VirtualBox VM, but that is another thing....

Code:
nas@Ubuntu1404:/usr/share$ ls -l
...
drwxrwxr-x   7 nobody:65533      40  Sep 23 00:17 mount
...

(as it happens, I can write to that share from my Windows box on the same network)
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Can you please change your mount point to something under /mnt/. /usr/share/ is a really strange place to mount storage.

Sent from my Nexus 5X using Tapatalk
 

SPFrancher

Cadet
Joined
Sep 18, 2016
Messages
6
LOL - you can tell I'm a noob. I had already decided to change it if for no other reason than there's loads of stuff in /usr/share/ and it's a right pain to spot my /mount/ folder in amongst all that other (no doubt important) stuff.

I have sorted (? - botched) the VirtualBox Ubuntu VM permissions issue for now by setting the NFS share in FreeNas to 'Mapall User: nobody' 'Mapall Group: nogroup'. It's probably hideously unsecure but it works for now!
 
Status
Not open for further replies.
Top