MacOS – How to encrypt the VirtualBox VM

encryptionmacbook promacosvirtualbox

Is there a way for me to use a virtual machine (VirtualBox) on my MacBook Air with encryption protection? I want to install a VM of Ubuntu, and if my employer calls back the hardware I don't want them to be able to access what's on there…

Best Answer

Yes. You can put the VM in an encrypted sparse bundle. This way, the virtual machine can only be run if the image is mounted, and that requires a password.

  1. Open Disk Utility (found in /Applications/Utilities/).

  2. Select FileNewDisk Image from Folder… or press ⌘ cmd+⇧ shift+N.

  3. Select the folder that contains your virtual machine and press Image.

  4. Choose sparsebundle as the Image Format, and choose the level of encryption you require.

  5. Choose a password to encrypt the image. Make sure to uncheck the Remember password in my Keychain box if you believe that they could access your Keychain.

  6. Click OK. Disk Utility will create a sparse bundle to hold the VM.

    The sparse bundle should auto-mount (and request for your password if you didn't store it in your Keychain) when you try to perform any action that would require access to your VM.