Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion provision_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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}"