【问题标题】:VirtualBox: mounting shared folder fails during start-up, but succeed from shellVirtualBox:启动时挂载共享文件夹失败,但从shell成功
【发布时间】:2015-07-05 03:20:12
【问题描述】:
问题描述:
当我启动我的 VirtualBox 来宾操作系统时,/etc/fstab 中引用的 共享文件系统 的挂载失败。
但是,登录后 - mount -a 成功。
详情:
启动过程卡在这里...
...然后按s 继续启动过程,完成。
在 shell 中,我验证我的共享目录没有挂载:
但是现在,从 shell 中,共享文件系统的挂载成功了:
我应该怎么做才能让我的mount 在启动过程中成功?
环境:
- 虚拟框:4.3.12.r93733
- 主机操作系统:Windows 7
- 来宾操作系统:Linux ubuntu 3.13.0-32-generic #57~precise1-Ubuntu x86_64 GNU/Linux
/etc/fstab
【问题讨论】:
标签:
linux
ubuntu
virtualbox
mount
automount
【解决方案1】:
您不必安装它,VitrualBox 会为您制作。对我来说,这些步骤适用于我的系统(Windows 7 上的 VirtualBox 5.0.10 和 Kubuntu 14.04 来宾系统):
仅此而已。 VirtualBox 为您管理。
【解决方案2】:
您需要正确安装 VirtualBox Guest Additions 并使用 VirtualBox Manager 指定共享文件夹。发生此问题是因为挂载点具有 root 权限。默认挂载位置在 /media/sf_。
您可以使用 VBoxControl 命令更改挂载点。要将挂载点从 /media/sf_... 更改为 /home/user/sf_...,请使用以下命令:
sudo VBoxControl guestproperty set /VirtualBox/GuestAdd/SharedFolders/MountDir /home/user/
检查是否有效:
sudo VBoxControl guestproperty get /VirtualBox/GuestAdd/SharedFolders/MountDir