jmd*_*din 25 permissions mac virtualbox
在 VirtualBox 中,在 OS X 主机和 Ubuntu 来宾之间共享目录的最佳方式是什么?
此设置的问题如下所示。在我的共享目录中,我根本无法更改权限(不是权限被拒绝错误,但它们只是不生效)。
Ubuntu 12.04(来宾):
% ls -l
total 0
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 1
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 10
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 2
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 3
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 4
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 5
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 6
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 7
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 8
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 9
Run Code Online (Sandbox Code Playgroud)
Mac OS X 10.7.3(主机):
$ ls -l
total 0
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 1
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 10
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 2
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 3
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 4
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 5
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 6
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 7
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 8
-rw-r--r-- 1 <my-mac-user> staff 0 Apr 17 21:56 9
Run Code Online (Sandbox Code Playgroud)
如果我对来宾进行 chmod,则没有任何变化:
% chmod +x 1 | ls -l 1 # guest
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 1
Run Code Online (Sandbox Code Playgroud)
如果我在主机上 chmod,它会在主机上更改,但不会在来宾上更改:
$ chmod +x 1 | ls -l 1 # host
-rwxrwx--x 1 <my-mac-user> staff 0 Apr 17 21:56 1
% ls -l 1 # guest
-rwxrwx--- 1 root vboxsf 0 Apr 17 21:56 1
Run Code Online (Sandbox Code Playgroud)
jmd*_*din 26
我已经想通了!
重现:
从终端,umask && id
以普通用户身份运行以获得如下信息:
002 # this is your umask
uid=1000(luser) gid=1000(luser) groups=1000(luser),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare),125(vboxsf)
Run Code Online (Sandbox Code Playgroud)sudo mkdir -p /media/sf_src # src is the shared directory
挂载src
目录作为测试:
sudo mount.vboxsf -o umask=002,gid=1000,uid=1000 src /media/sf_src
| | | | |-> where to mount
| | | | the file
| | | |-> name of the shared dir
| | | (in VBox settings)
| | |
\ | /
from the `id` command
Run Code Online (Sandbox Code Playgroud)
要在登录时自动挂载它,请编辑/etc/fstab
并添加以下内容:
src /media/sf_src vboxsf umask=002,gid=1000,uid=1000
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
41405 次 |
最近记录: |