Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

9P Sharing files between host and guest

Featured Replies

  • Author

With both. With cifs sometimes shares wouldn't mount.  They always did by doing this. But with cifs it was more to wait for the network. I think with passthrough it times out if there's a delay waiting for a share to mount. For me this seems to work best by letting the vm boot then mounting shares and starting apps last.

  • Replies 60
  • Views 49.7k
  • Created
  • Last Reply

Hi archedraft,

Any  reason to use the  /etc/rc.local ?

 

If you skip that, and  do

mount -a

after you have edit the fstab and created the mount directories in your VM, what do you see? are the share mounted ? thats the way I used it. no extra mount command in other files.

 

//Peter

 

With auto mount it will error during vm boot sometimes.  Sometimes it would get stuck during boot saying press m or s or something like that. But when you manually mount with rc.local it always works.

 

I used it as a precaution because of what dmacias had indicated in his original post. I figured I would start on the side of caution and see how the P9 passthrough works and if I have no issues I may try it without using rc.local and noauto. Although "if it ain't broke don't fix it" comes to mind.

 

So far it is working great without any issues.

Speed and I think it's more benefit than SMB

 

With editing fstab (like I did above) a few of my apps (sickbeard) loaded before the shares were mounted. To fix this I created a crontab task that delayed the startup of sickbeard for 10 seconds after boot. Does the 9P sharing mount the shares before the apps are loaded in rc.local?

The advantage is not using your virtual network especially for intensive operations like, par, rar, usnet and torrents.

 

I had a problem with sickrage and nzbget.  I renamed the init symlinks in /etc/rc2.d of my apps from 20 to 99 so they start last.  Then changed rc.local from 99 to 98. Check this page it explains the different rc.x runlevels. You'll have to check which level your vm runs or just change them all, rc0.d, rc1.d...rc6.d

http://www.linux.com/news/enterprise/systems-management/8116-an-introduction-to-services-runlevels-and-rcd-scripts

 

By doing this you could also make it so one app starts before the other.

 

dmacis, did you go through each rc0-6.d and find all your applications and set them to 99? or when you installed them did you set them up to 99? Currently I am still using a crontab and delaying my applications at boot by 10 seconds but from what I read online this is a dirty way of doing that.

  • Author

I don't remember where I look or what command I ran to find my runlevel but it was 2. So I only changed rc2.d. There probably is a command switch to change that when you install the init defaults but I just manually did it. I just sftp to my vm and renamed the symlinks in rc2.d

I ran the command

who -r

and it told me

run-level 2

 

That means that all applications should get install on run-level 2 correct?

  • 2 months later...

I noauto because sometimes it errors out at vm startup.  So I just put "mount /mnt" in /etc/rc.local  I run this in an apps vm and I had to modify rc.local to start before the apps so unraid user shares are mounted before any apps. Been working well for a couple weeks with everything located in /mnt on unraid available in my apps vm under the same /mnt. No network problems, rocket rides or cifs mounting needed like in xen.

 

Thought I'd chime in with a better way to work around this issue.  In your fstab, add _netdev to your options.  This will force the VirtFS mounting (even with auto) to wait until the network resources are available, which just so happens to solve the issue where sometimes the automounting would fail.  We do this with our OpenELEC unVM and it works perfect.

I noauto because sometimes it errors out at vm startup.  So I just put "mount /mnt" in /etc/rc.local  I run this in an apps vm and I had to modify rc.local to start before the apps so unraid user shares are mounted before any apps. Been working well for a couple weeks with everything located in /mnt on unraid available in my apps vm under the same /mnt. No network problems, rocket rides or cifs mounting needed like in xen.

 

Thought I'd chime in with a better way to work around this issue.  In your fstab, add _netdev to your options.  This will force the VirtFS mounting (even with auto) to wait until the network resources are available, which just so happens to solve the issue where sometimes the automounting would fail.  We do this with our OpenELEC unVM and it works perfect.

 

Would you mind posting the contents of your fstab?

  • Author

I noauto because sometimes it errors out at vm startup.  So I just put "mount /mnt" in /etc/rc.local  I run this in an apps vm and I had to modify rc.local to start before the apps so unraid user shares are mounted before any apps. Been working well for a couple weeks with everything located in /mnt on unraid available in my apps vm under the same /mnt. No network problems, rocket rides or cifs mounting needed like in xen.

 

Thought I'd chime in with a better way to work around this issue.  In your fstab, add _netdev to your options.  This will force the VirtFS mounting (even with auto) to wait until the network resources are available, which just so happens to solve the issue where sometimes the automounting would fail.  We do this with our OpenELEC unVM and it works perfect.

Where was this info 3 months ago :)  When would that share be mounted in the boot process? Another problem I would see is that apps like sickbeard would be loaded before the drive mounted.  It was another reason for rc.local mount with S98 and apps with S99.  I've started and stopped the vm dozens of times and never had a failure this way. I'm willing to try out the auto mount again but before with default S20 for apps things wouldn't always work.

 

I noauto because sometimes it errors out at vm startup.  So I just put "mount /mnt" in /etc/rc.local  I run this in an apps vm and I had to modify rc.local to start before the apps so unraid user shares are mounted before any apps. Been working well for a couple weeks with everything located in /mnt on unraid available in my apps vm under the same /mnt. No network problems, rocket rides or cifs mounting needed like in xen.

 

Thought I'd chime in with a better way to work around this issue.  In your fstab, add _netdev to your options.  This will force the VirtFS mounting (even with auto) to wait until the network resources are available, which just so happens to solve the issue where sometimes the automounting would fail.  We do this with our OpenELEC unVM and it works perfect.

 

Would you mind posting the contents of your fstab?

 

This is actually in /etc/mtab because we don't need fstab for our OpenELEC VM:

 

storage /storage 9p rw,dirsync,relatime,trans=virtio,version=9p2000.L,posixacl,cache=loose 0 0

I noauto because sometimes it errors out at vm startup.  So I just put "mount /mnt" in /etc/rc.local  I run this in an apps vm and I had to modify rc.local to start before the apps so unraid user shares are mounted before any apps. Been working well for a couple weeks with everything located in /mnt on unraid available in my apps vm under the same /mnt. No network problems, rocket rides or cifs mounting needed like in xen.

 

Thought I'd chime in with a better way to work around this issue.  In your fstab, add _netdev to your options.  This will force the VirtFS mounting (even with auto) to wait until the network resources are available, which just so happens to solve the issue where sometimes the automounting would fail.  We do this with our OpenELEC unVM and it works perfect.

Where was this info 3 months ago :)  When would that share be mounted in the boot process? Another problem I would see is that apps like sickbeard would be loaded before the drive mounted.  It was another reason for rc.local mount with S98 and apps with S99.  I've started and stopped the vm dozens of times and never had a failure this way. I'm willing to try out the auto mount again but before with default S20 for apps things wouldn't always work.

 

Been hard at work on core NAS features and had to put the virtualization stuff on hold for a bit.  About to kick that up into high gear again.

I noauto because sometimes it errors out at vm startup.  So I just put "mount /mnt" in /etc/rc.local  I run this in an apps vm and I had to modify rc.local to start before the apps so unraid user shares are mounted before any apps. Been working well for a couple weeks with everything located in /mnt on unraid available in my apps vm under the same /mnt. No network problems, rocket rides or cifs mounting needed like in xen.

 

Thought I'd chime in with a better way to work around this issue.  In your fstab, add _netdev to your options.  This will force the VirtFS mounting (even with auto) to wait until the network resources are available, which just so happens to solve the issue where sometimes the automounting would fail.  We do this with our OpenELEC unVM and it works perfect.

 

Would you mind posting the contents of your fstab?

 

This is actually in /etc/mtab because we don't need fstab for our OpenELEC VM:

 

storage /storage 9p rw,dirsync,relatime,trans=virtio,version=9p2000.L,posixacl,cache=loose 0 0

 

Thanks! do you have anything in the "/etc/rc.local" file to mount this share or does it just automount?

I noauto because sometimes it errors out at vm startup.  So I just put "mount /mnt" in /etc/rc.local  I run this in an apps vm and I had to modify rc.local to start before the apps so unraid user shares are mounted before any apps. Been working well for a couple weeks with everything located in /mnt on unraid available in my apps vm under the same /mnt. No network problems, rocket rides or cifs mounting needed like in xen.

 

Thought I'd chime in with a better way to work around this issue.  In your fstab, add _netdev to your options.  This will force the VirtFS mounting (even with auto) to wait until the network resources are available, which just so happens to solve the issue where sometimes the automounting would fail.  We do this with our OpenELEC unVM and it works perfect.

 

Would you mind posting the contents of your fstab?

 

This is actually in /etc/mtab because we don't need fstab for our OpenELEC VM:

 

storage /storage 9p rw,dirsync,relatime,trans=virtio,version=9p2000.L,posixacl,cache=loose 0 0

 

Thanks! do you have anything in the "/etc/rc.local" file to mount this share or does it just automount?

Well OpenELEC is a little unique in how we do that as we have actually even further refined its design to eliminate using an image file and improved boot time by orders of magnitude. More on this soon...

Also thank you so much for posting your mtab config! These settings fixed an issue I was having with a certain app and 9P shares. The app refused to play nice with the 9P share but now it's working!!  ;D I am so excited, VM's are awesome!

  • Author

For those of you who are using 9p can you guys take a look here:  http://lime-technology.com/forum/index.php?topic=36345.0

 

Something isn't jiving.  I have 9p working (at least as far as accessing local shares) but the speed sucks!

 

John

Try adding msize=262144 to your fstab line.  It doubled it for me to 30 MB/s.  I was copying a large file from downloads (my cache drive) in my vm to /tmp.

I'll do that but I thought the attraction of 9p was to get native speeds.  Not true?

 

EDIT:  I added msize=262144 but it made no difference.

  • Author

I'll do that but I thought the attraction of 9p was to get native speeds.  Not true?

 

EDIT:  I added msize=262144 but it made no difference.

I assume you rebooted your vm or umounted and mounted. Maybe those 9p errors mean something. I read something about 9p net and initrmfs and adding virtio modules.

 

For me I never even tested speed. 9p was about reliability.  Coming from xen and rocket rides and cifs mounting.

Yep...rebooted.  But quite honestly I get faster speeds for NFS and CIFS.  I know reliability is a major point but I want the speed!  :)

Yep...rebooted.  But quite honestly I get faster speeds for NFS and CIFS.  I know reliability is a major point but I want the speed!  :)

 

I posted in your other thread about this too.  You have something funky going on that's affected your performance.  As a short-term workaround, you could use NFS or SMB from your VM if you get better performance that way.  Longer-term, VirtFS will be better for you, but investigating the proper config and diagnosing a root cause is a little ways out for us right now.  There's lots of reading out there on how you can tweak VirtFS, but there's also a lot of outdated stuff you have to sift through first.

Is it possible to do 9P sharing with Windows 8.1?

Is it worth it to do so if it is possible?

What are Pros/Cons?

 

Thanks!

  • Author

Is it possible to do 9P sharing with Windows 8.1?

Is it worth it to do so if it is possible?

What are Pros/Cons?

 

Thanks!

No there are no 9p pci drivers written for windows

  • 2 weeks later...

I just had another thought (imagine that).  :)

 

I currently use 9p on each of my xbmc/openelec clients to access media on my server directly.  Can the same be done with a shared xbmc library (mysql/mariadb)?  Could I passthrough /mnt/cache/docker/mariadb to /storage/db on each of my clients and then change the advancedsettings.xml accordingly?  Would you tell it to connect to localhost:3306?  I can't imagine that this would work but what do I know.

 

EDIT:  Saw this on the xbmc wiki but would still like to hear opinions...

 

Even if the media is on the same computer as one of the XBMC instances, you MUST use a network share path. You cannot use a local file path with MySQL.

 

John

  • Author

 

 

I just had another thought (imagine that).  :)

 

I currently use 9p on each of my xbmc/openelec clients to access media on my server directly.  Can the same be done with a shared xbmc library (mysql/mariadb)?  Could I passthrough /mnt/cache/docker/mariadb to /storage/db on each of my clients and then change the advancedsettings.xml accordingly?  Would you tell it to connect to localhost:3306?  I can't imagine that this would work but what do I know.

 

EDIT:  Saw this on the xbmc wiki but would still like to hear opinions...

 

Even if the media is on the same computer as one of the XBMC instances, you MUST use a network share path. You cannot use a local file path with MySQL.

 

John

 

It won't work .  Just a plain xbmc install uses a  sql lite database not mysql database.  So you'd have to run a mysql server on each client also.

  • 1 month later...

Had a little tinker about with this as it seemed intriguing.

 

made a debian wheezy vm (have to select basic server utilities in tasksel)

 

 

modded user nobody to uid 99 in the vm and ran what apps i had as user nobody and group users, chown'ed the apps install folder and config output folders to nobody:users, and chmod 775

 

added dfltuid=99 and dfltgid =100 to the mount option in /etc/fstab and it worked like a charm with all my files written with the right ownership to suit unraid.

 

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.