Debian 12 bookworm
Sponsored Link

VirtualBox : Create Virtual Machine2023/07/20


Create a Virtual Machine.
On this example, create VM to install Debian 12.

[1] Create a Virtual Machine.
# create a directory for VM

mkdir /var/lib/vbox
# create a VM

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

VBoxManage modifyvm Debian_12 \
--cpus 4 \
--memory 4096 \
--nic1 bridged \
--bridgeadapter1 enp1s0 \
--boot1 dvd \
--graphicscontroller vmsvga \
--vrde on \
--vrdeport 5001
# configure storage for VM

VBoxManage storagectl Debian_12 --name "Debian_12_SATA" --add sata

VBoxManage createhd \
--filename /var/lib/vbox/Debian_12/Debian_12.vdi \
--size 20480 \
--format VDI \
--variant Standard

Medium created. UUID: a86b5375-b406-4c15-b163-07a6460ff6f5
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

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

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

VBoxManage storageattach Debian_12 --storagectl Debian_12_SATA --port 0 --device 0 --medium none

[2] Start a Virtual Machine.
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

VBoxManage controlvm Debian_12 poweroff
# * if remove VM, run like follows

VBoxManage unregistervm Debian_12

[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.
[4] After connected successfully, VM console is shown.
[5] Installation finished and Virtual Machine is running normally.
Matched Content