We created a Ubuntu 20.04 VM by using the CLI instead of the GUI wizard. With that done the Ubuntu VM is ready to use. $ VBoxManage setextradata "Ubuntu 20.04" GUI/ScaleFactor 1 Then run the following command on the host: $ VBoxManage storageattach "Ubuntu 20.04" -storagectl "IDE Controller" -port 0 -device 0 -type dvddrive -medium emptydrive On the Desktop click on the arrow in the top right corner and select "Power Off". We can now shut down the VM to remove the installation media and disable the VirtualBox display scaling. In the Ubuntu terminal (right click on Desktop and select "Open in Terminal") enter: $ gsettings set scaling-factor 2 Finishing the installationĪfter the Guest Additions are installed we can let GNOME handle the display output scaling which has a better quality. This can be done by clicking on the menu bar and selecting "Devices", then "Insert Guest Additions CD Image". When Ubuntu is booted up we install the VirtualBox Guest Additions to get the display drivers. We can ignore this for now and press enter to reboot. Now we can start the VM which will load the Ubuntu GUI installer from the mounted ISO: $ VBoxManage startvm "Ubuntu 20.04"Īfter the installation is done the installer will prompt to remove the installation media. The following command will scale up the display output by a factor of 2: $ VBoxManage setextradata "Ubuntu 20.04" GUI/ScaleFactor 2 The Ubuntu installer runs with a resolution of 800圆00 and would look tiny on HiDPI screens if we wouldn't scale up the display output. $ VBoxManage storageattach "Ubuntu 20.04" -storagectl "IDE Controller" -port 0 -device 0 -type dvddrive -medium ~/Downloads/ubuntu-20.04.1-desktop-amd64.iso The VM will boot from this drive first when starting: $ VBoxManage storagectl "Ubuntu 20.04" -name "IDE Controller" -add ide We also create a dvd drive with the Ubuntu ISO mounted in it. $ VBoxManage storageattach "Ubuntu 20.04" -storagectl "SATA Controller" -port 0 -device 0 -type hdd -medium ~/VirtualBox\ VMs/Ubuntu\ 20.04/Ubuntu\ 20.04.vdi $ VBoxManage storagectl "Ubuntu 20.04" -name "SATA Controller" -add sata -bootable on A minimal Ubuntu installation takes about 5GB of space: $ VBoxManage createhd -filename ~/VirtualBox\ VMs/Ubuntu\ 20.04/Ubuntu\ 20.04.vdi -size 20480 -variant Standard We create an empty 20GB hard drive that we can install Ubuntu on. Next we need to configure the storage devices. The current values can be seen with VBoxManage showvminfo "Ubuntu 20.04". To see all available options run VBoxManage modifyvm which will output a list of all flags. In the above command I've also enabled USB and set the Graphics Controller to VMSVGA which is the default controller when using the GUI but set to the legacy VBoxVGA when using the CLI. $ VBoxManage modifyvm "Ubuntu 20.04" -cpus 2 -memory 4096 -vram 128 -graphicscontroller vmsvga -usbohci on -mouse usbtablet We'll increase it to use 2 CPU cores, 4GB RAM and 128MB VRAM: $ VBoxManage createvm -name "Ubuntu 20.04" -ostype Ubuntu_64 -register The default settings use 1 CPU core, 128MB RAM and 8MB VRAM which is not enough. We first create the VM and increase the hardware resources. The scaling commands can be ignored for non-HiDPI displays. I've tested this on an apple laptop with retina (HiDPI) display and included instructions to scale the display output. I'm assuming that VirtualBox 6.1 is installed, the VBoxManage CLI is ready to use and the Ubuntu 20.04 ISO has been downloaded. This tutorial describes the installation of Ubuntu 20.04 in VirtualBox by using the VBoxManage CLI. Using the VBoxManage CLI to create a Ubuntu 20.04 VM Home Using the VBoxManage CLI to create a Ubuntu 20.04 VM September 11, 2020
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |