VirtualBox共享文件夹配置
环境
- ArchLinux
步骤
安装模块
pacman -S virtualbox-guest-modules
手动载入模块
modprobe -a vboxsf
若提示
Module not found
,则执行:depmod $(uname -r)
开机自动载入模块
echo vboxsf >/etc/modules-load.d/virtualbox.conf
创建挂载点
mkdir /data
在虚拟机控制中,加入共享文件夹
E_DRIVE
挂载
手动挂载
mount -t vboxsf E_DRIVE /data
自动挂载
/etc/fstab E_DRIVE /data vboxsf
常见问题
挂载失败
错误提示:
[cpp] view plaincopy mount: wrong fs type, bad option, bad superblock on E_DRIVE, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program) In some cases useful info is found in syslog - try dmesg | tail or so
解决过程:
dmesg | tail
sf_read_super_aux err=-22
查看vboxsf链接
vincent@vincent-VirtualBox:/mnt$ ls -al /sbin/mount.vboxsf lrwxrwxrwx 1 root root 40 Jun 19 09:38 /sbin/mount.vboxsf -> /usr/lib/VBoxGuestAdditions/mount.vboxsf
发现链接不对,重新链接
ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions/mount.vboxsf /sbin/mount.vboxsf