Page 1 of 1

Mounting a NAS folder in an Ubuntu VM

Posted: Mon Oct 30, 2017 7:21 am
by iain010100
I have been looking to solve this problem for almost a week but no solution has worked for me so far.

I am attempting to permanently mount a media folder I created in the NAS so that a Virtualization Station 3 Ubuntu VM can read and write to that folder.

- I received my QNAP TS-451 a little over a week ago.
- I installed 16gb RAM into the QNAP and a single 8TB hard drive
- I connected both network cables to the switch on my network
- I created a Media folder at the root of the NAS file structure (/Media)
- I created a user (smith) and gave it read/write access to the /Media share in my NAS
- I decided not to use the already provided Multimedia folder because I want to match an existing folder structure
- I set up Plex in the QNAP to read from the media folder (proving that it works)
- I can access the /Media share through my network in Windows and OSX (after prompt for un/pw)
- I don't recall doing anything special to expose the folder on the network, or I don't remember
- I created a Lubuntu VM (because it's light) using the QNAP Virtualization Station 3 software
- I created a virtual switch for the VM so I can access the internet from the VM while also accessing the NAS
- I can reach the media share on the NAS through the Ubuntu VM. The share I want to get to appears in my VM network as

Code: Select all

smb://matrix.local:445/Media

- When I run $pwd on the directory I get this:

Code: Select all

$ pwd
/run/user/1000/gvfs/smb-share:server=matrix.local,share=media

- I can navigate onto the share through the VM with the password I set up in the QNAP
- I also have a Windows 7 VM and can mount the share to a drive letter
- I created a folder to hold the mount at /media/Media with folder permissions of chmod 777

Code: Select all

$ sudo chmod 777 /media/Media


- I created a credentials file at /etc/samba/user with chmod 600

Code: Select all

$ sudo chmod 600 /etc/samba/user


Code: Select all

# /etc/samba/user
username=smith
password=PASSWORD


- I tried various combinations of /etc/fstab. Currently it is:

Code: Select all

# /etc/fstab
//matrix.local /media/Media cifs credentials=/etc/samba/user,isocharset=utf8,sec-ntlm,vers=3.0,noperm 0 0

- plus many other combinations of settings I scraped across the internet of time
- When I attempt to mount with

Code: Select all

$ sudo mount /media/Media  

- I get the following error:

Code: Select all

mount error (95): Operation not supported 
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I don't know where the problem lies (QNAP, the VM, the virtual swtich, Ubuntu, Lubuntu, my permissions, the fstab settings, or something else, am I using the correct smb path?). I verified every setting and configuration as far as I could, and tried many combinations. But no luck. Many solutions and software are deprecated.

I thought it would be simple to mount a QNAP media folder in a QNAP vm. But no.

I am at a loss and any direction would be helpful.

Regards,
Iain

Re: Mounting a NAS folder in an Ubuntu VM

Posted: Tue Oct 31, 2017 3:45 am
by Trexx
1) I would first verify that the SMB share is accessible outside of the NAS with windows PC/etc. That will ensure your SMB is configured correctly.
2) I have used directions similar to this for mounting SMB in ubuntu VM's - http://www.configserverfirewall.com/ubu ... untu-cifs/

As for vSwitch, this tutorial will help you understand the impacts better. The most common use case is bridged where your physical NIC and vm NIC use the same vSwitch.

https://www.qnap.com/en/how-to/tutorial ... on-station

Re: Mounting a NAS folder in an Ubuntu VM

Posted: Tue Oct 31, 2017 6:52 am
by iain010100
1) I would first verify that the SMB share is accessible outside of the NAS with windows PC/etc. That will ensure your SMB is configured correctly.


Yes. I followed these directions exactly and have verified that I can reach my NAS from the VMs (through network in Ubuntu, and setting up drive letter in Windows)
2) I have used directions similar to this for mounting SMB in ubuntu VM's - http://www.configserverfirewall.com/ubu ... untu-cifs/


Yes. I have set up a bridged network and can access my NAS shared folders and the internet at the same time.

My problem is this doesn't work:

Share: smb://10.0.1.25/Media

Code: Select all

$ sudo cat /etc/fstab

# Mounts
//10.0.1.25/Media    /media/Media    cifs    credentials=/etc/samba/user 0  0


Code: Select all

$ sudo cat /etc/samba/user
 
 username=myName
 password=myPassword


Code: Select all

$ sudo mount -a

mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


Anything wrong in my approach?

Re: Mounting a NAS folder in an Ubuntu VM

Posted: Tue Oct 31, 2017 8:59 am
by Trexx
What SMB version do you have your QNAP configured to use?

Re: Mounting a NAS folder in an Ubuntu VM

Posted: Tue Oct 31, 2017 9:54 am
by iain010100
Wow. Fixed.

You asked me what version. I saw I the NAS was set to SMB 2.1 by default. After changing it to 3.0 it worked two seconds later!

Thank you!

Re: Mounting a NAS folder in an Ubuntu VM

Posted: Tue Oct 31, 2017 10:15 am
by Trexx
Your welcome.