Ubuntu Server 20.04 & 22.04 VM on VMware ESXi 7.0.3 and 8.0

Some useful tips for optimization.

This is by no means a full “how to” install Ubuntu on ESXi. I am just sharing the steps I use to install a new Ubuntu VM on my ESXi. It will require a bit of knowledge on both ESXi and Ubuntu

When you create a new Virtual Machine on step 5, set the compatibility to Esxi 7.0 U2 or later and of course on step 6, Guest OS should be set to the distribution you are using.
Depending on the application, you ae going to run set the number of CPUs, RAM and disk size. All these can be changed later so don’t worry too much.
Set the Network Adapter(s) Type to VMXNET3 for better performance. The drivers are already included in your linux distribution. The CD/DVD should be pointing to the .iso image file.
Click on VM Options, open up Advanced and the Edit Configuration.
Add a configuration parameter disk.EnableUUID and set the value to TRUE. With this setting you will prevent your syslog to be filled with sda errors.
Attention! If you are going to clone this VM or use it as a template, DO NOT USE this parameter while preparing the template. You can add the parameter on the final VM.

Note for 8.0 The Configuration Parameters got renames as Advanced Parameters and have been upgraded to their one tab

Make sure the CD/DVD pointing to the .iso image file is Connected and fire up the VM. Launch the Web console and go through the installation steps according to your needs.

After the reboot the first thing I do is

apt update && apt dist-upgrade

and reboot.

Now if you run df -h the LVM is only using half the disk:

/dev/mapper/ubuntu–vg-ubuntu–lv 39G 6.1G 31G 17% /

let’s increase the capacity to full with

sudo lvextend --extents +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv


sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

and now if you run df -h

/dev/mapper/ubuntu–vg-ubuntu–lv 78G 6.1G 68G 9% /

 

That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *