升木 发表于 2016-1-11 09:11:53

VirtualBox "/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

  自己主机是Windows7,开始虚拟机是CentOS5x,在VirtualBox上设置了共享目录“share”之后,在虚拟机里使用命令
  
sudo mount -t vboxsf -o uid=<uid>,gid=<gid>,dmode=0755,fmode=0755 share /share就可以把共享目录mount到虚拟机系统上,但是今天装了个CentOS6之后,设置了同样的共享目录“share”之后,在运行以上命令总是出现以下错误
  
  
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument好来发现是共享目录名(这里是“share”)不能和mount的最终挂载点名相同(这里是"/share"),所以没办法,在VirtualBox的共享目录设置里把share换了一个别名“share123”,然后再运行命令
  
  
sudo mount -t vboxsf -o uid=<uid>,gid=<gid>,dmode=0755,fmode=0755 share123 /share目录挂载成功了,但是具体原因不明。
  
  

  2011-09-11 更新
  如果嫌每次要改太麻烦也可每次先运行一下umount,然后在mount那个目录,比如我windows共享的目录名叫share,在linux上使用mount查看,应该会有类似下面的行出现
  ...share on /media/sf_share type vboxsf (gid=1001,rw)...此时,可以先umount那个/media/sf_share,忽略提示内容(不管什么错误提示),再运行mount命令,类似如下步骤
  #!/bin/shsudo umount -f /media/sf_sharesudo mount -t vboxsf -o "uid=kongxx,gid=kongxx,dmode=0755,fmode=0755" share /home/kongxx/share此时应该就不会再出现上面的那个错误提示了。


  

  

  

  

  

  

  
页: [1]
查看完整版本: VirtualBox "/sbin/mount.vboxsf: mounting failed with the error: Invalid argument