使用 Ubuntu 18.04 Vmware 客户端和 OSX Sierra 主机的 nfs 挂载访问被拒绝

使用 Ubuntu 18.04 Vmware 客户端和 OSX Sierra 主机的 nfs 挂载访问被拒绝

我正在尝试从我的 OSX 机器上通过 nfs 共享一个目录,以便由 Ubuntu 客户端 (VM) 安装。我感觉我在访问权限方面缺少了一些东西。当我尝试安装 nfs 共享时,我收到一条有关访问被拒绝的错误。我可以在两台机器之间进行 ssh 连接,但使用 nfs 时却没有成功。

OSX ip 是 xxx.xxx.xx.xxx 而 Ubuntu 是 yyy.yyy.yyy.yyy

OSX /etc/导出:

/Users/MichaelHackman/C -alldirs -mapall=501

OSX /etc/hosts.allow:

ALL: yyy.yyy.yyy.yyy

在 Linux 上:

$showmount -e xxx.xxx.xx.xxx
Export list for xxx.xxx.xx.xxx:
/Users/MichaelHackman/C (everyone)

$sudo mkdir -p /nfs/C
$sudo mount -vvvvv xxx.xxx.xx.xxx:/Users/MichaelHackman/C /nfs/C
mount.nfs: timeout set for Thu Jun 21 18:16:17 2018
mount.nfs: trying text-based options 'vers=4.2,addr=xxx.xxx.xx.xxx,clientaddr=yyy.yyy.yyy.yyy'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.1,addr=xxx.xxx.xx.xxx,clientaddr=yyy.yyy.yyy.yyy'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'vers=4.0,addr=xxx.xxx.xx.xxx,clientaddr=yyy.yyy.yyy.yyy'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=xxx.xxx.xx.xxx'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying xxx.xxx.xx.xxx prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying xxx.xxx.xx.xxx prog 100005 vers 3 prot UDP port 760
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting xxx.xxx.xx.xxx:/Users/MichaelHackman/C

在 OSX 上尝试挂载时:

$ sudo log stream --level debug --parent 1921
    Stream 'nfsd' (1921) owned by 'root' (0)
    Timestamp                       Thread     Type        Activity             PID    
    2018-06-21 21:02:59.848476-0400 0x1db78    Default     0x0                  1921   nfsd: (libsystem_trace.dylib) Add Mode: 0x1000B ( info, debug, stream, propagate w/activity ), Final: 0x1000B ( info, debug, stream, propagate w/activity )
    2018-06-21 21:03:02.066876-0400 0xd087     Activity    0x800000000000baf5   1542   vmware-vmx: (CoreFoundation) GetItemCount
    2018-06-21 21:03:02.066933-0400 0xd087     Info        0x800000000000baf5   1542   vmware-vmx: (CoreFoundation) [com.apple.CFPasteboard.entry] GetItemCount('Apple CFPasteboard general' gen: -1) current-gen: 73
    2018-06-21 21:03:02.066999-0400 0xd087     Info        0x800000000000baf5   1542   vmware-vmx: (CoreFoundation) [com.apple.CFPasteboard.exit] result: 0 gen: 73 count: 0 (from cache)
    2018-06-21 21:03:03.262495-0400 0x1db8c    Debug       0x0                  1921   nfsd: NFS IPv4 socket accepted from xxx.xxx.xx.xxx
    2018-06-21 21:03:03.264093-0400 0x1db8c    Debug       0x0                  1921   nfsd: NFS IPv4 socket accepted from xxx.xxx.xx.xxx
    2018-06-21 21:03:03.265858-0400 0x1db8c    Debug       0x0                  1921   nfsd: NFS IPv4 socket accepted from xxx.xxx.xx.xxx
    2018-06-21 21:03:03.269395-0400 0x1db8c    Debug       0x0                  1921   nfsd: NFS IPv4 socket accepted from xxx.xxx.xx.xxx
    2018-06-21 21:03:05.477757-0400 0xa473     Activity    0x800000000000b92e   1306   VMware Fusion: (CoreFoundation) BeginGeneration
    2018-06-21 21:03:05.477785-0400 0xa473     Info        0x800000000000b92e   1306   VMware Fusion: (CoreFoundation) [com.apple.CFPasteboard.general] Begining new generation for 'Apple CFPasteboard general' why: 'general' old: (changeCount: 181, gen: 73) new: (changeCount: 182, gen: 74) owner-pid: 1306
    2018-06-21 21:03:05.477820-0400 0xa473     Activity    0x800000000000b92f   1306   VMware Fusion: (CoreFoundation) GetItemCount
    2018-06-21 21:03:05.477848-0400 0xa473     Info        0x800000000000b92f   1306   VMware Fusion: (CoreFoundation) [com.apple.CFPasteboard.entry] GetItemCount('Apple CFPasteboard general' gen: 74) current-gen: 74
    2018-06-21 21:03:05.477904-0400 0xa473     Info        0x800000000000b92f   1306   VMware Fusion: (CoreFoundation) [com.apple.CFPasteboard.exit] result: 0 gen: 74 count: 0 (from cache)
    2018-06-21 21:03:23.129686-0400 0xd087     Activity    0x800000000000baf6   1542   vmware-vmx: (CoreFoundation) GetItemCount
    2018-06-21 21:03:23.129759-0400 0xd087     Info        0x800000000000baf6   1542   vmware-vmx: (CoreFoundation) [com.apple.CFPasteboard.entry] GetItemCount('Apple CFPasteboard general' gen: -1) current-gen: 74
    2018-06-21 21:03:23.129845-0400 0xd087     Info        0x800000000000baf6   1542   vmware-vmx: (CoreFoundation) [com.apple.CFPasteboard.exit] result: 0 gen: 74 count: 0 (from cache)
    2018-06-21 21:03:28.738413-0400 0x1db8c    Debug       0x0                  1921   nfsd: NFS IPv4 socket accepted from xxx.xxx.xx.xxx
    2018-06-21 21:03:28.740008-0400 0x1db8c    Debug       0x0                  1921   nfsd: NFS IPv4 socket accepted from xxx.xxx.xx.xxx
    2018-06-21 21:03:28.741281-0400 0x1db8c    Debug       0x0                  1921   nfsd: NFS IPv4 socket accepted from xxx.xxx.xx.xxx
    2018-06-21 21:03:28.744636-0400 0x1db8c    Debug       0x0                  1921   nfsd: NFS IPv4 socket accepted from xxx.xxx.xx.xxx
    2018-06-21 21:03:31.013403-0400 0xcf4      Activity    0x800000000000ba69   386    SystemUIServer: (SystemConfiguration) accessing SCDynamicStore
    2018-06-21 21:03:31.013561-0400 0x281      Activity    0x800000000000bdc5   63     configd: processing SCDynamicStore notification
    2018-06-21 21:03:31.013617-0400 0x281      Activity    0x800000000000bdc6   63     configd: (SystemConfiguration) accessing SCDynamicStore
    2018-06-21 21:03:32.796040-0400 0xa473     Activity    0x800000000000bdd0   1306   VMware Fusion: (CoreFoundation) BeginGeneration
    2018-06-21 21:03:32.796067-0400 0xa473     Info        0x800000000000bdd0   1306   VMware Fusion: (CoreFoundation) [com.apple.CFPasteboard.general] Begining new generation for 'Apple CFPasteboard general' why: 'general' old: (changeCount: 182, gen: 74) new: (changeCount: 183, gen: 75) owner-pid: 1306
    2018-06-21 21:03:32.796096-0400 0xa473     Activity    0x800000000000bdd1   1306   VMware Fusion: (CoreFoundation) GetItemCount
    2018-06-21 21:03:32.796114-0400 0xa473     Info        0x800000000000bdd1   1306   VMware Fusion: (CoreFoundation) [com.apple.CFPasteboard.entry] GetItemCount('Apple CFPasteboard general' gen: 75) current-gen: 75
    2018-06-21 21:03:32.796134-0400 0xa473     Info        0x800000000000bdd1   1306   VMware Fusion: (CoreFoundation) [com.apple.CFPasteboard.exit] result: 0 gen: 75 count: 0 (from cache)

答案1

如果有人想让它工作,请使用 VMware Fusion 的“共享文件夹”功能,让它变得简单。

相关内容