Install VirtualBox Additions on CentOS 8

Login as root and install packages required for building kernel modules and elfutils-libelf-devel as a prerequisite for the additions.

# dnf install gcc kernel-devel kernel-headers dkms make bzip2 perl elfutils-libelf-devel

From the VirtualBox window, insert the guest-tools CD image.
Devices -> “Insert Guest Additions CD Image”

Mount the virtual CD-ROM drive and install the VirtualBox Additions.

# mkdir /mnt/cdrom
# mount /dev/cdrom /mnt/cdrom
# cd /mnt/cdrom/
# sh ./VBoxLinuxAdditions.run --nox11
# reboot

Extend XenServer Linux Guest LVM Drive

  1. Create a snapshot of the VM to revert back if needed
  2. Shut down the VM
  3. In XenCenter, select the VM and click the Storage tab
  4. Select the disk and click Properties
  5. Enter the new size under Size and Location
  6. Power on the VM
  7. Verify the additional storage is available
    # fdisk -l
  8. Edit the expanded drive with fdisk
    # fdisk /dev/xvda
  9. View the existing partitions by typing ‘p’
  10. Create a new partition by typing ‘n’
  11. If there are less than 4 partitions, select primary.  Otherwise, select extended.
  12. Press Enter twice to use all of the free space
  13. Type ‘p’ to view the new table
  14. Type ‘t’ to change the partition type of the new partition to type ‘8e’
  15. Once the partition table looks correct, type ‘w’ to save and quit
  16. Reboot the VM
  17. Create a new LVM physical volume on the new partition
    # pvcreate /dev/xvda4
  18. Extend the volume group to include the new PV
    # vgextend vg_system /dev/xvda4
  19. Extend the logical volume to include the remaining free space in the VG
    # lvextend -l+100%FREE /dev/mapper/vg_system-lv_root
  20. Resize the filesystem to fill the free space in the LV
    # resize2fs /dev/mapper/vg_system-lv_root
  21. Verify the additional space is available
    # df -h