Modern IT specialists and advanced users are often faced with the need to run multiple operating systems simultaneously. Virtualization allows you to isolate the software environment, test questionable applications, or work with Linux without removing the main Windows. One of the most popular and free solutions for these tasks is Oracle VM VirtualBox.

The initial configuration process may seem confusing to a newbie due to the abundance of settings. However, proper allocation of resources and proper configuration of guest system parameters are critical for stable operation. In this article we will analyze all the stages, from downloading the distribution to fine-tuning network interfaces.

Ignoring the basic rules of virtualization often leads to system slowdowns or complete inoperability of the guest OS. You will learn to avoid common mistakes that 90% of users make when first getting acquainted with a hypervisor.

Preparing and installing the hypervisor

The first step is to download the current version of the software from the official website of the developer. Always select the version that matches your host system, as architectures x86 and ARM require different assemblies. After running the installer, you need to carefully monitor the offered components.

During the installation process, the system may request permission to install network drivers. Virtual network adapter necessary to ensure communication between the host and the guest, as well as to access the Internet inside the virtual machine. Failure to install these components will prevent you from setting up your network later without reinstallation.

โš ๏ธ Attention: If you have installed Hyper-V or WSL 2 on Windows, they may conflict with VirtualBox, causing errors in starting virtual machines with code VERR_NEM_NOT_AVAILABLE. In this case, you must either disable the Microsoft hypervisor or use the version of VirtualBox 6.1 and higher, which can work in parallel.

After installation is complete, it is recommended to install immediately Extension Pack. This package adds support for USB 2.0 and 3.0, disk encryption, and webcam forwarding. Without it, the functionality of the program will be significantly limited, especially if you plan to work with peripherals.

๐Ÿ’ก

Download Extension Pack only from the official Oracle website to avoid introducing malicious code into system drivers.

Creation and basic configuration of a virtual machine

Running the Create New Machine Wizard is your job. When you select the operating system name, the program will automatically detect the type and version, but it is better to double-check these parameters manually. Selecting the wrong OS type may result in incorrect hardware emulation.

Particular attention should be paid to the allocation of RAM. Hypervisor takes the specified amount of RAM from the main system immediately after starting the virtual machine. If you allocate too little, the guest OS will run slowly; if itโ€™s too much, your computer will start to slow down.

  • ๐Ÿ“Œ For Windows 10/11, it is recommended to allocate at least 4 GB of RAM.
  • ๐Ÿ“Œ Lightweight Linux distributions such as Lubuntu or Alpine, feel comfortable at 1-2 GB.
  • ๐Ÿ“Œ For server tasks without a graphical interface, 512 MB โ€“ 1 GB is often sufficient.

At the stage of creating a virtual hard disk, you should select the format VDI and storage type "Dynamic". This will allow the disk file to occupy only the actually used space on the physical media, and not the entire reserved space at once.

๐Ÿ“Š Which OS do you plan to run most often?
Windows 10
Windows 11
Linux (Ubuntu/Debian)
Linux (Arch/Manjaro)
macOS (Hackintosh)

Setting up the processor and video memory

The performance of the guest system directly depends on the correct distribution of computing power. In the "System" -> "Processor" section you can change the number of virtual cores. You should not give all the cores to the virtual machine, otherwise the host system will no longer have time to process background tasks.

It is considered optimal to allocate 50-70% of the available processor cores. For example, if your CPU has 4 cores, it is reasonable to choose 2 or 3 for the virtual machine. Also in this section there is a slider Execution Cap, which limits the CPU load of the guest OS in percentage.

The "Screen" tab requires setting the amount of video memory. The standard 16 MB is only suitable for console operating systems. To work with a graphical interface, especially in modern operating systems like Windows 10 or Ubuntu GNOME, you need to increase this setting to the maximum value (usually 128 MB or 256 MB).

๐Ÿ’ก

Enabling 3D acceleration in the screen settings is mandatory for smooth operation of window managers and hardware video decoding.

Don't forget to enable the "Enable 3D acceleration" option. This will allow the guest system to use your graphics card resources to render the interface. Without this option, window animations may jitter, and screen resolution will not scale when the window size is changed.

Installing Guest Additions

After installing the operating system, you will notice that the screen resolution does not change and the clipboard does not work between systems. The solution is a package Guest Additions. This is a set of drivers and system utilities that optimize the operation of a guest OS running a hypervisor.

To install, you need to select โ€œDevicesโ€ -> โ€œMount Guest Additions disk imageโ€ from the virtual machine menu. A new CD drive with the installer will appear in the operating system. On Windows, just run VBoxWindowsAdditions.exe, and in Linux - mount the disk and run the script VBoxLinuxAdditions.run via terminal.

sudo apt update

sudo apt install build-essential dkms linux-headers-$(uname -r)

sudo mount /dev/cdrom /media/cdrom

sudo /media/cdrom/VBoxLinuxAdditions.run

Successful installation of add-ons provides time synchronization, a shared clipboard and the ability to drag and drop files (Drag'n'Drop). There is also support for automatically changing screen resolution when stretching the virtual machine window.

โš ๏ธ Attention: If after installing Guest Additions the guest system stops loading or there is no sound, try uninstalling the update package through Programs and Features or the uninstall command in Linux, then reboot and install the version of the additions that strictly corresponds to the version of your VirtualBox.

Organization of shared folders and USB forwarding

File sharing between host and guest is one of the most requested features. Instead of setting up complex network shares, you can use the "Shared Folders" mechanism. This allows you to mount the directory of the main computer as a network drive inside the virtual machine.

To configure, go to "Devices" -> "Shared Folders" -> "Configure shared folders". Add the desired directory, give it a friendly path name and be sure to check the โ€œAuto-connectโ€ and โ€œCreate permanent folderโ€ checkboxes. Without the second checkmark, the folder will disappear after a reboot.

  • ๐Ÿ“ In Windows, the guest folder will appear in โ€œMy Computerโ€ as a network drive.
  • ๐Ÿ“ On Linux, access may require adding a user to a group vboxsf.
  • ๐Ÿ“ The speed of copying files through shared folders is much higher than through the network.

Forwarding USB devices requires preliminary installation of the Extension Pack, which was mentioned earlier. The "Devices" -> "USB" menu will display a list of controllers connected to the host. Select the desired device, and it will be โ€œdisconnectedโ€ from the main computer and connected to the virtual one.

Why is my USB device not visible in the list?

If the device is not shown, make sure that the Extension Pack is installed at the same version as VirtualBox itself. Also check whether the device is hijacked by another program on the host machine, for example, a virtual machine or specialized software.

Setting up network communication

VirtualBox network settings offer several operating modes, the choice of which depends on your tasks. By default, NAT is used, where the virtual machine accesses the Internet through the host's IP address, while remaining hidden from the external network.

Network Bridge mode (Bridged Adapter) makes the virtual machine a full-fledged node on your local network. It receives its own IP address from the router and is visible to other computers on the network. This is necessary for testing servers or network services.

Network mode Internet access Visibility from LAN Usage example
NAT Yes No Surfing, software installation
Network bridge Yes Yes Web server, printers
Virtual adapter No Yes (host only) Isolated testing
Internal network No Yes (between VMs) Cluster simulation

For a complex scenario where isolation is required but access to certain resources is needed, you can use Internal network. In this mode, virtual machines only see each other, but have no access to the outside world and cannot see the host computer unless it is specifically connected to the same internal network through a virtual adapter.

โ˜‘๏ธ Network check

Done: 0 / 5

Snapshots and state management

One of the most powerful features of virtualization is the ability to create snapshots of the system state (Snapshot). This allows you to capture an exact copy of the virtual machine at a specific point in time. If your system stops working after installing drivers or updating, you can roll back in seconds.

Don't confuse snapshots with backups. Snapshots take up disk space and are dependent on the main virtual machine file. Storing a large number of old snapshots can lead to fragmentation and poor disk performance.

Use snapshots before risky operations: updating the BIOS of a guest OS, installing unverified software, or changing the system registry. This is your insurance against data loss and reinstallation time.

โš ๏ธ Warning: Never delete snapshot files (.vdi or .vmdk) directly through File Explorer. This will damage the snapshot chain and result in data loss. Uninstall only through the snapshot manager in the VirtualBox interface.

Optimization and troubleshooting

If your virtual machine is running slowly, the first thing to do is check if virtualization is enabled in the host computer's BIOS/UEFI. Technologies Intel VT-x or AMD-V must be active. Without hardware support, the processor emulates instructions in software, which reduces performance significantly.

It is also worth paying attention to the antivirus of the host system. Sometimes security software starts scanning virtual disk files in real time, which creates a huge load. It is recommended to add the folder with virtual machines to antivirus exclusions.

Regularly clean up unused snapshots and defragment virtual disks if they are running in dynamic expansion mode. This will free up physical disk space and speed up data access.

๐Ÿ’ก

Hardware virtualization (VT-x/AMD-V) is the foundation of performance; Without it, running modern operating systems in VirtualBox is almost impossible.

Why doesn't the virtual machine start and gives an error?

Most often, the problem lies in a conflict with Hyper-V in Windows or lack of administrator rights. Also check if virtualization is enabled in the BIOS. If the error is related to EFI, try switching the system settings in the "Motherboard" section from EFI to Legacy BIOS or vice versa, depending on the requirements of the OS you are installing.

How to increase the size of a virtual disk?

There is no "expand disk" button in VirtualBox itself. You must use a command line utility VBoxManage with parameter resize. After expanding the disk file, you need to go to the guest OS and use Disk Management to expand the partition to unallocated space.

Is it possible to run VirtualBox on macOS with an M1/M2 processor?

The standard version of VirtualBox does not support the ARM architecture of Apple Silicon processors. For such computers there are special preview versions or alternatives like Parallels Desktop and UTM, which are better optimized for the ARM architecture.

Why do you need multiple network adapters?

Adding a second virtual network adapter allows you to split traffic. For example, the first adapter can be configured to NAT to access the Internet, and the second to "Internal Network" to communicate only with other virtual machines, providing testbed isolation.