Introduction
This guide provides a comprehensive overview of installing VirtualBox on Debian 12 Bookworm, using the 5W1H approach: What, Who, Where, When, Why, How, along with the consequences and conclusion.
Overview
What
VirtualBox is a powerful open-source virtualization software that allows users to run multiple operating systems simultaneously on a single hardware host. It is essential for developers, testers, and anyone needing to use different operating systems.
Who
This guide is intended for users of Debian 12 Bookworm who need to install VirtualBox for virtualization purposes. This includes developers, system administrators, testers, and technical enthusiasts.
Where
The installation can be performed on any computer running Debian 12 Bookworm. Make sure you have administrative privileges to install software.
When
You should install VirtualBox when you need to run multiple operating systems on your Debian machine, either for development, testing, or other purposes.
Why
Installing VirtualBox on Debian 12 Bookworm has its pros and cons:
Pros | Cons |
---|---|
Easy to set up and use | Can be resource-intensive |
Supports multiple OS types | Potential performance overhead |
Great for testing and development | Requires substantial disk space |
Free and open-source | Compatibility issues with some hardware |
How
Follow these steps to install VirtualBox on Debian 12 Bookworm:
Step 1 | Update your system: sudo apt update && sudo apt upgrade |
Step 2 | Add the VirtualBox repository: sudo add-apt-repository "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bookworm contrib" |
Step 3 | Download the Oracle public key for apt-secure: wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - |
Step 4 | Install VirtualBox: sudo apt install virtualbox-6.1 |
Step 5 | Verify the installation: vboxmanage --version |
Consequences
Installing VirtualBox on Debian 12 Bookworm enables users to create and manage virtual machines efficiently. This can lead to increased productivity, better testing environments, and the ability to run different operating systems on a single hardware platform. However, it may also lead to higher system resource usage and potential compatibility issues with specific hardware configurations.
Positive | Enhanced flexibility and testing capabilities |
Negative | Increased resource consumption and potential performance impacts |
Conclusion
Installing VirtualBox on Debian 12 Bookworm is a straightforward process that can provide significant benefits for users needing to run multiple operating systems. While there are some potential drawbacks, the advantages often outweigh the disadvantages, making VirtualBox a valuable tool for development, testing, and other virtualization needs.
Install
Install Oracle VM VirtualBox to configure Virtualization Environment.
Step [1]Install required packages.
root@bizantum:~# LINUX_HEADERS=$(uname -r)
root@bizantum:~# apt -y install gcc make linux-headers-$LINUX_HEADERS dkms
Step [2]Install VirtualBox.
root@bizantum:~# curl -fsSL https://www.virtualbox.org/download/oracle_vbox_2016.asc -o /etc/apt/keyrings/oracle_vbox.key
root@bizantum:~# echo "deb [signed-by=/etc/apt/keyrings/oracle_vbox.key] https://download.virtualbox.org/virtualbox/debian bookworm contrib" | tee /etc/apt/sources.list.d/oracle_vbox.list
root@bizantum:~# apt update
root@bizantum:~# apt search ^virtualbox-
Sorting... Done
Full Text Search... Done
virtualbox-6.1/unknown 6.1.46-158378~Debian~bookworm amd64
Oracle VM VirtualBox
virtualbox-7.0/unknown 7.0.10-158379~Debian~bookworm amd64
Oracle VM VirtualBox
root@bizantum:~# apt -y install virtualbox-7.0
root@bizantum:~# VBoxManage -v
7.0.10r158379
Step [3]Install extension pack to use VRDP (Virtual Remote Desktop Protocol).
# download extension pack for installed version
root@bizantum:~# VER=$(VBoxManage -v | cut -d'r' -f1)
root@bizantum:~# wget http://download.virtualbox.org/virtualbox/$VER/Oracle_VM_VirtualBox_Extension_Pack-$VER.vbox-extpack
root@bizantum:~# VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-$VER.vbox-extpack
.....
.....
Do you agree to these license terms and conditions (y/n)? y
License accepted. For batch installation add
--accept-license=33d7284dc4a0ece381196fda3cfe2ed0e1e8e7ed7f27b9a9ebc4ee22e24bd23c
to the VBoxManage command line.
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully installed "Oracle VM VirtualBox Extension Pack".
root@bizantum:~# VBoxManage list extpacks
Extension Packs: 1
Pack no. 0: Oracle VM VirtualBox Extension Pack
Version: 7.0.10
Revision: 158379
Edition:
Description: Oracle Cloud Infrastructure integration, Host Webcam, VirtualBox RDP, PXE ROM, Disk Encryption, NVMe, full VM encryption.
VRDE Module: VBoxVRDP
Crypto Module: VBoxPuelCrypto
Usable: true
Why unusable:
Create Virtual Machine
Create a Virtual Machine. On this example, create VM to install Debian 12.
Step [1]Create a Virtual Machine.
# create a directory for VM
root@bizantum:~# mkdir /var/lib/vbox
# create a VM
root@bizantum:~# VBoxManage createvm \
--name Debian_12 \
--ostype Debian_64 \
--register \
--basefolder /var/lib/vbox
Virtual machine 'Debian_12' is created and registered.
UUID: fa704558-40ef-420d-97f8-df1902454142
Settings file: '/var/lib/vbox/Debian_12/Debian_12.vbox'
# modify settings for VM
# replace interface name [enp1s0] to your own environment
root@bizantum:~# VBoxManage modifyvm Debian_12 \
--cpus 4 \
--memory 4096 \
--nic1 bridged \
--bridgeadapter1 enp1s0 \
--boot1 dvd \
--graphicscontroller vmsvga \
--vrde on \
--vrdeport 5001
# configure storage for VM
root@bizantum:~# VBoxManage storagectl Debian_12 --name "Debian_12_SATA" --add sata
root@bizantum:~# VBoxManage createhd \
--filename /var/lib/vbox/Debian_12/Debian_12.vdi \
--size 20480 \
--format VDI \
--variant Standard
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: a86b5375-b406-4c15-b163-07a6460ff6f5
root@bizantum:~# VBoxManage storageattach Debian_12 \
--storagectl Debian_12_SATA \
--port 1 \
--type hdd \
--medium /var/lib/vbox/Debian_12/Debian_12.vdi
# configure DVD drive for VM
# example below, it specifies an ISO file for installation
root@bizantum:~# VBoxManage storageattach Debian_12 \
--storagectl Debian_12_SATA \
--port 0 \
--type dvddrive \
--medium /home/debian-12.0.0-amd64-DVD-1.iso
# confirm settings for VM
root@bizantum:~# VBoxManage showvminfo Debian_12
Name: Debian_12
Encryption: disabled
Groups: /
Guest OS: Debian (64-bit)
UUID: fa704558-40ef-420d-97f8-df1902454142
Config file: /var/lib/vbox/Debian_12/Debian_12.vbox
Snapshot folder: /var/lib/vbox/Debian_12/Snapshots
Log folder: /var/lib/vbox/Debian_12/Logs
Hardware UUID: fa704558-40ef-420d-97f8-df1902454142
Memory size: 4096MB
Page Fusion: disabled
VRAM size: 8MB
CPU exec cap: 100%
HPET: disabled
CPUProfile: host
Chipset: piix3
Firmware: BIOS
Number of CPUs: 4
PAE: enabled
Long Mode: enabled
Triple Fault Reset: disabled
APIC: enabled
X2APIC: enabled
Nested VT-x/AMD-V: disabled
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode: message and menu
.....
.....
# * if detach DVD, run like follows
root@bizantum:~# VBoxManage storageattach Debian_12 --storagectl Debian_12_SATA --port 0 --device 0 --medium none
Step [2]Start a Virtual Machine.
root@bizantum:~# VBoxManage startvm Debian_12 --type headless
Waiting for VM "Debian_12" to power on...
VM "Debian_12" has been successfully started.
# * if stop VM, run like follows
root@bizantum:~# VBoxManage controlvm Debian_12 poweroff
# * if remove VM, run like follows
root@bizantum:~# VBoxManage unregistervm Debian_12
Step [3]On enabled VRDP environment, it's possible to connect with RDP. The example below is on Windows 11. Run Remote Desktop Client and specify [(VirtualBox Server's Hostname or IP address):(vrdeport set for the VM)] to connect to VM.
Step [4]After connected successfully, VM console is shown.
Step [5]Installation finished and Virtual Machine is running normally.
Install GuestAdditions
Install [GuestAdditions] into a Virtual Machine to improve Virtual Machine's System Performance. On the example below, it shows to install [GuestAdditions] on a Virtual Machine [Debian_12].
Step [1]Attach [GuestAdditions]' disk to the VM on VirtualBox Host. The target VM must be stopped.
root@bizantum:~# VBoxManage storageattach Debian_12 \
--storagectl Debian_12_SATA \
--port 0 \
--type dvddrive \
--medium /usr/share/virtualbox/VBoxGuestAdditions.iso
Step [2]Start the VM and login to it, then Install [GuestAdditions] on it.
# install required packages first
root@guest:~# LINUX_HEADERS=$(uname -r)
root@guest:~# apt -y install gcc make bzip2 linux-headers-$LINUX_HEADERS
root@guest:~# mount /dev/cdrom /mnt
root@guest:~# cd /mnt
root@guest:/mnt# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 6.1.26 Guest Additions for Linux........
VirtualBox Guest Additions installer
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules. This may take a while.
.....
.....
root@guest:/mnt# reboot
After installing [GuestAdditions], System Performance will be improved.
Create Virtual Machines (GUI)
If you installed Desktop Environment, it's possible to create Virtual Machines on GUI. This example shows to install Windows Server 2022 on GUI.
Step [1]Run [Applications] - [Oracle VM VirtualBox].
Step [2]Click the [New] button on upper menu.
Step [3]Configure the name of VM and the type of OS and so on.
Step [4]Specify the amount of memory and CPU count for Virtual Machine.
Step [5]Configure Virtual hard disk.
Step [6]Confirm settings you selected and click the [Finish] button if that's OK.
Step [7]Click the [Start] icon on upper menu to start Virtual Machine.
Step [8]Virtual Machine started.
Step [9]Installation has finished and Virtual Machine is running.
- Get link
- X
- Other Apps
Comments
Post a Comment
Thank you for your comment! We appreciate your feedback, feel free to check out more of our articles.
Best regards, Bizantum Blog Team.