Setting up your first virtual machine

What is Virtual Box?

Virtual Box is effectively an emulator for PC hardware. It runs on Windows, Mac and of course Linux. It allows you to run multiple operating systems at the same time, so you could try out Linux while still using Windows or experiment with different distributions of Linux to see which ones you like. Using Virtual Box you can set up a small network of computers so you don’t have to learn penetration testing on real hardware.

Install Virtual Box

Run the command sudo apt install virtualbox-qt virtualbox-dkms linux-header-generic. This will automatically build the required Virtual Box kernel modules. Your user is normally added to the vboxusers group automatically, but this does not always happen.In such a case, run the command sudo groupadd -a -G vboxusers richard, replacing richard as appropriate.

Go ahead and reboot to load the virtualbox module.

Create a Virtual Machine

Running virtual box

Press Alt +F2 and enter virtualbox. This will open and run the Virtual Box manager. This is the tool where virtual machines will created, deleted and run. This tutorial will cover only the basic setup of a virtual machine.


Click the new button to get started.

Enter the name for the new virtual box and select the type and version. My example machine will be running Linux Mint, so select Linux for the type and as there is no option for Mint, choose Ubuntu. Choose 32 or 64 bit as appropriate for the iso file.

Allocating the virtualbox some memorySet up the memory. Here it has been given 2GB, set it to a value suitable for the host system. Virtual machines do not use all the resources (CPU / Memory / Disk) they are given all the time, so it is safe to be quite generous.

When running several virtual boxes on a single host computer, it is safe to allocate more memory between then than the computer physically has.

Creating the virtual hard diskCreate your virtual hard disk now. Click create and follow the next few steps of the wizard. The file type should be left as VDI. Give the disk a name and size. For testing purposes, 8GB will be plenty but if you intend to use this virtual box for real work then give it at least 20GB. If this machine is to be doing multimedia work then consider allocating 60GB or more. This creates a file on your real hard disk. The file created will not be the size you specified which is a maximum.

Configure the virtual machine

Select the virtual machine then click settings.

Use the system options to allocate how many CPU cores the virtual machine should have access to. Remember that virtual machines do not use any more of the allocated resources than they need at the time so you can be generous. It is sensible to leave one core purely for the host

Select the Display options and allocate the maximum video memory. This is usually 128MB. Also enable 3D acceleration to allow the virtual machine access to the hosts video capabilities. 2D video acceleration should not be enabled as this is not for Linux hosts.

Mounting the Linux Mint iso imageSelect the Storage options and select the empty optical drive under the Controller: IDE. The drop down list indicated by the CD icon at the far right of the dialog box can be used to find your .iso file by clicking the Choose Virtual Optical Drive item. This will use a familiar file selection dialog.


Click OK and then the start button to boot your new virtual box.

Leave a Reply

Your email address will not be published. Required fields are marked *