LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-13-2016, 07:04 AM   #1
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Rep: Reputation: 15
usermod vs chown vs chmod


Hi:
I set up a VM with Virtualbox and shared a folder with the host. The guest is Xubuntu and I was unable to share the folder by using chown or chmod but when I added my user to the vboxsf group everything worked. I do not understand why just taking ownership chown or changing permissions with chmod did not work. To me it seems like either should have solved the problem. There is something I'm not grasping about ownership, permissions in contrast to being the member of a user group. It would seem to me that being the owner or having permission to r/w should work but that doesn't seem to be the case. Do I need to be part of the user group to take ownership or have permissions be effective?
Thanks,
Scott
 
Old 01-13-2016, 09:25 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
What is the host? On which system did you change the owner or permissions? The chown and chmod commands will change owner and permissions on the installed system and allow access from that system to other partitions or systems. Basically, the reason it doesn't work because that is the way the VirtualBox software is designed, to require a user be in vbox group. I expect someone will be along shortly to give a more detailed explanation.
 
1 members found this post helpful.
Old 01-13-2016, 10:00 AM   #3
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
As far as i know the vbox virtual machine would be a file containing the system. Everything in that file would not be readable by the virtual host, or machine that vb is running on.

You will have to ftp into the vbox vm from other systems to acces files and folders inside the virtual machine.

There are some tools you can use to open image files but cannot remember what they are called exactly.

But long story short. If you use an image file, eg. Qcow etc, your hostsystem can normally not access it natively, shared disks on something like nfs gfs etc is a different story as long as your vm is not using an image file.

Edit: do not change the folder containing image files to something publically accessable. That can cause possible security issues down the road and pretty much annuls the use of stuff like svirt etc securing those systems by seperating communications between host and vm.

Check if you have selinux or apparmor etc running. They could cause issues with accessing directories like that if you want to add isos etc. A better way to solve it is adding a directoryyou can access without those permissions to vb manager storage pools if it allows you to do that. Make sure you addpermissions to selinux or apparmor ifyou use one of them.

I cannot help more since I have never really bothered with vb, performance and utilization of resources are terrible on my systems running servers compared to centos or redhat running kvm and I find it more difficult to manage large scale.

Try kvm and others as well and see if you got the same issues. I think kvm is probably easiest since it is part kernel for just about any system out there.

Last edited by ericson007; 01-13-2016 at 10:11 AM.
 
Old 01-13-2016, 08:15 PM   #4
SBFree
Member
 
Registered: Nov 2004
Distribution: Ubuntu
Posts: 70

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by yancek View Post
What is the host? On which system did you change the owner or permissions? The chown and chmod commands will change owner and permissions on the installed system and allow access from that system to other partitions or systems. Basically, the reason it doesn't work because that is the way the VirtualBox software is designed, to require a user be in vbox group. I expect someone will be along shortly to give a more detailed explanation.
Thank you for the replies. I apologize for not sharing more details. The guest system is Xubuntu and the VM allows access to a directory on a W7 host. Your reply suggests that if this had been another users directory on standalone install that using chown or chmod would have worked. Thanks again.
Scott
 
Old 01-14-2016, 07:12 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Quote:
The guest system is Xubuntu and the VM allows access to a directory on a W7 host.
Linux ownership and permissions are meaningless on a windows filesystem so it would not matter if it was VirtualBox or an actual install of windows and Xubuntu on different partitions of the same drive.
 
Old 01-14-2016, 10:28 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
in the set up of your Virtual OS under settings for that OS there is a share folder option too, so that you can use it to dump in what ever you want into forlder/directory to use in the VB OS from the parent PC
 
Old 01-14-2016, 03:49 PM   #7
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
One other thing, the above answer should get you going. If you tried sharing an actual windows directory, and the vm network can talk to the host, you canuse samba client on the vm for access to different folders. You have to setup sharing on windows though and pointto those sharesin samba.

Not exactly directly answering your question, but provides an alternative method for different folders.
 
Old 01-14-2016, 05:04 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Guest Addtions installed for sharing folders between host and client? have to install it through client to get it to work. I just did it to be sure how it is done. Void Linux host, Slackware Client.


under Devices -> Insert Guest Addtions CD -- I think that is when it asked me if I wanted to download it, and said yes, then open term in client after you mount the CD in client then navagate to the cd then run. sudo ./VBoxLinuxAdditions.run - may have to chmod +x first, I forget, then restart the client, after it finishes installing. this is what you are trying to do yes, get access to your PC folder through a client in VB?

oh , if you're running Windows, and a Linux Client it has a exe in the CD image for this too. it is actually an iso.

How to mount VB Guest Addons & mount shared folders

Last edited by BW-userx; 01-14-2016 at 05:27 PM.
 
Old 01-14-2016, 05:53 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by SBFree View Post
Hi:
I added my user to the vboxsf group everything worked. I do not understand why just taking ownership chown or changing permissions with chmod did not work.
Scott
I think I now know what you are really talking about. As I am playing around with my shared folder in Void with a Slackware client, and I can only get to it through root, logged in as root, or su in terminal.

I've added user to vboxsf group, tried changing the sf_sharedFolder user:group it didn't work. and permission 777, no go. then went su in term and got into it like that, then when I copied a file out of it (HOST) to client ( user ) dir under root (su), then I changed root owner to user owner on that file so that the client user name can do with it what it wills.

I'm still playing with it to see if I can get it to just use a user without having to use su in term to access the Host shared folder.
I may give up, I may not.

modded:
OK OK OK I GOT IT!!!!!!!!!!

I mounted my HOST Folder through my Client after installing all of that prior stuff and setting my share folder in VB. then in the client /etc/fstab adding this:

Code:
/home/userx/VBShare defaults,UID=1000,GID=999,dmode=1755  0  0
path to share folder on Host, then using my UID, and vboxfs GID then over riding permissions with dmode=1755 , now I can get into my share folder through the file manager with no probems in user account without having to use root or su in terminal.

I have two folders set up in the client VB keeping them auto mount, and make perminent -- with only one entry for mounting in fstab and I can get to both of them through the file manager. they both show up and am able to just click into them as without permissions denied error now.

Last edited by BW-userx; 01-14-2016 at 07:39 PM.
 
  


Reply

Tags
chmod, chown, usermod, virtualbox



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache security question: chmod 777 vs usermod -a -G mrbinky3000 Linux - Security 3 08-27-2010 12:11 AM
chown v/s chmod justmovedtolinux Linux - Newbie 3 10-02-2008 06:43 AM
chown and chmod specialized Linux - Hardware 9 04-04-2006 09:26 PM
Chown & Chmod swatward Linux - Newbie 2 03-01-2005 12:57 PM
Log Chmod and Chown FernandoLozano Linux - Security 5 01-10-2005 09:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration