What's the best way to share files from Windows to Boot2docker VM?

前端 未结 5 1588
深忆病人
深忆病人 2020-12-02 08:51

I have make my code ready on Windows, but I find it\'s not easy to share to boot2docker.

I also find that boot2docker can\'t persistent my changes. For example, I cr

5条回答
  •  孤城傲影
    2020-12-02 09:19

    Mount shared folder Windows guest with Linux host (vm name 'default'):

    Shutdown 'default' VM:

    cd "C:\Program Files\Oracle\VirtualBox"
    VBoxManage controlvm default poweroff
    

    Add shared folder command line:

    ./VBoxManage sharedfolder add default -name win_share -hostpath "C:\docker\volumes"
    

    Start VM (headless only command line interface):

    /VBoxManage startvm headless  default
    

    Connect to ssh:

    docker-machine ssh default
    

    Create VM sharedfolder directory:

    sudo mkdir /sharedcontent
    

    Mount Windows folder to host VM:

    sudo mount -t vboxsf win_share /sharedcontent
    

提交回复
热议问题