Encrypted Disk with VirtualBox

In my previous articles I illustrated how to encrypt the entire operating system for Ubuntu Server and Desktop including the users home folder. In this article I am going to illustrate how to encrypt a virtual machines virtual disk in VirtualBox from Oracle.

At the time of writing this article I used VirtualBox Version 5.1.8 r111374 with the according Extension Pack. The Oracle VirtualBox Extention Pack is required for the virtual disk encryption. If you have not done so go ahead and download the Extension Pack for your version and install it.

Start your VirtualBox Manager and click on the New Icon.

VirtualBox Menubar
VirtualBox Menubar

Give your new VM a name and select the Type and Version of the Operating System you are going to install on it.

VirtualBox - Create New Virtual Machine
VirtualBox – Create New Virtual Machine

Then go and select how much memory you like to use in this VM

VirtualBox - specify memory size
VirtualBox – specify memory size

Select “Create a virtual hard disk now

VirtualBox - Create new virtual disk
VirtualBox – Create new virtual disk

Now pick a virtual hard disk type. I will select VMDK so it is easier to import/export to VMware ESXi Servers

VirtualBox - select hard disk file type
VirtualBox – select hard disk file type

Here you need to select what kind of disk you like to create. If you are shy on storage space than I recommend using the “Dynamically allocated” but it comes with a price. I t will be slower than a “Fixed size” disk. On the other hand the fixed size disk required the entire allocated disk size.

VirtualBox - Storage type for virtual disk
VirtualBox – Storage type for virtual disk

Now specify the size of the disk. 8GB for this illustration is just fine.

VirtualBox - set Storage size
VirtualBox – set Storage size

After the VM has been created highlight the VM and select the settings button in the menu bar.

VirtualBox - VM general settings
VirtualBox – VM general settings

Go to General >> Encryption Tab

VirtualBox - Disk Encryption settings
VirtualBox – Disk Encryption settings

Check the “Enable Encryption” box and select a Encryption Cipher. I recommend AES-XTS256-Plain64 and enter a passphrase for the cipher. Make sure you make a note of it somewhere.

That is it. You can go ahead now and install you operating system on it. Your virtual disk is now encrypted and if this file finds it’s way out side your network you can sleep better knowing it is encrypted and nobody can get to the data on it.

Namaste by friends 😉