Giter Site home page Giter Site logo

Comments (9)

ailispaw avatar ailispaw commented on September 22, 2024

@grahampugh Thank you for the feedback.

I have been thinking of the same thing, too.
I agree with your idea, --nfs parameter for xhyverun.sh.
But it is not so easy to specify the mount point, because the mount script in the VM (NFS client side) has to know the mount point as well as the vmnet_export.sh (NFS server side).

To pass the mount point to the VM, I have two options so far.

  1. Set the mount point as a kernel command parameter.
  2. Execute a mount command through SSH after booting up like Vagrant.

What do you think?

from boot2docker-xhyve.

ailispaw avatar ailispaw commented on September 22, 2024

Solution no.2 may be late for some containers which have volumes under the NFS mount.
I would choose no.1.

from boot2docker-xhyve.

grahampugh avatar grahampugh commented on September 22, 2024

Hi,
I've found that NFS mounting isn't working on external volumes (i.e. a folder in /Volumes). It might be due to the external volume having ownership disabled (as is normal for external USB disks). I haven't experimented with setting the USB disk to have ownership enabled, to see if that solves the problem. (I'm also not sure why this isn't a problem with a Vagrant Ubuntu/Centos VM, but is with boot2docker and Docker-Machine).

from boot2docker-xhyve.

ailispaw avatar ailispaw commented on September 22, 2024

@grahampugh Hi, thank you for the information.
I guess we need to modify some mount options in the startup script in the VM. Or something in the /etc/exports.
https://github.com/ailispaw/boot2docker-xhyve/blob/master/config/bootsync.sh

from boot2docker-xhyve.

grahampugh avatar grahampugh commented on September 22, 2024

Hi. Yeah perhaps. I'm afraid I don't really understand how vmnet_export.sh and config/bootsync.sh interact. I tried appending the following to bootsync.sh but it didn't do anything (even if I changed the line in vmnet_export.sh to reflect this share - and I tried it with folders on the system volume such as /Applications):

# Custom folder
source_volume="/Volumes/Images"  # comment this out if you don't want an additional NFS mount
vm_mount="/Images"

if [ -z ${source_volume} ]; then
    mkdir -p ${vm_mount}
    umount ${vm_mount}
    if [ -n "${GW_IP}" ]; then
        mount_nfs -o "vers=3,noowners,nolocks,nolockd,nolock,nonlm,automounted,nosuid,hard,bg,noresvport,intr,rw,tcp,nfc" ${GW_IP}:${source_volume} ${vm_mount}
    fi
fi

from boot2docker-xhyve.

ailispaw avatar ailispaw commented on September 22, 2024

I'm at AWS re:Invent. I will figure it out this weekend.

from boot2docker-xhyve.

ailispaw avatar ailispaw commented on September 22, 2024

Your /etc/exports in the host and /var/lib/boot2docker/bootsync.sh in the VM should be the followings.

/etc/exports

"/Volumes/Images" -network 192.168.64.0 -mask 255.255.255.0 -alldirs -mapall=501:20

/var/lib/boot2docker/bootsync.sh

#!/bin/sh

mkdir -p /Users
umount /Users
/usr/local/etc/init.d/nfs-client start
GW_IP=$(ip route get 8.8.8.8 | awk 'NR==1 {print $3}')
if [ -n "${GW_IP}" ]; then
  mount ${GW_IP}:/Users /Users -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp
fi

# Custom folder
source_volume="/Volumes/Images"  # comment this out if you don't want an additional NFS mount
vm_mount="/Images"

if [ -n "${source_volume}" ]; then
    mkdir -p ${vm_mount}
    umount ${vm_mount}
    if [ -n "${GW_IP}" ]; then
        mount ${GW_IP}:${source_volume} ${vm_mount} -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp
    fi
fi

from boot2docker-xhyve.

ailispaw avatar ailispaw commented on September 22, 2024

I will keep the same UX as the original boot2docker which uses /Users.

from boot2docker-xhyve.

ailispaw avatar ailispaw commented on September 22, 2024

I implemented this functionality at https://github.com/ailispaw/docker-root-xhyve instead.
You can use sudo ./xhyverun.sh /Volumes/Images there.

from boot2docker-xhyve.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.