Share files from the host over nethserver samba in a virtual machine

NethServer 8 Core-Version 2.2.6
Module: Samba 2.0.0

Hi community,

is there a way to use a file path from the host for the share folder from samba when nethserver runs in a qemu virtual machine?

I use a ubuntu server with qemu and cockpit.
In cockpit I created a virtual machine with the pre build qcow2 from nethserver.
This runs good.
On the ubuntu server are many files (wich I do not want to put in the qcow2 file) wich I want to share with the nethserver and then share over samba from nethserver.

Now I tried the following:
In cockpit I selected a shared path with the option “Use extended attributes on files and directories”.
Then I mounted it with “mount -t virtiofs [mount tag] /home/samba1/.local/share/containers/storage/volumes/shares/_data” on the nethserver (rocky) virtual machine.
But this does not work.
Than I tried to put the line “[mount tag] /home/samba1/.local/share/containers/storage/volumes/shares/_data virtiofs” in the “/etc/fstab” fiele from the nethserver (rocky) virtual machine and reboot the system.
But this also not work.

I get the following error:
“Error: lsetxattr /home/samba1/.local/share/containers/storage/volumes/shares/_data: operation not permitted”

Any Ideas?

Thanks

Regards

Hi @Mastermind

Maybe you’re winding it up from the wrong end.

The “right” way:

your Ubuntu is - at least samba-wise - becomes a “member server” in a Samba-AD from NethServer.
This way, it directly shares it’s own files, and only getting permissions from samba.

Forcing Samba to share files you’re already mounting via network (resharing) only takes up a lot more resources, and tends to screw up permissions


In a Windows environment, the AD does not reshare files from another host. That other host becomes a member server, and uses the AD permissions to share files directly.
→ Much less load on the AD!

Best Practices for a Windows environment


My 2 cents
Andy

Note: In real life there’s no one “right” way

But there are best practices.

:slight_smile:

2 Likes

Hi @Andy_Wismer ,

many thanks for your answer.

I think we talk about to different things.

I use the ubuntu only as hypervisor for some systems but not as a samba server.
As I understood virtiofs has nothing to do with samba.
Or I am wrong?

Kind regards

Hi @Mastermind

I don’t !!!

Ubuntu Server isn’t a great Hypervisor either. But it does run qemu

In that sense it’s as bad as MS Hyper-V, especially if Ubuntu using Snap (propreitary software, especially the snap store!).
There are MUCH better Hypervisors, which do their task extremly well, eg Proxmox as Hypervisor.

So you can just as easily enable samba client on Ubuntu, connect that Samba client to your NethServers AD and share the files, without even moving them anywhere!.

An AD isn’t really great as file server, it’s intended as AD.

My 2 cents
Andy

1 Like

Hi @Andy_Wismer,
thanks for your answer.

I tried to get Proxmox to work on my hardware but I failed.
Also I tried XCP-ng and failed too.
The Hardware is an Intel Board with VROC.
https://www.intel.com/content/www/us/en/support/articles/000055604/server-products/server-boards.html
So taht is the reason why I use Ubuntu.

I belive you, but for me it is ok and makes the job.

I think i will go the easyest way for me and put the files in the qcow2 file.

Thanks

2 Likes

This looks the simplest solution, however Andy’s idea to configure the existing Ubuntu system also as a SMB file server and AD domain member was good too:

There is no ‘right’ answer; however, I mark Andy’s response as the thread solution if you do not have anything contrary.

2 Likes