Answer
In windows CMD(only once):
VBoxManage sharedfolder add "boot2docker-vm" --name "d-share" --hostpath "D:\"
In the Boot2Docker VM terminal(every time you boot):
mount -t vboxsf -o uid=1000,gid=50 d-share /d
If you always want to mount your D:\
to /d you can instead add the following entry to /etc/fstab
(if you can edit fstab in boot2docker, not sure on this):
d-share /d vboxsf uid=1000,gid=50 0 0
How I came about this answer, as it may change in the future:
From the Boot2Docker README.md in their git repo
Alternatively, Boot2Docker includes the VirtualBox Guest Additions
built in for the express purpose of using VirtualBox folder sharing.
The first of the following share names that exists (if any) will be
automatically mounted at the location specified:
Users
share at /Users
/Users
share at /Users
c/Users
share at /c/Users
/c/Users
share at /c/Users
c:/Users
share at /c/Users
If some other
path or share is desired, it can be mounted at run time by doing
something like:
$ mount -t vboxsf -o uid=1000,gid=50 your-other-share-name /some/mount/location
There's your command structure.
From VirtualBox Guest Additions Docs on Shared Folders
From the command line, you can create shared folders using VBoxManage,
as follows:
VBoxManage sharedfolder add "VM name" --name "sharename" --hostpath "C:\test"
and
To mount a shared folder during boot, add the following entry to
/etc/fstab
:
sharename mountpoint vboxsf defaults 0 0
The default boot2docker vm name is boot2docker-vm
(imaginative) and you want to mount the D directory D:\
. Lets call our share d-share
.
Possible Dupe:
Can be found here, with a slightly differently explained answer to almost the same question.