Access to shared folders in Virtual Box

Access to shared folders in Virtual Box

Command line

By default Virtual Box shared folders are created with read/write permission for the guest. This can be done from the command line with:

VBoxManage sharedfolder add "VM name" --name "sharename" --hostpath "C:\test"

By adding the option --readonly we can restrict these for read only access. Use the --transientoption if you only want the shares to appear in the present session but not persistent for follwing sessions. There are some limitations for shared folders (see this question for details). If prerequisites are met we may mount these shared folders manually by running the following commands in the guest:

mkdir /home/<user>/vboxshare
sudo mount -t vboxsf -o uid=1000,gid=1000 share /home/<user>/vboxshare

Of course we can also use different mount options to mount as read/only or mount with read access only to root.

Auto-Mount through Virtual Box Manager

In case we enabled auto-mounting on creating a shared folder from the Virtual Box Manager those shared folders will automatically be mounted in the guest with mount point /media/sf_<name_of_folder>To have access to these folders users in the guest need to be a member of the group vboxsf.

Source and further reading: Virtual Box User Manual

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值