Page 1 of 1
Samba share on Linux VM
Posted: 5. May 2020, 06:38
by noobcoder
Hello everyone, I am having problem where I have a samba share on a shared folder on my Ubuntu VM. When I create a samab within the virtual hdd everything works fine. When I created a shared folder on another hdd in my pc I can create a new folder within the windows host I cannot rename it or delete it. If i go into the linux os I can delete it. If I ssh in to my vm I can delete the folder. I cannot delete it from the windows host though. Can anyone assist?
Re: Samba share on Linux VM
Posted: 5. May 2020, 09:51
by mpack
Why do you think VirtualBox is relevant to your question? If you have a working SAMBA share then that's a straight up networking solution and VirtualBox doesn't have anything to do with it, so nothing you can or can't do with it are VirtualBox issues either.
Re: Samba share on Linux VM
Posted: 5. May 2020, 19:19
by scottgus1
Just want to add in, you must have the right kind of network for shared/samba folders to be seen & usable. You have a network because you can SSH into the guest. But If the guest is set to NAT then at least ports must be opened. (I don't know which ports, or if there are appropriate ports to share/samba through a NAT router.)
Use Bridged, if you're on a wired LAN (Wi-Fi might or might not work too) and want the guest and its shared folders to be on the LAN. Use Host-Only to just allow the guest and host to have a private "wired" Ethernet network. Over either of these networks, shared & samba folders should work just fine. If you can ping at least one way over the network, then the network is functioning, and as Mpack said, any inabilities to manipulate the contents of the shared/samba folder thereafter are due to settings in the host and guest OS's, not Virtualbox.
Re: Samba share on Linux VM
Posted: 5. May 2020, 21:35
by noobcoder
Seems like it has something to do with the shared folder and vboxsf or something like that. I can manipulate it from within the vm but cannot manipulate from the host. I have been using google and I think it may have something to do with the mask/umask virtualbox uses when it mounts it auto mounts the folder. I have been walked through manual mounting but have had no success with being able to delete the folders I create from the windows host. I can't change the permissions on the shared folder.
Re: Samba share on Linux VM
Posted: 5. May 2020, 21:54
by Martin
Virtualbox shared folders are not designed to be used by programs or access methods which need access control and advanced file locking.
They are just for simple file copy transfer between guest and host.
So it's no wonder that you get problems trying to give access to a shared folder with a file sharing service like samba.
Re: Samba share on Linux VM
Posted: 6. May 2020, 09:55
by mpack
You're trying to share a share? That rarely works out well IME.
Re: Samba share on Linux VM
Posted: 15. May 2020, 23:36
by noobcoder
Martin wrote:Virtualbox shared folders are not designed to be used by programs or access methods which need access control and advanced file locking.
They are just for simple file copy transfer between guest and host.
So it's no wonder that you get problems trying to give access to a shared folder with a file sharing service like samba.
Hello, I found that out first-hand. Oh well. Is looking to pass HDD through to the vm a better way to do it? I have a spare drive and don't mind it being used exclusively by the guest OS.
Re: Samba share on Linux VM
Posted: 15. May 2020, 23:46
by scottgus1
Consider the Virtualbox guest as a second PC next to your real PC. If you wanted the second PC to access the first PC's data you would need a network. To set up a network between the guest and host use Bridged or Host-Only as recommended above.
Attaching a physical disk to a guest is called raw disk access. The manual discusses it. It is an expert-only feature and can kill your data if done wrong. It would be better to figure out the network.