VirtualBox : Create Virtual Machine2021/09/28 |
Create a Virtual Machine.
On this example, create VM to install Debian 11. |
|
[1] | Create a Virtual Machine. |
# create a VM root@dlp:~# VBoxManage createvm \ --name Debian_11 \ --ostype Debian_64 \ --register \ --basefolder /var/lib/vbox Virtual machine 'Debian_11' is created and registered. UUID: 950f7aa6-1df4-4d2a-9d05-d7ecfe9985ad Settings file: '/var/lib/vbox/Debian_11/Debian_11.vbox' # modify settings for VM # replace interface name [enp1s0] to your own environment root@dlp:~# VBoxManage modifyvm Debian_11 \
--cpus 4 \ --memory 4096 \ --nic1 bridged \ --bridgeadapter1 enp1s0 \ --boot1 dvd \ --vrde on \ --vrdeport 5001 # configure storage for VM root@dlp:~# VBoxManage storagectl Debian_11 --name "Debian_11_SATA" --add sata root@dlp:~# VBoxManage createhd \ --filename /var/lib/vbox/Debian_11/Debian_11.vdi \ --size 20480 \ --format VDI \ --variant Standard 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 972ad95d-d0f2-46c3-b6e8-b577286b8c70
root@dlp:~#
VBoxManage storageattach Debian_11 \
--storagectl Debian_11_SATA \ --port 1 \ --type hdd \ --medium /var/lib/vbox/Debian_11/Debian_11.vdi # configure DVD drive for VM # example below, it specifies an ISO file for installation root@dlp:~# VBoxManage storageattach Debian_11 \
--storagectl Debian_11_SATA \ --port 0 \ --type dvddrive \ --medium /home/debian-11.0.0-amd64-DVD-1.iso # confirm settings for VM root@dlp:~# VBoxManage showvminfo Debian_11 Name: Debian_11 Groups: / Guest OS: Debian (64-bit) UUID: 950f7aa6-1df4-4d2a-9d05-d7ecfe9985ad Config file: /var/lib/vbox/Debian_11/Debian_11.vbox Snapshot folder: /var/lib/vbox/Debian_11/Snapshots Log folder: /var/lib/vbox/Debian_11/Logs Hardware UUID: 950f7aa6-1df4-4d2a-9d05-d7ecfe9985ad 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 Boot Device 1: DVD Boot Device 2: DVD Boot Device 3: HardDisk Boot Device 4: Not Assigned ACPI: enabled IOAPIC: enabled BIOS APIC mode: APIC ..... ..... # * if dettach DVD, run like follows root@dlp:~# VBoxManage storageattach Debian_11 --storagectl Debian_11_SATA --port 0 --device 0 --medium none |
[2] | Start a Virtual Machine. |
root@dlp:~#
VBoxManage startvm Debian_11 --type headless Waiting for VM "Debian_11" to power on... VM "Debian_11" has been successfully started. # * if stop VM, run like follows root@dlp:~# VBoxManage controlvm Debian_11 poweroff
# * if remove VM, run like follows root@dlp:~# VBoxManage unregistervm Debian_11 |
[3] | On enabled VRDP environment, it's possible to connect with RDP. The example below is on Windows 10. 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. |
Sponsored Link |