Mounting a NAS folder in an Ubuntu VM

Discussion about using NAS on Linux and Unix OS.
Post Reply
iain010100
Starting out
Posts: 15
Joined: Sun Oct 29, 2017 12:56 am

Mounting a NAS folder in an Ubuntu VM

Post by iain010100 » Mon Oct 30, 2017 7:21 am

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

User avatar
Trexx
Ask me anything
Posts: 5304
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: Mounting a NAS folder in an Ubuntu VM

Post by Trexx » Tue Oct 31, 2017 3:45 am

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
Paul

Model: TS-877-1600 FW: 4.4.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x 500GB Evo 860
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
GPU: EVGA GTX 1060 6GB
UPS: CP AVR1350

Model:TVS-673 32GB FW: 4.4.3.x Test/Backup Box
Model:TS-228a FW: 4.4.3.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

iain010100
Starting out
Posts: 15
Joined: Sun Oct 29, 2017 12:56 am

Re: Mounting a NAS folder in an Ubuntu VM

Post by iain010100 » Tue Oct 31, 2017 6:52 am

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?

User avatar
Trexx
Ask me anything
Posts: 5304
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: Mounting a NAS folder in an Ubuntu VM

Post by Trexx » Tue Oct 31, 2017 8:59 am

What SMB version do you have your QNAP configured to use?
Paul

Model: TS-877-1600 FW: 4.4.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x 500GB Evo 860
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
GPU: EVGA GTX 1060 6GB
UPS: CP AVR1350

Model:TVS-673 32GB FW: 4.4.3.x Test/Backup Box
Model:TS-228a FW: 4.4.3.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

iain010100
Starting out
Posts: 15
Joined: Sun Oct 29, 2017 12:56 am

Re: Mounting a NAS folder in an Ubuntu VM

Post by iain010100 » Tue Oct 31, 2017 9:54 am

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!

User avatar
Trexx
Ask me anything
Posts: 5304
Joined: Sat Oct 01, 2011 7:50 am
Location: Minnesota

Re: Mounting a NAS folder in an Ubuntu VM

Post by Trexx » Tue Oct 31, 2017 10:15 am

Your welcome.
Paul

Model: TS-877-1600 FW: 4.4.3.x
QTS (SSD): [RAID-1] 2 x 1TB WD Blue m.2's
Data (HDD): [RAID-5] 6 x 3TB HGST DeskStar
VMs (SSD): [RAID-1] 2 x 500GB Evo 860
Ext. (HDD): TR-004 [Raid-5] 4 x 4TB HGST Ultastor
RAM: Kingston HyperX Fury 64GB DDR4-2666
GPU: EVGA GTX 1060 6GB
UPS: CP AVR1350

Model:TVS-673 32GB FW: 4.4.3.x Test/Backup Box
Model:TS-228a FW: 4.4.3.x Test/Backup Box
-----------------------------------------------------------------------------------------------------------------------------------------
NAS RAID Rebuild Times | Live QTS Videos | | QNAP NAS Guide | Information needed when you ask for HELP | QNAP Links, Tutorials, etc.
2018 Plex NAS Compatibility Guide | QNAP Plex FAQ | Moogle's QNAP Faq

Post Reply

Return to “Linux & Unix (NFS)”