【问题标题】: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

  • /var/log/boot.log 中的相关行

【问题讨论】:

    标签: linux ubuntu virtualbox mount automount


    【解决方案1】:

    您不必安装它,VitrualBox 会为您制作。对我来说,这些步骤适用于我的系统(Windows 7 上的 VirtualBox 5.0.10 和 Kubuntu 14.04 来宾系统):

    • 在 VirtualBox 中,在“共享文件夹”下为您的机器配置共享文件夹。选择您主机系统上的目录(例如 D:\shared)并为您的访客系统设置一个名称(例如 shared)。

      • 启动来宾系统。现在您应该在 \media\sf_shared 下有一个已安装的文件夹。

    仅此而已。 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
      

      【讨论】:

        猜你喜欢
        • 2014-05-13
        • 2017-09-15
        • 2017-03-28
        • 1970-01-01
        • 2017-06-07
        • 2017-06-23
        • 1970-01-01
        • 2019-01-04
        • 2021-09-17
        相关资源
        最近更新 更多