Mount Unraid Share inside a Linux VM


Recommended Posts

Hi,

 

I'd think this should be fairly easy, but my google-skills seem to have failed me tonight. I've got a debian VM running, and simply want to mount or access /mnt/user/Downloads/youtube-dl inside this VM. How can I do this?

 

I'm not sure how "Unraid mount tag" works inside the settings for the VM, but I cant find the share after setting it up there. Tried various mount-tags such as "/mnt/youtube"

 

1574384110_ScreenShot2018-07-03at20_55_50.png.c35978e0a9b7132042265dfc4ce8f899.png 

Link to comment

If I'm understanding https://wiki.qemu.org/Documentation/9psetup correctly the "unRAID Mount tag" field just makes the tag (in your case "youtube") available to be mounted with a normal `mount` command such as:

`sudo mount -t 9p -o trans=virtio youtube /mnt/youtube`

 

Assuming `/mnt/youtube` existed the above command would mount your `youtube` host share location (in your case `/mnt/user/Downloads/youtube-dl/`) at `/mnt/youtube' in your VM.

 

So "unRAID share" doesn't actually auto-mount anything - still need to set that up with fstab as usual.

 

Edited by JonMikelV
Fixed "vrtio" typo
  • Thanks 3
  • Upvote 4
Link to comment
  • 1 year later...
  • 7 months later...
On 8/4/2019 at 2:01 PM, mangopakcet said:

Just wanted to say thanks for the above info, new to unriad/virtio and was keen to test this out, the following worked fine for me 

 

sudo mount -t 9p -o trans=virtio "Unraid Mount tag" /mnt/example

Thanks for that. It works for me aswell.

 

Does anyone know the correct string in /etc/fstab ?

 

greg

Link to comment
  • 3 weeks later...

Here's what ultimately worked for me.

~~~ VM Config:
Unraid Share: /mnt/user
Unraid Mount tag: user

~~~ Addition to /etc/fstab:
#2020-04-14 Sample auto-mount via "Unraid Mount tag"
user        /mnt/user     9p    trans=virtio,version=9p2000.L,_netdev,rw    0    0

I've read that 9p is actually pretty bad for performance but I've never been bothered enough to figure out an alternative. 🙂

Note that I got a pretty big speed boost by adding msize=262144:

user       /mnt/user    9p   msize=262144,trans=virtio,version=9p2000.L,_netdev,rw    0    0

Of course I only tested with a simple dd command, so YMMV:

dd if=/dev/zero of=/mnt/user/testfile bs=1G count=1 oflag=direct; rm ~/mnt/user/testfile

 

Edited by JonMikelV
add msize & performance test info
  • Thanks 3
Link to comment
  • 6 months later...

--- leaving the below for the Google machine to pick up, but I figured this out.

In the command described in this thread,

  • (1) the path at the end is the LOCAL path on the VM. I got confused as hell because unRAID config has you enter a a path on unRAID. This is a "well,duh" moment and I should probably not stay up so late doing this stuff.
  • The directory in the last parameter must exist since it's the local mount point on the VM.

 

In other words, the two lines in unRAID are basically making an alias for the VM to use. So when the vm goes looking for "ubuntudata", unRAID translates that to "/mnt/user/ubuntudata".

 

 

 

Just to add to this old thread, I am having a problem not addressed previously here.

 

I have a Ubuntu VM running in the default location:

/mnt/user/domains/Ubuntu2/vdisk1.img

 

In the VM config I have set the following:

713584760_2020-10-2523_53_54-HatcherNAS_UpdateVM.png.5735be599949d8faa564e887ce00fa32.png

 

Since it says "Unraid Share" I set it up as an ordinary  share. The share is public and exported, SMB enabled but not AFP.

 

I then run the command from inside the VM:

sudo mount -t 9p -o trans=virtio ubuntudata /mnt/user/ubuntudata

Which returns:

mount: /mnt/user/ubuntudata: mount point does not exist.

 

I have tried several different variations of this command including putting quotes around the mount tag, adding/removing trailing slashes, etc. All give that same error.

 

It looks like Ubuntu isn't seeing anything outside its own file system. I did a find for "ubuntudata" and it came back with :

me@ubuntu:/$ sudo find / -name "ubuntudata"
find: '/run/user/1000/gvfs': permission denied

My use case here is that my VM ISO is quite small since it is running on my cache disk. I want to create a storage space for the VM that is separate. I can connect to a regular unRAID share via SMB but I cannot download directly to it, large files fail routinely. I thought this method was supposed to circumvent gvfs?

 

Thanks in advance.

Edited by Zudnic
Link to comment
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.