Once the Anka Build Virtualization software has been installed onto a macOS machine, you'll typically want to ensure that the machine has high availability. This requires turning off sleep and several other default features that would cause the machine to become unavailable. Below are the preparatory steps we suggest:
Start a UI session by logging into your node's user to ensure Apple's services are started (it doesn't have to be an administrator).
Enable automatic login for the current user: Go to Preferences > Users > enable automatic login. Or, using the CLI.
If using the CLI method, you must also XOR-encrypt the login password and add it to
/etc/kcpasswordfile must be owned by
root:wheelwith a mode of
0600. See the GitHub repository veertuinc/kcpassword for help generating the encrypted password string.
Log out after X minutes of inactivity under System Preferences > Security & Privacy > Advanced
Require password X after sleep or screen saver begins under System Preferences > Security
VNC may be required to disable this. It's possible your hardware does not have VNC enabled and you also don't have physical access. The following are the commands necessary to enable VNC from an SSH:
The following examples are only for OS X 10.5 and later. cd /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/ sudo ./kickstart -configure -allowAccessFor -specifiedUsers sudo ./kickstart -configure -allowAccessFor -allUsers -privs -all sudo ./kickstart -activate
Disable all forms of sleep: Go to Preferences > Energy Saver > disable any sleep options.
Alternatively, you can do this from the command-line:
# Never go into computer sleep mode sudo systemsetup -setcomputersleep Off systemsetup -setcomputersleep Off || true # Disable standby sudo pmset -a standby 0 # Disable disk sleep sudo pmset -a disksleep 0 # Hibernate mode is a problem on some mac minis; best to just disable sudo pmset -a hibernatemode 0
If you cannot perform launchctl commands, you can execute these commands from the command-line:
# Disable indexing volumes sudo defaults write ~/.Spotlight-V100/VolumeConfiguration.plist Exclusions -array "/Volumes" sudo defaults write ~/.Spotlight-V100/VolumeConfiguration.plist Exclusions -array "/Network" sudo killall mds sleep 60 # Make sure indexing is DISABLED for the main volume sudo mdutil -a -i off / sudo mdutil -a -i off
MDS can be disable with
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist, but only if SIP is disabled on the host (not recommended)
Big Sur Only (optional): Disable Apple's mitigations with
sudo anka config vmx_mitigations 0. Without it, performance will be ~10% worse inside of the VM.
Set the same
chunk_size across your nodes with
anka config chunk_size 2147483648 (2GB). Any of the machines that create VM templates/tags need to also have this set.
If the chunk_size is too small, you may hit
Too many open fileswhen trying to start VMs. You can try to modify the system's maxfiles (
sudo launchctl limit maxfiles 4096 unlimited), but it may also be a good idea to increase the
chunk_sizeto a larger size as well.
It's possible to only set it for the creation and/or node that pushes to the registry, post-creation, but it's recommended to set it before creation to minimize errors.
Reboot the host
You may also want to have your nodes restart on host level failure:
systemsetup -setrestartpowerfailure on&
systemsetup -setrestartfreeze on
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.