diff --git a/README.md b/README.md index 2798e25..6dd58f0 100644 --- a/README.md +++ b/README.md @@ -26,15 +26,16 @@ Automagically install Docker in a VirtualBox VM with super-fast NFS mounts. 2. Run the installer ```bash # Install with default settings - # (4096MB RAM, 50GB data disk, automatic shell integration, VM IP: 192.168.42.2) + # (4096MB RAM, 50GB data disk, automatic shell integration, VM IP: 192.168.42.2, NFS mount opts: noacl,nolock,async,noatime,actimeo=1) ./install.sh # Or run the installer with custom settings - # ./install.sh [VM memory in MB] [data disk size in GB] [shell integration] [VM IP subnet] + # ./install.sh [VM memory in MB] [data disk size in GB] [shell integration] [VM IP subnet] [NFS mount options] ./install.sh 2048 ./install.sh 2048 30 ./install.sh 2048 30 manual - ./install.sh 2048 30 manual 192.168.142 + ./install.sh 2048 30 manual 192.168.142 + ./install.sh 2048 30 manual 192.168.142 'acl,nolock,async,noatime,actimeo=1' ``` - Shell integration can be either `auto` (default) or `manual`. diff --git a/install.sh b/install.sh index 033d67e..3ae26c8 100755 --- a/install.sh +++ b/install.sh @@ -7,6 +7,7 @@ RAM="${1:-4096}" DISKSIZE="${2:-50}" SHELL_INTEGRATION="${3:-auto}" SUBNET="${4:-192.168.42}" +NFS_MOUNT_OPTS="${5:-noacl,nolock,async,noatime,actimeo=1}" HOST_IP="${SUBNET}.1" # when given a 192.168.x.y IP, vagrant assigns 192.168.x.1 to the host VM_IP="${SUBNET}.2" @@ -86,7 +87,7 @@ Vagrant.configure('2') do |config| end config.vm.synced_folder '.', '/vagrant', disabled: true - config.vm.provision :shell, path: 'provision_vm.sh', args: ['${HOST_IP}', '${HOME}', '${NFS_HOME}'] + config.vm.provision :shell, path: 'provision_vm.sh', args: ['${HOST_IP}', '${HOME}', '${NFS_HOME}', '${NFS_MOUNT_OPTS}'] config.vm.network :private_network, ip: '${VM_IP}' end EOD diff --git a/provision_vm.sh b/provision_vm.sh index 202b7b6..140981e 100644 --- a/provision_vm.sh +++ b/provision_vm.sh @@ -10,6 +10,7 @@ fi HOST_IP="$1" HOST_HOME="$2" HOST_NFS_HOME="$3" +NFS_MOUNT_OPTS="$4" if [ -d /etc/docker ]; then echo "Provisioning is not idempotent, please re-install mobymac if needed." @@ -62,5 +63,5 @@ grub-install /dev/sda echo "=== Setting up NFS mount" mkdir -p "${HOST_HOME}" -echo "${HOST_IP}:${HOST_NFS_HOME} ${HOST_HOME} nfs noacl,nolock,async,noatime,actimeo=1 0 0" >> /etc/fstab +echo "${HOST_IP}:${HOST_NFS_HOME} ${HOST_HOME} nfs ${NFS_MOUNT_OPTS} 0 0" >> /etc/fstab mount "${HOST_HOME}"