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

root@dlp:~#
mkdir /var/lib/vbox
# create a VM

root@dlp:~#
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@dlp:~#
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@dlp:~#
VBoxManage storagectl Debian_12 --name "Debian_12_SATA" --add sata

root@dlp:~#
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@dlp:~#
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@dlp:~#
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@dlp:~#
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@dlp:~#
VBoxManage storageattach Debian_12 --storagectl Debian_12_SATA --port 0 --device 0 --medium none

[2] Start a Virtual Machine.
root@dlp:~#
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@dlp:~#
VBoxManage controlvm Debian_12 poweroff
# * if remove VM, run like follows

root@dlp:~#
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