Daylend Posted May 14, 2018 Share Posted May 14, 2018 So I created a new Ubuntu Server 18.04 VM and noticed I had the option to set up an unRAID share and mount tag in the settings. So I put in the following values. Booted into my VM, obviously the mounts weren't visible. So I did some googling and edited my fstab to what I could find: UbuntuServer /home/daylend/UbuntuServer 9p trans=virtio,version=9p2000.L,_netdev,noauto,nobootwait,rw 0 0 Rebooted the server. Nothing appeared. Read that you had to edit some xml files but I also read that's inside the .img file now so it's not changeable? I assume that's what the unRAID share and unRAID mount tag values are for in the web UI now. I also looked through the wiki for more information on unRAID share and unRAID mount tag settings but couldn't find much. How do I get this working? Thanks! 1 Quote Link to comment
BobPhoenix Posted May 15, 2018 Share Posted May 15, 2018 (edited) Did you make a directory inside your VM called /home/daylend/UbuntuServer and then reboot or mount -a to reload fstab? I did the following: Then I created the Directory "/unraid" not that the exact path matters could have used "/mnt/unraid" for instance and used that below instead of /unraid. Then I added the following to fstab and rebooted: unraid /unraid 9p trans=virtio,version=9p2000.L,_netdev,rw 0 0 And I got my user shares from my unRAID server listed when I "ls /unraid" Hope this helps. Edited May 15, 2018 by BobPhoenix 3 7 4 Quote Link to comment
Daylend Posted May 17, 2018 Author Share Posted May 17, 2018 So I went through everything you said, making sure it was all set up correctly... Everything looked good. But it still wasn't working. I noticed your fstab didn't have the lines "noauto,nobootwait", so I removed those, and rebooted. Now it works like a charm! Thanks for the help! ? Quote Link to comment
TristBella Posted October 24, 2018 Share Posted October 24, 2018 Every time I use this feature, the network no longer works. I am using Unraid 6.4.1 with an Ubuntu 18 VM. Quote Link to comment
FoxxMD Posted November 7, 2018 Share Posted November 7, 2018 On 10/24/2018 at 11:18 AM, TristBella said: Every time I use this feature, the network no longer works. I am using Unraid 6.4.1 with an Ubuntu 18 VM. Having the same problem Quote Link to comment
ezhik Posted November 11, 2018 Share Posted November 11, 2018 you have to add it from the beginning, during the VM creation. Quote Link to comment
gmork Posted January 13, 2019 Share Posted January 13, 2019 On 10/24/2018 at 5:18 PM, TristBella said: Every time I use this feature, the network no longer works. I am using Unraid 6.4.1 with an Ubuntu 18 VM. It just changes your NIC to a new name. Mine changed from enp1s0 to enp3s0. Just run "ifconfig -a" to see the new name and then modify /etc/netplan/01-netcfg.yaml accordingly. Quote Link to comment
Joniator Posted April 12, 2019 Share Posted April 12, 2019 On 10/24/2018 at 5:18 PM, TristBella said: Every time I use this feature, the network no longer works. I am using Unraid 6.4.1 with an Ubuntu 18 VM. This is slightly offtopic, but I had the problem related to the steps advocated here, and couldn't easily undo everything since you cant undefine mounted tags and /etc/netplan/01-netcfg.yaml did not exists, plus I can't copy/paste via VNC. If you don't want to reinstall everything, and don't want the useless tag dangling in there/potentially blocking your network, do the following: Shutdown and rename your original machine Create a new machine with the name of the original machine (This will use the right Primary vDisk if you set it to auto) Check if your new Primary vDisk-Location is equal to the original one. Copy the Network MAC from the original machine to the new machine (I'm not sure if this is strictly required, but this way I didn't need to reconfigure DHCP) Run the new machine, delete the original machine (DO NOT DELETE THE DISK) Quote Link to comment
fluisterben Posted April 18, 2019 Share Posted April 18, 2019 On 11/7/2018 at 1:20 AM, FoxxMD said: Having the same problem Actually, what happens is that setting that mount changes the bus number in the XML of the VM, making your network fail. Change it back to what it was initially and your network will be back again. So, if you go to your VMs, click on the icon to Stop it, Edit it and upper right corner shows the XML view button. See here for an example: Quote Link to comment
NLS Posted October 21, 2019 Share Posted October 21, 2019 Is the process still so complex in Oct 2019, for the linux untrained? I want to share my /mnt/user to my NethServer . Can I have a step by step "stupid-proof" guide? 3 Quote Link to comment
danz0l Posted November 22, 2019 Share Posted November 22, 2019 sorry to drag this topic up again. I succesfully followed the steps outlined in this post for my ubuntu 16.04 VM and it works like a charm. Well when i say works, i can successfully mount the unraid shares and read them. However i cant seem to get any of my scripts to write to shares ? Any ideas ? Quote Link to comment
danz0l Posted November 23, 2019 Share Posted November 23, 2019 update: i decided it was too much hassle running that way and ended up mounting my shares via Nfs Quote Link to comment
ezra Posted December 24, 2019 Share Posted December 24, 2019 Also only read permission. Anyone any pointers? Quote Link to comment
AboveUnrefined Posted January 18, 2020 Share Posted January 18, 2020 (edited) On 5/14/2018 at 8:09 PM, BobPhoenix said: Did you make a directory inside your VM called /home/daylend/UbuntuServer and then reboot or mount -a to reload fstab? I did the following: Then I created the Directory "/unraid" not that the exact path matters could have used "/mnt/unraid" for instance and used that below instead of /unraid. Then I added the following to fstab and rebooted: unraid /unraid 9p trans=virtio,version=9p2000.L,_netdev,rw 0 0 And I got my user shares from my unRAID server listed when I "ls /unraid" Hope this helps. Hey man, thanks for this; it worked for a new Arch VM I'm setting up right now, worked perfectly for RW To clarify, what's posted by BobPhoenix is to add the following in your fstab: `tag /mountpoint 9p trans=virtio,version=9p2000.L,_netdev,rw 0 0` you may also make sure that you have the following: /etc/mkinitcpio.conf MODULES=(virtio virtio_blk virtio_pci virtio_net) Edited January 18, 2020 by AboveUnrefined Quote Link to comment
TristanP Posted February 9, 2020 Share Posted February 9, 2020 Has anyone else noticed that if you create a second VM share the "Updating" button stays grayed out and never updates the VM config? The first share works fine but the second one just sits and hangs... Quote Link to comment
testdasi Posted February 10, 2020 Share Posted February 10, 2020 16 hours ago, TristanP said: Has anyone else noticed that if you create a second VM share the "Updating" button stays grayed out and never updates the VM config? The first share works fine but the second one just sits and hangs... That bug is academic because you should not be using 9p (which is required to mount the "share" inside the VM template) due to the terrible performance. Quote Link to comment
MrCTS Posted March 2, 2020 Share Posted March 2, 2020 I signed up for a forum account solely to comment and add that following BobPhoenix comment for the fstab worked fantastically! Was trying to figure out for days how to get it done on Windows, gave up cause the tag wasn't an option and moving on to Debian/Ubuntu. Thanks! Quote Link to comment
twiikker Posted June 10, 2020 Share Posted June 10, 2020 Tried this today and finally got it working but was so disapointed with performance. I can get 3x faster speeds over SMB share than 9p. Quote Link to comment
JonathanM Posted June 10, 2020 Share Posted June 10, 2020 1 hour ago, twiikker said: Tried this today and finally got it working but was so disapointed with performance. I can get 3x faster speeds over SMB share than 9p. You were warned. On 2/10/2020 at 6:20 AM, testdasi said: That bug is academic because you should not be using 9p (which is required to mount the "share" inside the VM template) due to the terrible performance. Quote Link to comment
cleggypdc Posted August 4, 2020 Share Posted August 4, 2020 Thanks for the help in this post, works fantastically. TL;DR of original, here's a step by step guide for creating a mount on VM creation (as of unraid 6.8.3). In the "Unraid Share" section, select the unraid folder that you want to make mountable. This can be an individual share or a parent directory of the share for multiple. e.g `/mnt/user` In the "Unraid Mount tag" section, enter a tag name, this can be anything and will be passed to the VM. e.g `myMountTag` Complete VM setup, power on and install your VM OS or normal. The following steps require root/sudo user. Make a backup copy of fstab in case you mess up your configuration `sudo cp /etc/fstab /etc/fstab.orig` Create a target mount directory where you want to mount your share e.g. `sudo mkdir /path/to/myMountedDir` Edit `/etc/fstab` config by adding the following line to the end of the file, (change tag & path to your needs) `myMountTag /path/to/myMountedDir 9p trans=virtio,version=9p2000.L,_netdev,rw 0 0` Save fstab file and run `sudo mount -a` to check your mount works (there should be no output for on success) You should now have a mounted share in your VM Futher detail For anyone new to unraid, looking for an explanation as to what the fstab values are, here is an explanation <device>: myMountTag <mount point>: /path/to/myMountedDir <file system type>: 9P (The protocol that QEMU uses for a VirtFS) <options>: trans=virtio,version=9p2000.L (our transport for this share will be over virtio, and we specify the 9P version (2000.L) because the default for QEMU is 2000.U. "L" has better support for ACLs, file locking and more efficient directory listing, deletion edge cases etc) _netdev (tells the system that this mount relies on the network, and to delay the mount until a network is enabled) rw (mount as read/write) <dump>: 0 (disables backup via the dump command) <pass num>: 0 (disable any error checking) Cheers! 2 10 Quote Link to comment
moohaha Posted August 18, 2020 Share Posted August 18, 2020 (edited) On 6/10/2020 at 8:40 AM, jonathanm said: You were warned. Since using 9p sounds like a bad idea, I'm playing around with mounting unraid shares as SMB shares or NFS shares in an Ubuntu VM. Having permissions issues but I'll keep trying. What is likely to be the method that gives the best performance - SMB or NFS? Since all the drives are physically connected to the same server I assume all the traffic will be over a virtual NIC and no physical network interface will be involved? Thanks for all the help you all give - it's been a pleasure getting my server setup so far with minimal Linux knowledge thanks to the community. Edited August 18, 2020 by moohaha clarified my questions 1 Quote Link to comment
MJFox Posted October 19, 2020 Share Posted October 19, 2020 so what is the best alternative to mount a (share-)folder from the host into the VM if you want to avoid 9p? I tried to mount the share over SMB and over NFS and set an apache web root to the mounted folder and I got very weird problems like the files disappearing and re-appearing randomly, apache offering the files for download instead of serving them, apache didn't see the latest version of a file until I opened the file on the VM-console etc. 1 Quote Link to comment
Zappmax Posted January 23, 2021 Share Posted January 23, 2021 (edited) Hi to all, i ran into the same this issue. I did the entry like "cleggypcd" mentioned. I updated the /etc/fstab an did try to manual "mount -a" . The result is "mount: unknown filsystem type 9p" Update: The VM is a RHEL 7.3 and Cent OS 7.9 and Unraid Version is 6.8.3 Ubuntu 20.10 is working fine with the above procedure Thanks for any comments Edited January 24, 2021 by Zappmax Quote Link to comment
Progeny42 Posted April 22, 2021 Share Posted April 22, 2021 *Bump* If 9p is a bad way to mount a drive, then would anyone care to explain what the correct way is for best performance? Quote Link to comment
JonathanM Posted April 22, 2021 Share Posted April 22, 2021 SMB (via cifs) is one way, NFS is another. "correct" is not a term I would use, it's all about what works best in your specific application. Treat a VM the same way as you would any other network client that you would connect to your Unraid shares. The VM just has a more direct network connection, the packets don't necessarily need to leave the machine. Quote Link to comment
Recommended Posts
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.