VirtualBox : Create Virtual Machines2020/08/05 |
Create a Virtual Machine.
On this example, create a VM to install Ubuntu 20.04. |
|
[1] | Create a Virtual Machine. |
# create a VM root@dlp:~# VBoxManage createvm \ --name Ubuntu_2004 \ --ostype Ubuntu_64 \ --register \ --basefolder /var/vbox Virtual machine 'Ubuntu_2004' is created and registered. UUID: db472f90-be34-4b2b-b4bf-a09b8d9a18d5 Settings file: '/var/vbox/Ubuntu_2004/Ubuntu_2004.vbox' # modify settings for VM # replace interface name [ens33] to your own environment root@dlp:~# VBoxManage modifyvm Ubuntu_2004 \
--cpus 4 \ --memory 4096 \ --nic1 bridged \ --bridgeadapter1 ens33 \ --boot1 dvd \ --vrde on \ --vrdeport 5001 # configure storage for VM root@dlp:~# VBoxManage storagectl Ubuntu_2004 --name "Ubuntu_2004_SATA" --add sata root@dlp:~# VBoxManage createhd \ --filename /var/vbox/Ubuntu_2004/Ubuntu_2004.vdi \ --size 20480 \ --format VDI \ --variant Standard 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 1ffcb55f-22d3-46af-8f39-22b8c04b50b2 root@dlp:~# VBoxManage storageattach Ubuntu_2004 \
--storagectl Ubuntu_2004_SATA \ --port 1 \ --type hdd \ --medium /var/vbox/Ubuntu_2004/Ubuntu_2004.vdi # configure DVD drive for VM # example below, it specifies an ISO file for installation root@dlp:~# VBoxManage storageattach Ubuntu_2004 \
--storagectl Ubuntu_2004_SATA \ --port 0 \ --type dvddrive \ --medium /home/ubuntu-20.04-live-server-amd64.iso # confirm settings for VM root@dlp:~# VBoxManage showvminfo Ubuntu_2004 Name: Ubuntu_2004 Groups: / Guest OS: Ubuntu (64-bit) UUID: db472f90-be34-4b2b-b4bf-a09b8d9a18d5 Config file: /var/vbox/Ubuntu_2004/Ubuntu_2004.vbox Snapshot folder: /var/vbox/Ubuntu_2004/Snapshots Log folder: /var/vbox/Ubuntu_2004/Logs Hardware UUID: db472f90-be34-4b2b-b4bf-a09b8d9a18d5 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 ..... ..... # * if dettach DVD, run like follows root@dlp:~# VBoxManage storageattach Ubuntu_2004 --storagectl Ubuntu_2004_SATA --port 0 --device 0 --medium none |
[2] | Start a Virtual Machine. |
root@dlp:~# VBoxManage startvm Ubuntu_2004 --type headless Waiting for VM "Ubuntu_2004" to power on... VM "Ubuntu_2004" 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 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 |
|