Ubuntu is one of the most widely used Linux distributions in both enterprise and cloud environments. Throughout this course we will encounter Ubuntu systems frequently, making it useful to have a dedicated Ubuntu VM available in our lab.
Although pre-built images exist, I personally prefer downloading the installer ISO and performing the installation myself. Note that I will be using Ubuntu 24.04 LTS (which is not the current latest version 26.04) as it is incredibly stable, reliable and proven:
-
Download the Ubuntu ISO.
-
Verify that the SHA256 hash of the downloaded ISO matches the one published on the Ubuntu website. The exact value changes between releases, so always verify against the official download page.
PS C:\Users\PC\Downloads> Get-FileHash -Algorithm SHA256 -Path .\ubuntu-24.04.4-desktop-amd64.iso
Algorithm Hash Path
--------- ---- ----
SHA256 3A4C9877B483AB46D7C3FBE165A0DB275E1AE3CFE56A5657E5A47C2F99A99D1E C:\Users\PC\Downloads\ubuntu-24.04.4-desktop-amd64.iso
PS C:\Users\PC\Downloads>
-
Head over to VMware (or whatever software you are using) and create a "New Virtual Machine". Select "Typical" (don't need "Custom").
-
Click "I will install the OS later" (can save you from headaches sooner or later, trust me).
-
When prompted for the "Guest OS", select "Ubuntu 64-bit".
-
Give it a name and location.
-
Minimum 60GB of storage and opt to store the disk as "a single file"
-
On the next screen, click "Customize settings". Note that one CPU with more cores, or two CPUs with one core are far better than using something like 4x4 (it will NOT make your VM run better, in fact it will run worse). I usually put on my VM 8GB RAM, 2 CPUs with 1 core and 80GB storage. In any case, the following are the minimal settings I would recommend:
Ubuntu VM
OS Type: Linux
Version: Ubuntu 64-bit
RAM: 4 GB+
CPU: 2 vCPU+
Disk: 60 GB Thin Provisioned
-
Leave the network adapter as NAT for now (we'll deal with that later)
-
Click "Accelerate 3D Graphics".
-
Once the VM is created, go to its settings and load the Ubuntu ISO in the DVD component
-
Boot the VM and select "Install Ubuntu"
-
Stick to defaults where possible. Select English, configure your timezone, create a user account and password, and continue with the installation. If unsure, the defaults are usually perfectly fine (I honestly just click next until I'm explicitly required to select something). For consistency throughout this course I typically use:
Username: ubuntu
Password: ubuntu
Hostname: ubuntu
- When prompted about installation type, select:
Erase disk and install Ubuntu
-
Continue through the installation wizard and allow Ubuntu to install.
-
Once installation completes, reboot the machine when prompted.
-
Remove the mounted ISO/DVD device if necessary and allow the VM to boot normally.
-
You may now login using the credentials you configured during installation:
ubuntu:ubuntu
-
You do not need "Ubuntu Pro" and you do not need to "share system data".
-
Install VMware Tools (or VirtualBox Guest Additions if using VirtualBox). This will improve display scaling, clipboard integration, mouse handling, and overall usability.
For VMware:
sudo apt update && sudo apt install -y open-vm-tools open-vm-tools-desktop
sudo systemctl enable --now vmtoolsd
For VirtualBox:
sudo apt update && sudo apt install -y virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms
sudo systemctl enable --now vboxservice
- Shut down the VM and create a snapshot called:
FRESH
This snapshot provides a clean baseline which can be restored later if something inevitably catches fire. Ensure this snapshot is AFTER the machine is turned off - that way you can clone the machine directly from this snapshot.
IMPORTANT NOTE: If your Ubuntu goes "dark" after 5 minutes of idling and the screen does not turn on - it is a known issue with no solid fix. You can try disabling "3D acceleration", using 2CPUs with 1 core each, and running the following commands:
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
gsettings set org.gnome.desktop.session idle-delay 0
gsettings set org.gnome.desktop.screensaver lock-enabled false
xset -dpms # dont worry if it fails
xset s off
xset s noblank
reboot