Automagically install Docker in a VirtualBox VM with super-fast NFS mounts.
- Uninstall Docker for Mac
- Install Virtualbox
- Install docker client binaries
- Create a Vagrant VM with Docker installed
- Automatically start VM on boot/login
- Set up NFS mounts for VM
- Set up docker environment in
.bash_profile
,.zprofile
orfish.config
(optional!)
- Clone this repo:
git clone https://github.com/dziemba/mobymac.git ~/.mobymac
cd ~/.mobymac
You can use a different path if you like. The directory needs to stay where it is though after running the installer, otherwise the VM won't boot the next time.
- Run the installer
# Install with default settings
# (4096MB RAM, 50GB data disk, automatic shell integration, VM IP: 192.168.42.2)
./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 2048
./install.sh 2048 30
./install.sh 2048 30 manual
./install.sh 2048 30 manual 192.168.142
- Shell integration can be either
auto
(default) ormanual
. - IP subnet must be in the form of
a.b.c
. - The host will use
a.b.c.1
, the VM will usea.b.c.2
.
It's the same as installing - just run it again!
Run ./uninstall.sh
in your mobymac checkout.
- Filesystem watching (inotify) does not work. Please use polling instead if possible. See #6
- NFS mounts have less guarantees regarding FS consistency - in practise it should just work (tm)
- Ports are not mapped to localhost - use
192.168.42.2
to access docker ports - Virtualbox (and thus mobymac) doesn't work on Apple Silicon / M1 Chips
- File system access is still slow in Docker for Mac: docker/roadmap#7
- DNS queries with large responses are extremely slow: docker/for-mac#4430
- Docker Desktop is no longer free for certain use-cases.
Docker for Mac is an awesome project - use it if you can. Once the above issues have been resolved, this project will become obsolete.
- Start the VM:
VBoxManage startvm mobymac --type headless
- If that doesn't help, re-install mobymac.
- Uninstall virtualbox:
brew cask uninstall virtualbox
- If the above step failed: reboot and try again
- Install virtualbox:
brew cask install virtualbox
- If the above step failed: Open System Preferences -> Security & Privacy -> General, then allow the kernel extension. Reboot and try step 3 again.
- Run the mobymac installer (again).
- If that still fails, try the whole process one more time and reboot generously. Open an Issue on this project if you're still having trouble.
- If the above step failed: Open System Preferences -> Security & Privacy -> General, then allow the kernel extension.
- Reboot your computer.
- Run the mobymac installer (again).
- Open /etc/exports:
sudo vim /etc/exports
- Delete all content
- Run the mobymac installer (again).
- Run
sudo rm -rf /usr/local/lib/docker
- Run the mobymac installer (again).
Please open an issue if you're stuck.
Feel free to open issues about feature requests or create PRs.
MIT, see LICENSE