VirtualBox : Create Virtual Machines2022/09/01 |
Create a Virtual Machine.
On this example, create a VM to install Ubuntu 22.04. |
|
[1] | Create a Virtual Machine. |
# create a VM root@dlp:~# VBoxManage createvm \ --name Ubuntu_2204 \ --ostype Ubuntu_64 \ --register \ --basefolder /var/vbox Virtual machine 'Ubuntu_2204' is created and registered. UUID: 9b7e23a0-20d6-450d-9b82-af13453888a1 Settings file: '/var/vbox/Ubuntu_2204/Ubuntu_2204.vbox' # modify settings for VM # replace interface name [ens33] to your own environment root@dlp:~# VBoxManage modifyvm Ubuntu_2204 \
--cpus 4 \ --memory 4096 \ --nic1 bridged \ --bridgeadapter1 ens33 \ --boot1 dvd \ --vrde on \ --vrdeport 5001 # configure storage for VM root@dlp:~# VBoxManage storagectl Ubuntu_2204 --name "Ubuntu_2204_SATA" --add sata root@dlp:~# VBoxManage createhd \ --filename /var/vbox/Ubuntu_2204/Ubuntu_2204.vdi \ --size 20480 \ --format VDI \ --variant Standard 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 229cbe70-62e3-4232-86c7-4406aa58b083 root@dlp:~# VBoxManage storageattach Ubuntu_2204 \
--storagectl Ubuntu_2204_SATA \ --port 1 \ --type hdd \ --medium /var/vbox/Ubuntu_2204/Ubuntu_2204.vdi # configure DVD drive for VM # example below, it specifies an ISO file for installation root@dlp:~# VBoxManage storageattach Ubuntu_2204 \
--storagectl Ubuntu_2204_SATA \ --port 0 \ --type dvddrive \ --medium /home/ubuntu-22.04-live-server-amd64.iso # confirm settings for VM root@dlp:~# VBoxManage showvminfo Ubuntu_2204 Name: Ubuntu_2204 Groups: / Guest OS: Ubuntu (64-bit) UUID: 9b7e23a0-20d6-450d-9b82-af13453888a1 Config file: /var/vbox/Ubuntu_2204/Ubuntu_2204.vbox Snapshot folder: /var/vbox/Ubuntu_2204/Snapshots Log folder: /var/vbox/Ubuntu_2204/Logs Hardware UUID: 9b7e23a0-20d6-450d-9b82-af13453888a1 Memory size: 4096MB Page Fusion: disabled VRAM size: 8MB CPU exec cap: 100% HPET: disabled CPUProfile: host ..... ..... # * if detach DVD, run like follows root@dlp:~# VBoxManage storageattach Ubuntu_2204 --storagectl Ubuntu_2204_SATA --port 0 --device 0 --medium none |
[2] | Start a Virtual Machine. |
root@dlp:~# VBoxManage startvm Ubuntu_2204 --type headless Waiting for VM "Ubuntu_2204" to power on... VM "Ubuntu_2204" has been successfully started. |
[3] | On enabling VRDP environment by installing VirtualBox extension pack,
it's possible to connect to VM 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. |
Sponsored Link |
|