VirtualBox permissions -- Samba needed/not needed [BUG FILED][WORKAROUND]

Questions about virtualization software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

VirtualBox permissions -- Samba needed/not needed [BUG FILED][WORKAROUND]

Post by markfilipak »

I'm running Mint as the guest in a VirtualBox VM. Here are the shared folders and virtual disks in '/media/':

Code: Select all

drwxr-x---+ 5 mark vboxsf  4096 Jun 23 23:33 mark
drwxrwx---  3 root vboxsf  4096 Jun 19 21:16 sf_D
drwxrwx---  1 root vboxsf 20480 Jun 19 21:35 sf_email
drwxrwx---  1 root vboxsf 49152 Jun 21 11:30 sf_G_DRIVE
drwxrwx---  1 root vboxsf 12288 Jun 20 02:05 sf_Setup
and in '/media/mark/':

Code: Select all

drwxrwxrwx 1 mark mark   12288 Jun 19 11:45 FireFox Profile
drwxr-xr-x 7 mark vboxsf  5120 Jun 24 01:00 TBird Linux
dr-xr-xr-x 5 mark mark    2570 Jan 13 14:20 VBox_GAs_6.1.32
They used to be owned by 'mark'. Now, not so. Why? I don't know.

I think I need to change the owner to 'mark' for all of them (and all their contents) in order to overcome punishing problems I'm experiencing -- 'mark' (me) is a member of the 'vboxsf' group.

I opened nemo via gksudo as root and provided the password, but when I try to change the owner to 'mark', it automatically changes back to 'root'.

What am I doing wrong? I tried searching for help and got a lot of conflicting info with plenty of "I think...", "I'm not sure but...", etc. disclaimers (that didn't work anyway). So far, I've not found Joy. Can you help me?

In the terminal session, as gksudo runs, I see a steady stream of "Please ask your system administrator to enable user sharing" notices. I wish I had a system administrator. ;-)

I've read that Samba is needed, and I've read that Samba is not needed.

Code: Select all

mark-VirtualBox media # samba
The program 'samba' is currently not installed. You can install it by typing:
apt install samba
I would expect that if Samba is needed, it would already be installed, eh? Since this all used to work -- why/how 'root' became the owner is unknown -- I guess Samba is not needed. I'm afraid to install Samba because Linux terrifies me.

Thanks for guidance,
Mark.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 5 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: VirtualBox permissions -- Samba needed/not needed

Post by Cosmo. »

What is this for a strange Mint version? The command gksudo does not exist in any supported version. So far your description is not understandable.
Nikolai5
Level 4
Level 4
Posts: 309
Joined: Thu Dec 23, 2021 5:25 pm
Location: Northern England

Re: VirtualBox permissions -- Samba needed/not needed

Post by Nikolai5 »

If I understand what you're trying to do correctly, you don't need to do anything with samba.
Your post is a little confusing but all you're trying to do is share a folder from your PC so that it is visible in your virtual machine right?

So in your Virtualbox virtual machine settings you'll want to go to the "Shared Folders" tab, add a new entry and select the folder you want to share. Then tick the "auto mount" box and type "/media/MyStuff" (or whatever you wanna call it) as the mount point.

You will get permission issues if you try to access this folder by default. What you need to do is add your user to the "vboxsf" group to fix that.
Generally you can do that with the command:

Code: Select all

usermod -aG vboxsf markfilipak
So to fix your issue I'm pretty sure you just need to add your user in the virtual machine to the vboxsf group to get the correct permissions.
You may need to restart the machine after adding to the group for the changes to apply.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

Hi Cosmo,
Cosmo. wrote: Fri Jun 24, 2022 4:08 am... The command gksudo does not exist in any supported version. ...

Code: Select all

mark@mark-VirtualBox ~ $ which gksudo
/usr/bin/gksudo
I've been advised here at this forum to not use 'sudo' for GUI applications but to use 'gksudo', instead. It appears to be part of the distro.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

Hi Nikolai5,
Nikolai5 wrote: Fri Jun 24, 2022 11:46 am If I understand what you're trying to do correctly, you don't need to do anything with samba.
Your post is a little confusing but all you're trying to do is share a folder from your PC so that it is visible in your virtual machine right?
Nope. I'm just trying to get the permissions right.
So in your Virtualbox virtual machine settings you'll want to go to the "Shared Folders" tab, add a new entry and select the folder you want to share. Then tick the "auto mount" box and type "/media/MyStuff" (or whatever you wanna call it) as the mount point.
Of course. The mounts are not the issue. Everything is getting mounted correctly.
You will get permission issues if you try to access this folder by default. What you need to do is add your user to the "vboxsf" group to fix that.
Generally you can do that with the command:

Code: Select all

usermod -aG vboxsf markfilipak
I'm already a member of vboxsf.
So to fix your issue I'm pretty sure you just need to add your user in the virtual machine to the vboxsf group to get the correct permissions.
In '/media/':

Code: Select all

drwxr-x---+ 5 mark vboxsf  4096 Jun 23 23:33 mark
drwxrwx---  3 root vboxsf  4096 Jun 19 21:16 sf_D
drwxrwx---  1 root vboxsf 20480 Jun 19 21:35 sf_email
drwxrwx---  1 root vboxsf 49152 Jun 21 11:30 sf_G_DRIVE
drwxrwx---  1 root vboxsf 12288 Jun 20 02:05 sf_Setup
and in '/media/mark/':

Code: Select all

drwxrwxrwx 1 mark mark   12288 Jun 19 11:45 FireFox Profile
drwxr-xr-x 7 mark vboxsf  5120 Jun 24 01:00 TBird Linux
dr-xr-xr-x 5 mark mark    2570 Jan 13 14:20 VBox_GAs_6.1.32
I think I already have the correct permissions. This all used to work.
altair4
Level 20
Level 20
Posts: 11453
Joined: Tue Feb 03, 2009 10:27 am

Re: VirtualBox permissions -- Samba needed/not needed

Post by altair4 »

markfilipak wrote: Fri Jun 24, 2022 2:10 am I'm running Mint as the guest in a VirtualBox VM. Here are the shared folders and virtual disks in '/media/':

Code: Select all

drwxr-x---+ 5 mark vboxsf  4096 Jun 23 23:33 mark
drwxrwx---  3 root vboxsf  4096 Jun 19 21:16 sf_D
drwxrwx---  1 root vboxsf 20480 Jun 19 21:35 sf_email
drwxrwx---  1 root vboxsf 49152 Jun 21 11:30 sf_G_DRIVE
drwxrwx---  1 root vboxsf 12288 Jun 20 02:05 sf_Setup
.....
They used to be owned by 'mark'. Now, not so. Why? I don't know.
Actually, the only thing that looks odd about the permissions in that output is the "mark" folder. It should be owned by root:
tester@vmint193cinn:~$ ls -l /media
total 16
drwxrwx--- 1 root vboxsf 4096 Nov 2 2021 sf_DATA
drwxrwx--- 1 root vboxsf 4096 May 20 07:32 sf_HostUSB
drwxrwx--- 1 root vboxsf 4096 Jun 20 12:43 sf_VBoxSharedFolder
drwxr-x---+ 4 root root 4096 Sep 17 2020 tester
That's because the /media/$USER folder is controlled by an ACL.

Bt the way the key word in Cosmo.'s response is "supported". The last Mint version that had gksudo was Mint 18 which went out of support a year ago.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

Code: Select all

mark@mark-VirtualBox ~ $ gksudo nemo
Nemo-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.
I suspect several things are happening/wrong.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

Should all those 'vboxsf's and virtual disks be owned by 'root' with permissions to group: 'vboxsf'?
altair4
Level 20
Level 20
Posts: 11453
Joined: Tue Feb 03, 2009 10:27 am

Re: VirtualBox permissions -- Samba needed/not needed

Post by altair4 »

Yes
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

altair4 wrote: Fri Jun 24, 2022 12:48 pm... That's because the /media/$USER folder is controlled by an ACL.
"ACL" == "Access Control List", right? Is that the difference between 'mark's ownership and 'root's ownership?
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

altair4 wrote: Fri Jun 24, 2022 1:03 pmYes
Ohhhh...! I'll change them. ...I'll be right back with the results.
altair4
Level 20
Level 20
Posts: 11453
Joined: Tue Feb 03, 2009 10:27 am

Re: VirtualBox permissions -- Samba needed/not needed

Post by altair4 »

markfilipak wrote: Fri Jun 24, 2022 12:52 pm

Code: Select all

mark@mark-VirtualBox ~ $ gksudo nemo
Nemo-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.
I suspect several things are happening/wrong.
Nope. That's working just as it should. Nemo will run "net usershare info" to get a listing of all the samba shares you created through Nemo so it knows which folders to flag as shared. If you don't have samba installed you can't create any shares so the message is just telling you that.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 20
Level 20
Posts: 11453
Joined: Tue Feb 03, 2009 10:27 am

Re: VirtualBox permissions -- Samba needed/not needed

Post by altair4 »

markfilipak wrote: Fri Jun 24, 2022 1:10 pm
altair4 wrote: Fri Jun 24, 2022 1:03 pmYes
Ohhhh...! I'll change them. ...I'll be right back with the results.
There's nothing to change. It's that way already.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

altair4 wrote: Fri Jun 24, 2022 1:14 pm
markfilipak wrote: Fri Jun 24, 2022 12:52 pm

Code: Select all

mark@mark-VirtualBox ~ $ gksudo nemo
Nemo-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.
I suspect several things are happening/wrong.
Nope. That's working just as it should. Nemo will run "net usershare info" to get a listing of all the samba shares you created through Nemo so it knows which folders to flag as shared. If you don't have samba installed you can't create any shares so the message is just telling you that.
I really don't mean to nitpick but that's your interpretation. My interpretation (and, methinks, any non-expert's interpretation) is that Mint it telling me: "Please ask your system administrator to enable user sharing." Why would Nemo call "net usershare info"? It doesn't say. Linux is terrifying.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

altair4 wrote: Fri Jun 24, 2022 1:14 pm... There's nothing to change. It's that way already.
Huh?
In '/media/':

Code: Select all

drwxr-x---+ 5 mark vboxsf  4096 Jun 23 23:33 mark           <== owned by 'mark'
drwxrwx---  3 root vboxsf  4096 Jun 19 21:16 sf_D
drwxrwx---  1 root vboxsf 20480 Jun 19 21:35 sf_email
drwxrwx---  1 root vboxsf 49152 Jun 21 11:30 sf_G_DRIVE
drwxrwx---  1 root vboxsf 12288 Jun 20 02:05 sf_Setup
and in '/media/mark/':

Code: Select all

drwxrwxrwx 1 mark mark   12288 Jun 19 11:45 FireFox Profile <== owned by 'mark'
drwxr-xr-x 7 mark vboxsf  5120 Jun 24 01:00 TBird Linux     <== owned by 'mark'
dr-xr-xr-x 5 mark mark    2570 Jan 13 14:20 VBox_GAs_6.1.32 <== owned by 'mark'
altair4
Level 20
Level 20
Posts: 11453
Joined: Tue Feb 03, 2009 10:27 am

Re: VirtualBox permissions -- Samba needed/not needed

Post by altair4 »

I would take this opportunity to do a clean install of a Mint supported release: Mint 19 or Mint 20.

And resist the temptation to muck about with the internal plumbing after you do so.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

markfilipak wrote: Fri Jun 24, 2022 1:01 pm Should all those 'vboxsf's and virtual disks be owned by 'root' with permissions to group: 'vboxsf'?
altair4 wrote: Fri Jun 24, 2022 1:03 pmYes
Ohhhh...! I'll change them. ...I'll be right back with the results.
altair4 wrote: Fri Jun 24, 2022 2:26 pm I would take this opportunity to do a clean install of a Mint supported release: Mint 19 or Mint 20.

And resist the temptation to muck about with the internal plumbing after you do so.
Okay, I'll abandon ownership issues and make a new VM and attach the shared folders and vdisks to that. We'll see, eh? (Fingers crossed.) Thanks for your advice. That will take awhile. I'll be back with the results.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: VirtualBox permissions -- Samba needed/not needed

Post by Cosmo. »

markfilipak wrote: Fri Jun 24, 2022 12:08 pm Hi Cosmo,
Cosmo. wrote: Fri Jun 24, 2022 4:08 am... The command gksudo does not exist in any supported version. ...

Code: Select all

mark@mark-VirtualBox ~ $ which gksudo
/usr/bin/gksudo
I've been advised here at this forum to not use 'sudo' for GUI applications but to use 'gksudo', instead. It appears to be part of the distro.
This advice is correct, but the usage of gksudo was only valid, as long as it did exist. I know these advises, many of them have been written by me. But gksudo does not exist on the Mint versions, which are still supported, so your output only demonstrated, what I already knew: Your system is out of support,

The problem is now, that this thread is already 16 replies old, but we do still not have the least idea, about which version we are talking, although I asked you in my previous post. Rather obviously it is a no longer supported version (at least 1 year out of support, possibly longer). As an upgrade is not possible, you need to do a new installation; in case of VB the smallest problem. Consequence: The hunt for your current problem is senseless.
pbear
Level 16
Level 16
Posts: 6569
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: VirtualBox permissions -- Samba needed/not needed

Post by pbear »

markfilipak wrote: Fri Jun 24, 2022 2:10 am ... to overcome punishing problems I'm experiencing
Why so mysterious? If you explain the actual problem, we might be able to help.

And I will confirm what altair4 says. Checking two LM18 VMs I have in archive, root owns the shared folder mount point in both. The shared folders work fine.
markfilipak
Level 6
Level 6
Posts: 1173
Joined: Sun Mar 10, 2013 8:08 pm
Location: Mansfield, Ohio

Re: VirtualBox permissions -- Samba needed/not needed

Post by markfilipak »

pbear wrote: Sat Jun 25, 2022 1:39 am
markfilipak wrote: Fri Jun 24, 2022 2:10 am ... to overcome punishing problems I'm experiencing
Why so mysterious? If you explain the actual problem, we might be able to help.
Okay, thanks. I'm taking you up on that, below. I do need help.
And I will confirm what altair4 says. Checking two LM18 VMs I have in archive, root owns the shared folder mount point in both. The shared folders work fine.
I understand. I agree. Group 'vboxsf' should be sufficient.

To make a very, very long story short,
My Win10 + VBox + Linux Mint 18.3 laptop died. I can fix it, but meanwhile I need to stay connected.
I'm temporarily on a backup laptop:
..Win7
..........shared: C:\LinuxFFox\ckls0yge.default-release\
..........shared: C:\LinuxTBird\0ysydkep.default\
....VBox 6.1.32 r149290 (Qt5.6.2) (with Guest Extensions)
......Linux Mint 20.3/Xfce 4.16.0 (clean install)
........mark administrator vboxsf
........Firefox 101.0.1 (64-bit)
..........profile: /media/sf_LinuxFFox/ckls0yge.default-release/ root vboxsf drwxrwx---
........Thunderbird 91.9.1 (64-bit)
..........profile: /media/sf_LinuxTBird/0ysydkep.default/ root vboxsf drwxrwx---

Both FFox & TBird exhibit the same symptom: UI changes do not survive restarts. For example, TBird saves mail to the profile, but it doesn't save its settings or Oauth2 tokens in the very same profile.

I have the following VBox releases and am considering regressing:
VirtualBox-6.1.32-149290-Win.exe
VirtualBox-6.1.30-148432-Win.exe
VirtualBox-6.1.28-147628-Win.exe
VirtualBox-6.1.26-145957-Win.exe
VirtualBox-6.1.22-144080-Win.exe
VirtualBox-6.1.16-140961-Win.exe
VirtualBox-6.1.14-140239-Win.exe
VirtualBox-6.1.12-139181-Win.exe
VirtualBox-6.1.10-138449-Win.exe
Locked

Return to “Virtual Machines”