# VirtualBox Tips

There is a lot of installation guides and configuration suggestion dedicated to the VirtualBox. There are also many problems solved that can be easily found in your favorite search engine. So I will not make you bored and I not discuss a well-written installation and configuration which you will find in the official documentation. I will summarize instead what should be done after installing VirtualBox so as to avoid basic errors. I will also mention a few solutions that every VirtualBox user is looking for, sooner or later.

I wrote down the following steps to make it easier for myself to work with VirtualBox and not to wonder every time, why something does not work, just because I forgot about a few obvious settings.

## Three simple steps

Do this after every Virtual Box installation on Linux host to make sure everything works correctly.

1. Add user to vboxusers group on host machine and do the same on guest machine

2. Install Extension Pack.

On guest machine install required packages

then Insert Guest Additions CD and run as root ./VBoxLinuxAdditions.run

With above 3 suggestion you should not have any problems with shared folder access, usb devices, copy & paste between host & guest, graphics adjustment.

## Reduce .vdi size

After some time, each VDI disk created with dynamically allocated space has the maximum size even though the system does not really occupy the entire virtual surface. It is worth then to compact its size. This method works only for VDI files.

### Linux

#### On guest

Cleanup whole empty space by nullify free space:

It can take some time.

#### On host

Use vboxmanage tool to compact disk

this command on VirtualBox version >=6.1.4 looks now:

### Windows

#### On guest

Run disk defragmentation.

Once done download SDelete tool and run it from command line with parameter:

replace c: with the drive letter of the VDI

#### On host

this command on VirtualBox version >=6.1.4 looks now:

## Disk conversion

If you would like to compact your disk but its in VMDK format you can easily covert it to VDI.

Just in case make a copy of drive before conversion.

## Resize disk

In case where your virtual disk is out of space you can resize it. This method also works for VDI files only.

Resize value should be set to the new size of whole disk, not the amount of new space you want to add.

Next, on guest host resize partition using your favorite partition manager, for example Gparted.

## Slow Windows guest

Since VirtualBox 6 if Hyper-V is enabled, then icon for green turtle will be shown in the notification area of VirtualBox, as shown below, and Virtual Machine will be slow.

In my case I had to turn off one of the option in Microsoft Windows Defender called Core isolation.

Also turn off Hyper-V using command in PowerShell (don’t forget to run PowerShell as Admin).

then reboot: