1. Information

2. Hyper-V

Execution Engine:               native API
Nested Paging:                  Inactive
Unrestricted Execution:         Inactive
Execution Cap:                  100
Paravirtualization Interface:   Hyper-V
Processors:                     2
  • Note: VirtualBox with Hyper-V enabled only works on Windows 10 2004 and later.

  • Note: VirtualBox with Hyper-V enabled doesn’t work for vm’s with 64-bit Windows.

  • Enable Hyper-V.

    • Open Control Panel > Programs and Features.

    • Select Turn Windows features on or off.

    • Check Hyper-V.

    • Check Hyper-V | Hyper-V Management Tools.

    • Check Hyper-V | Hyper-V Management Tools | Hyper-V GUI Management Tools.

    • Check Hyper-V | Hyper-V Management Tools | Hyper-V Module for Windows PowerShell.

    • Check Hyper-V | Hyper-V Platform.

    • Check Hyper-V | Hyper-V Platform | Hyper-V Hypervisor.

    • Check Hyper-V | Hyper-V Platform | Hyper-V Services.

    • Click OK.

    • Click Don’t restart.

    • Close Programs and Features.

  • Enable Windows Hypervisor Platform.

    • Open Control Panel > Programs and Features.

    • Select Turn Windows features on or off.

    • Check Windows Hypervisor Platform.

    • Click OK.

    • Click Don’t restart.

    • Close Programs and Features.

  • Enter the following commands at a Command Prompt with administrative privileges.

    cd C:\Program Files\Oracle\VirtualBox
    VBoxManage.exe setextradata global "VBoxInternal/NEM/UseRing0Runloop" 0
  • Restart the computer.

3. Linux

3.1. Essential

  • Generate and enroll Secure Boot keys needed for modules signing.

  • Enter the following commands at a Command Line.

    sudo mkdir -p /var/lib/shim-signed/mok
    sudo openssl req -nodes -new -x509 -newkey rsa:2048 -outform DER \
      -addext "extendedKeyUsage=codeSigning" \
      -keyout /var/lib/shim-signed/mok/MOK.priv \
      -out /var/lib/shim-signed/mok/MOK.der
    sudo mokutil --import /var/lib/shim-signed/mok/MOK.der
    sudo reboot
  • Disable the kernel module responsible for KVM (Kernel-based Virtual Machine) as it conflicts with VirtualBox. This means that it is not possible to run both VirtualBox and KVM at the same time.

  • See https://superuser.com/questions/1845776/virtualbox-cant-operate-in-vmx-mode.

  • Enter the following commands at a Command Line.

    # These commands only last until the next reboot.
    sudo modprobe -r kvm_amd        # AMD cpu.
    sudo modprobe -r kvm_intel      # Intel cpu.
    
    # Make it permanent.
    file="/etc/modprobe.d/blacklist.conf"
    # Back up original file if backup file is missing.
    if [ -f "${file}" ] && [ ! -f "${file}.org" ]; then cp -a "${file}" "${file}.org"; fi
    line="blacklist kvm_amd"
    if ! grep -iq "${line}" "${file}"; then echo "${line}" >> "${file}"; fi
    line="blacklist kvm_intel"
    if ! grep -iq "${line}" "${file}"; then echo "${line}" >> "${file}"; fi

3.2. Installation

  • Enter the following commands at a Command Line.

    sudo apt-get install gcc make perl
    sudo apt-get install linux-headers-$(uname -r)
    sudo apt-get install psmisc
    sudo apt-get install libqt6core6t64 libqt6dbus6 libqt6gui6 libqt6help6 \
      libqt6printsupport6 libqt6statemachine6 libqt6widgets6 libqt6xml6
    sudo apt-get install pkexec
    
    # Mount USB drive with VirtualBox installation files.
    ls -al /dev/mapper/
    sudo bklid
    sudo cryptsetup open --type=bitlk /dev/sda1 usb
    sudo mkdir -p /mnt/usb
    sudo mount /dev/mapper/usb /mnt/usb
    
    # Verify checksums of installation files.
    cd /mnt/usb/Software/Oracle/VirtualBox/VirtualBox-7.2.6
    sha256sum --check _Readme.sha256
    
    # Install VirtualBox.
    sudo dpkg -i virtualbox-7.2_7.2.6-172322~Debian~trixie_amd64.deb
    sudo /sbin/vboxconfig
    
    # Unmount USB drive with VirtualBox installation files.
    sudo umount /mnt/usb
    sudo cryptsetup close usb

4. Windows

4.1. Information

The default machine folder is set to D:\VirtualBox\VirtualBox VMs, meaning that all new virtual machines and any clone of an existing virtual machine end up under that folder. However, a virtual machine can be moved to another drive or folder by the following procedure.

  • Start VirtualBox, remove the virtual machine and close VirtualBox.

  • Move the folder containing the virtual machine.

  • Start VirtualBox, add the virtual machine and close VirtualBox.

When creating a new virtual machine with a new virtual disk, the containing folder and its files get their name from the virtual machine. VirtualBox throws an error when trying to create a new virtual machine with the name of an existing folder.

To create a new virtual machine with an existing .vdi or .vmdk disk file and end up with the containing folder and its files having the same name as the virtual machine is not that easy. However, the following procedure just does that.

  • Start VirtualBox, create a new virtual machine with the existing disk file and close VirtualBox.

  • Move the existing disk file to the containing folder of the new virtual machine.

  • Rename the existing disk file to the name of the containing folder.

  • Set the path of the disk file in the .vbox file to the new location.

4.2. Preparations

  • Log on as Administrator.

  • Start Windows Explorer.

  • Create the D:\VirtualBox\VirtualBox VMs folder.

  • Close Windows Explorer.

  • Legacy Windows: Open Settings > System > About > Advanced system settings.

  • Modern Windows: Open Control Panel > System > Advanced system settings.

  • Select the Advanced tab.

  • Click Environment Variables.

  • Click New in the System variables panel.

    Variable name:          VBOX_USER_HOME
    Variable value:         D:\VirtualBox
  • Click OK.

  • Click OK.

  • Click OK.

  • Enter the following commands at a Command Prompt with administrative privileges.

    Disable-VirtualizationBasedSecurity
  • Restart the computer.

4.3. Installation

  • Note: Copy the VirtualBox installation file to the local hard drive. If it is located on a network drive the installation will fail due to the network connection being temporarily disconnected.

  • Run the VirtualBox-7.2.6a-172322-Win.exe file with administrative privileges.

  • Click Next.

  • Choose I accept the terms of the license agreement.

  • Click Next.

  • Don’t install VirtualBox Python Support.

    ■ VirtualBox Application
      ■ VirtualBox USB Support
      ■ VirtualBox Networking
        ■ VirtualBox Bridge Networking
        ■ VirtualBox Host-Only Networking
      □ VirtualBox Python Support
    
    Installation Location:  C:\Program Files\Oracle\VirtualBox
  • Click Next.

  • Click Yes to proceed with the installation.

  • Uncheck Create a desktop shortcut.

  • Uncheck Start by default when opening .ova or .ovf files.

    ■ Add to Start menu
    □ Create a desktop shortcut
    □ Start by default when opening .ova or .ovf files
  • Click Next.

  • Click Install.

  • Uncheck Start Oracle VirtualBox 7.2.6?.

  • Click Finish.

4.4. Extension Pack

  • Start VirtualBox with administrative privileges.

  • Select File > Tools > Extensions.

  • Click Install or Upgrade.

  • Select the Oracle_VirtualBox_Extension_Pack-7.2.6.vbox-extpack file.

  • Click Open.

  • Click Install.

  • Scroll down to the bottom in the VirtualBox License window.

  • Click I Agree.

  • Close VirtualBox.

4.5. Configuration

  • Start VirtualBox.

  • Select File > Preferences.

  • Select the General tab.

  • Select Default Machine Folder > Other.

  • Select the D:\VirtualBox\VirtualBox VMs folder.

  • Click Select Folder.

    Default Machine Folder:         D:\VirtualBox\VirtualBox VMs
  • Click OK.

  • Close VirtualBox.

4.6. Usage

4.6.1. Create VM

Windows 10
  • Start VirtualBox.

  • Select the Windows 10 group.

  • Expand the Windows 10 group.

  • Select Group > New Machine.

    Name:                   Windows 10 Enterprise 2004 64-bit - Reference
    Type:                   Microsoft Windows
    Version:                Windows 10 (64 bit)
  • Click Next.

    Memory size:            2048 MB
  • Click Next.

  • Choose Create a virtual hard disk now.

  • Click Create.

  • Choose VDI (VirtualBox Disk Image).

  • Click Next.

  • Choose Dynamically allocated.

  • Click Next.

  • MBR: Change the size to 204902.00 MB.

  • UEFI: Change the size to 204922.00 MB.

    Location:               Windows 10 Enterprise 2004 64-bit - Reference
    Size:                   204902.00 MB
  • Click Create.

  • Select the Windows 10 > Windows 10 Enterprise 2004 64-bit virtual machine.

  • Click Settings.

  • Select the General page.

  • Select the Advanced tab.

  • Select Shared Clipboard > Bidirectional.

  • Select the System page.

  • Select the Motherboard tab.

  • Uncheck Boot Order > Floppy.

  • UEFI: Check Enable EFI (special OSes only).

  • Select the Processor tab.

  • Select Processor(s) > 2.

  • Select the Storage page.

  • 32-bit: Select Controller: SATA > Windows 10 Enterprise 2004 32-bit - Reference.vdi.

  • 64-bit: Select Controller: SATA > Windows 10 Enterprise 2004 64-bit - Reference.vdi.

  • Check Solid-state Drive.

  • Select the Shared Folders page.

  • Click the Add button.

  • Select Folder Path > Other.

  • Select the D:\ folder.

  • Click Select Folder.

  • Check Auto-mount.

    Folder Path:            D:\
    Folder Name:            D_DRIVE
                            □ Read-only
                            ■ Auto-mount
    Mount point:            D:
  • Click OK.

  • Click OK.

  • Close VirtualBox.

Windows 11
  • Note: Windows 11 24H2 and Windows Server 2025 just sit at the splash screen.

  • See https://forums.virtualbox.org/viewtopic.php?t=112538.

  • See https://forums.virtualbox.org/viewtopic.php?t=111328.

    • Select System > Motherboard > Chipset: ICH9. DOES NOT WORK.

    • Uncheck System > Acceleration > Enable Nested Paging. DOES NOT WORK.

    • Enable hpet, see below. DOES NOT WORK.

      cd "Program Files\Oracle\VirtualBox"
      VBoxManage.exe modifyvm "G:\VirtualBox Great\VirtualBox VMs\Windows\Windows 11\Windows 11 Pro 24H2\Windows 11 Pro 24H2.vbox" --hpet on
      VBoxManage.exe modifyvm "G:\VirtualBox Great\VirtualBox VMs\Windows\Windows 11\Windows 11 Pro 24H2\Windows 11 Pro 24H2.vbox" --hpet off
  • Start VirtualBox.

  • Enterprise: Select the Windows 11 Enterprise group.

  • Pro: Select the Windows 11 Pro group.

  • Select Group > New Machine.

    Name:                   Windows 11 Enterprise 22H2 64-bit - Reference           # For Windows 11 Enterprise
    Name:                   Windows 11 Pro 22H2 64-bit - Reference                  # For Windows 11 Pro
    Folder:                 D:\VirtualBox\VirtualBox VMs
    ISO Image:              <not selected>
    Edition:
    Type:                   Microsoft Windows
    Version:                Windows 11 (64 bit)
    □ Skip Unattended Installation
  • Click Next.

    Base Memory:                    40962048 MB
    Processors:                     2
    ■ Enable EFI (special OSes only)
  • Click Next.

  • Choose Create a virtual hard disk now.

    Disk Size:                      200.00 GB
  • Uncheck Pre-allocate Full Size.

  • Click Next.

  • Click Finish.

  • Select the Windows 11 Enterprise > Windows 11 Enterprise 22H2 64-bit - Reference virtual machine.

  • Click Settings.

  • Select the General page.

  • Select the Advanced tab.

  • Select Shared Clipboard > Bidirectional.

  • Select the System page.

  • Select the Motherboard tab.

  • Uncheck Boot Order > Floppy.

  • Check Enable I/O APIC.

  • Uncheck Enable Hardware Clock in UTC Time.

  • Check Enable EFI (special OSes only).

  • Check Enable Secure Boot.

  • Select the Storage page.

  • Select Controller: SATA > Windows 11 Enterprise 22H2 64-bit - Reference.vdi.

  • Check Solid-state Drive.

  • Select the Shared Folders page.

  • Click the Add button.

  • Select Folder Path > Other.

  • Select the D:\ folder.

  • Click Select Folder.

  • Type D: in the Mount point field.

  • Uncheck Read-only.

  • Check Auto-mount.

    Folder Path:            D:\
    Folder Name:            D_DRIVE
    Mount point:            D:
                            □ Read-only
                            ■ Auto-mount
  • Click OK.

  • Click OK.

  • Close VirtualBox.

4.6.2. Relocate VM

  • Start VirtualBox.

  • Select the Windows 10 > Windows 10 Enterprise 1903 64-bit virtual machine.

  • Select Machine > Remove.

  • Click Remove only.

  • Close VirtualBox.

  • Start File Explorer.

  • Select the D:\VirtualBox\VirtualBox VMs\Windows 10 folder.

  • Right-click the Windows 10 Enterprise 1903 64-bit folder.

  • Select Cut.

  • Select the V:\VirtualBox Quick\VirtualBox VMs folder.

  • Right-click Windows 10.

  • Select Paste.

  • Close File Explorer.

  • Start VirtualBox.

  • Select Group > Add Machine.

  • Select the V:\VirtualBox Quick\VirtualBox VMs\Windows 10 folder.

  • Select the Windows 10 Enterprise 1903 64-bit folder.

  • Select the Windows 10 Enterprise 1903 64-bit.vbox file.

  • Click Open.

  • Close VirtualBox.

4.6.3. Edit VM Settings

  • Start VirtualBox.

  • Select the Windows 10 > Windows 10 Enterprise 1903 64-bit virtual machine.

  • Click Settings.

  • Select the Storage page.

  • Select Controller: SATA > Empty.

  • Click the CD button.

  • Select Choose Virtual Optical Disk File.

  • 32-bit: Select the en_windows_10_business_editions_version_1903_x86_dvd_ca4f0f49.iso file.

  • 64-bit: Select the en_windows_10_business_editions_version_1903_x64_dvd_37200948.iso file.

  • Click Open.

  • Click OK.

  • Close VirtualBox.

4.6.4. Clear VM Free Space

4.6.4.1. Linux
  • Start VirtualBox.

  • Select the virtual machine.

  • Select Settings.

  • Select the Storage page.

  • Select Controller: IDE | Empty.

  • Click the CDROM icon and select Choose a disk file.

  • Select the debian-live-10.10.0-amd64-standard.iso iso image.

  • Boot the virtual machine from the debian-live-10.10.0-amd64-standard.iso iso image.

  • Select Debian GNU/Linux Live and press Enter.

  • Enter the following commands at a Command Line.

    lsblk -l | grep -E "disk|part"
    sudo mount -n -o ro -t ext4 -v /dev/sda1 /mnt
    sudo /mnt/usr/sbin/zerofree -v /dev/sda1
    sudo umount /mnt
    sudo shutdown -h now
  • Select Settings.

  • Select the Storage page.

  • Select Controller: IDE | debian-live-10.10.0-amd64-standard.iso.

  • Click the CDROM icon and select Remove Disk from Virtual Drive.

  • Click OK.

  • Close VirtualBox.

4.6.4.2. macOS
  • Start VirtualBox.

  • Start the virtual machine.

  • Logon as <User>.

  • Enter the following commands at a Command Line.

    cat /dev/zero > wipefile; rm wipefile
  • Shutdown the virtual machine.

  • Close VirtualBox.

4.6.4.3. Windows
  • Start VirtualBox.

  • Start the virtual machine.

  • Start Command Prompt with administrative privileges.

  • Type Clear-FreeSpace C: and press Enter.

  • Wait for the zeroing of free space to finish.

  • Type exit and press Enter.

  • Shutdown the virtual machine.

  • Close VirtualBox.

4.6.5. Compact VM Disk Images

  • Note: The Compress-VirtualBox command will compact all .vdi files.

  • Log on as <User>.

    cd /d "D:\VirtualBox\VirtualBox VMs\Debian 10\BIOS - Debian 10 64-bit"
    cd /d "V:\VirtualBox Quick\VirtualBox VMs\macOS\macOS 11 Big Sur"
    cd /d "V:\VirtualBox Quick\VirtualBox VMs\Windows 10\Windows 10 Pro 2004 64-bit - Reference"
    dir
    rem Make sure that VirtualBox is not running.
    Compress-VirtualBox
    dir

4.7. Host-only networking

  • Start VirtualBox with administrative privileges.

  • Select File > Preferences.

  • Select the Network page.

  • Select the Host-only Networks tab.

  • Select VirtualBox Host-Only Ethernet Adapter.

  • Click the Edits selected host-only network button.

  • Select the Adapter tab.

    IPv4 Address:                   192.168.56.254
    IPv4 Network Mask:              255.255.255.0
  • Select the DHCP Server tab.

    ■ Enable Server
    
    Server Address:                 192.168.56.100
    Server Mask:                    255.255.255.0
    Lower Address Bound:            192.168.56.101
    Upper Address Bound:            192.168.56.254
  • Click OK.

  • Click OK.

  • Close VirtualBox.

  • Start VirtualBox with administrative privileges.

  • Select File > Preferences.

  • Select the Network page.

  • Select the Host-only Networks tab.

  • Click the Adds new host-only network button.

  • Select VirtualBox Host-Only Ethernet Adapter #2.

  • Click the Edits selected host-only network button.

  • Select the Adapter tab.

    IPv4 Address:                   10.10.10.254
    IPv4 Network Mask:              255.255.255.0
  • Select the DHCP Server tab.

    □ Enable Server
  • Click OK.

  • Click OK.

  • Close VirtualBox.

  • Start VirtualBox with administrative privileges.

  • Select File > Preferences.

  • Select the Network page.

  • Select the Host-only Networks tab.

  • Click the Adds new host-only network button.

  • Select VirtualBox Host-Only Ethernet Adapter #3.

  • Click the Edits selected host-only network button.

  • Select the Adapter tab.

    IPv4 Address:                   192.168.24.254
    IPv4 Network Mask:              255.255.255.0
  • Select the DHCP Server tab.

    □ Enable Server
  • Click OK.

  • Click OK.

  • Close VirtualBox.

  • Start VirtualBox with administrative privileges.

  • Select File > Preferences.

  • Select the Network page.

  • Select the Host-only Networks tab.

  • Click the Adds new host-only network button.

  • Select VirtualBox Host-Only Ethernet Adapter #4.

  • Click the Edits selected host-only network button.

  • Select the Adapter tab.

    IPv4 Address:                   172.16.168.254
    IPv4 Network Mask:              255.255.255.0
  • Select the DHCP Server tab.

    □ Enable Server
  • Click OK.

  • Click OK.

  • Close VirtualBox.

  • Start VirtualBox with administrative privileges.

  • Select File > Preferences.

  • Select the Network page.

  • Select the Host-only Networks tab.

  • Click the Adds new host-only network button.

  • Select VirtualBox Host-Only Ethernet Adapter #5.

  • Click the Edits selected host-only network button.

  • Select the Adapter tab.

    IPv4 Address:                   192.168.88.254
    IPv4 Network Mask:              255.255.255.0
  • Select the DHCP Server tab.

    □ Enable Server
  • Click OK.

  • Click OK.

  • Close VirtualBox.

  • Start VirtualBox with administrative privileges.

  • Select File > Preferences.

  • Select the Network page.

  • Select the Host-only Networks tab.

  • Click the Adds new host-only network button.

  • Select VirtualBox Host-Only Ethernet Adapter #6.

  • Click the Edits selected host-only network button.

  • Select the Adapter tab.

    IPv4 Address:                   192.168.67.254
    IPv4 Network Mask:              255.255.255.0
  • Select the DHCP Server tab.

    □ Enable Server
  • Click OK.

  • Click OK.

  • Close VirtualBox.

4.8. Port forwarding

  • Log on as <User>.

  • Start VirtualBox.

  • Select a virtual machine.

  • Click Settings.

  • Select the Network page.

  • Select the Adapter 1 tab.

  • Expand Advanced.

  • Click Port Forwarding.

  • Click the Adds new port forwarding rule button.

    Name       Protocol   Host IP    Host Port  Guest IP   Guest Port
    ---------- ---------- ---------- ---------- ---------- ----------
    HTTP       TCP        127.0.0.1  80         10.0.2.15  80
    HTTP3000   TCP        127.0.0.1  3000       10.0.2.15  3000
    HTTP3443   TCP        127.0.0.1  3443       10.0.2.15  3443
    HTTP8080   TCP        127.0.0.1  8080       10.0.2.15  8080
    HTTP8888   TCP        127.0.0.1  8888       10.0.2.15  8888
    RDP        TCP        127.0.0.1  33389      10.0.2.15  3389
    SSH        TCP        127.0.0.1  2222       10.0.2.15  22
  • Click OK.

  • Click OK.

  • Close VirtualBox.

  • Enter the following commands at a Command Prompt.

    mstsc.exe /v localhost:33389
    putty 127.0.0.1 2222
    putty localhost 2222
  • Start PuTTY.

    Host Name (or IP address):      127.0.0.1
    Host Name (or IP address):      localhost
    Port:                           2222
  • Click Open.

  • Close PuTTY.