我知道已经有很多关于这个问题的问题,但是人们提出的所有解决方案都不适合我。我个人采取了这种/etc/fstab方法。这是文件内容的样子
david@debian:~$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=e5de59a3-0619-47f9-9a08-858e1e4f6415 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=b9140523-9685-48c4-a870-3604a8f58788 none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
GitHub-VM /home/david/Documents vboxsf uid=david,gid=david,dmode=774,fmode=664 0 0
Run Code Online (Sandbox Code Playgroud)
在哪里:
当然,我没有忘记vboxsf在启动时强制加载内核模块。
david@debian:~$ sudo cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
vboxsf
Run Code Online (Sandbox Code Playgroud)
遗憾的是,登录后,我的文档文件夹未映射到主机文件夹:(。我错过了什么?
挂载必须在vboxadd-service.service启动后进行。Systemd v220为此提供了特殊fstab选项,但除非您使用向后移植,否则对于 jessie 版本,您必须创建一个自定义安装单元。将以下内容放入/etc/systemd/system/home-david-Documents.mount:
[Unit]
Requires=vboxadd-service.service
After=vboxadd-service.service
[Mount]
What=GitHub-VM
Where=/home/david/Documents
Type=vboxsf
[Install]
WantedBy = multi-user.target
Run Code Online (Sandbox Code Playgroud)
从 中删除相应的行fstab,systemctl enable home-david-Documents.mount然后重新启动。
检查您的启动日志,systemctl status home-david-Documents.mount看看它是否不起作用。
| 归档时间: |
|
| 查看次数: |
1597 次 |
| 最近记录: |