Download the latest Ubuntu Desktop LTS.iso file here.
Create Virtual Machine
Run VirtualBox.
Click on the New button to create a new virtual machine (VM)
Click on Expert Mode
Set the VM Name, the machine folder to store the VM, type (Linux) and version (Ubuntu 64bit).
Set the Memory size (RAM) at 4096 MB (4GB) or use the default settings 1024 MB
Select Create a virtual hard disk now
Proceed with the Create button
Set the File size (disk size) at 20 GB
Set the Hard disk file type as VDI - Dynamically allocated
Proceed with the Create button to initialize the machine.
Select the new VM in the manager windows and click on the Settings button.
Navigate to the Sistem tab and:
remove Floppy from boot order
set Chipset to PIIX3 (default)
Enable PAE/NX in the Processor menu
check Acceleration menu to have Default Paravirtualization and Enable Nested Paging checked
Navigate to the Display tab and increase the Video Memory to 128 MB
Graphics Controller must be VMSVGA to be able to use VirtualBox Guest Additions
Install Linux Image
Select the new VM and click on the Start button to start it
Click on the file icon to open the Optical disk selector
Use the Add button to select the .iso file previously downloaded, select it from the list and Choose it
Click on the Start button to start he machine with the mounted ubuntu-22.04-desktop-amd64.iso (in this case)
Wait for the Ubuntu boot and installation menu
Select your language and click Install Ubuntu
Select your Keyboard layout and continue
Choose Normal installation and check both Other options boxes (you must be connected to the Internet)
Choose Erase disk and install Ubuntu and continue the installation without enabling encryption
I suggest using LVM for better dynamic disk management
Select your Location and time zone from the map screen
Create your login details as hostname, username and password
Proceed with the Continue button that will start Ubuntu installation
Restart your VM once the installation has completed.
Install VirtualBox Guest Additions
Guest Additions software unlocks some advanced features of VirtualBox to better integrate the VM and the host machine, as well as improved video support using VMSVGA graphics controller.
Complete the VM first boot and login to Ubuntu desktop
On the VirtualBox menu select Devices - Insert Guest Additions CD image...
Run the VBox_GAs disk inside the virtual machine desktop
Run the installation when prompted
If the prompt do not auto-start, open the disk, right-click on the autorun.sh file and Run as a Program
Enter your password to install it
Restart the VM
Right-click on the disk and Eject it
Activate the shared clipboard from the Devices - Shared Clipboard - Bidirectional menu
Update Linux
Keep the Ubuntu O.S. updated using one of the next methods.
Update it via the Software Updater app
Open a Terminal window (Ctrl+Alt+T) and update the system with the next command.
đ Refer to the official documentation of the distribution for instructions on installing alternative Linux distributions.
Configurations
# TIMEZONEsudotimedatectlset-timezoneEurope/Rome# Set OS DARK MODEgsettingssetorg.gnome.desktop.interfacecolor-scheme'prefer-dark'# DISABLE AUTOMATIC UPDATESsudosed-i's/1";/0";/'/etc/apt/apt.conf.d/20auto-upgradessudosystemctldisableapt-daily{,-upgrade}.timersudosystemctlmaskapt-daily{,-upgrade}.service# If not using Ubuntu PRO:# Disable Ubuntu Pro ESM Hook and MOTD Spam - thanks to UnspamifyUbuntusudomv/etc/apt/apt.conf.d/20apt-esm-hook.conf/etc/apt/apt.conf.d/20apt-esm-hook.conf.disabledsudosed-Ezi.orig \-e's/(def _output_esm_service_status.outstream, have_esm_service, service_type.:\n)/\1 return\n/' \-e's/(def _output_esm_package_alert.*?\n.*?\n.:\n)/\1 return\n/' \/usr/lib/update-notifier/apt_check.pysudo/usr/lib/update-notifier/update-motd-updates-available--force# Change "root" user passwordsudopasswdroot
cdmkdir-p~/.sshcd~/.sshssh-keygen-ted25519# Type a secure passphrase when askedchmod700~/.sshchmod600~/.ssh/*# Add the SSH private key to the ssh-agenteval"$(ssh-agent-s)"&&ssh-add~/.ssh/id_ed25519
Add the Public Key to a system/sudo user on a potential Ubuntu Server VM
# Local HOST (Ubuntu Desktop VM)cat~/.ssh/id_ed25519.pub# copy the string# Should start with ssh-ed25519 AAAA... or ssh-rsa AAAA... (if rsa)# Ubuntu Server VMecho"pubkey_string">>~/.ssh/authorized_keys# Set permissionschmod-Rgo=~/.ssh