How to install Debian 11.1 on ZFS with UEFI on VMWare Guest

First of all you need to create a virtual machine with specified parameters. There are some minimal requirements for them, but it is recommended to use the following parameters:

  • Memory - 8 GB

  • CPUs - 4

  • 2 hard drives - 16 GB each

UEFI should be supported. You have to turn this option in WM settings like this:

You also need to connect the Debian 11 ISO image. We will show how to do everything in SPB labs. Here you have to connect this ISO file (debian-11.1.0.-amd64-netinst.iso):

After this you are ready to install Debian. Turn on power on your newly created Virtual Box and launch Web Console. Installation will be in progress and you will just follow the instructions on the screen.

If during the installation you need to setup network manually then in SPB Labs you can do the following steps:

  • after selection the “manual” mode you have to put your IP address for connecting the virtual machine like this:

  • then you need to enter the network mask

  • a gateway address for SPB Labs is:

  • and the name server address is:

Now your local network is ready to use. One another step is important among others. It is hard drives configuration. When the installation procedure asks you - enter the Manual mode:

You will see something like this:

Select the second (sdb) drive and create the new partition there. It will be used for EFI an it’s recommended to allocate 128 Mb for this partition from the beginning of the drive:

You can give it any reasonable name (for example, esp, which means “EFI system partition“) and select EFI System Partition type. And don’t forget to set Bootable flag on.

Then it’s all for the first partition. All other space you have to allocate for the partition that will be used for logical drive. So create the second partition on free space of sdb, allocate all remaining space for it, give it any reasonable name (for example, lvm) and select its type like physical volume for LVM:

Now partitions on the second drive are created and you need to create the logical volume structure. To do this select please the Configure the Logical Volume Manager options:

The installation procedure will offer you to save the partition information before continue:

After saving you’ll see the following menu. Select the Create volume group item please:

Name it, for example, vg0 (volume group 0) and select sdb2 (that is intended for LVM) for this group:

After this you are ready to create the logical volume on your new group. To do this select please the Create logical volume item in the appeared menu:

This volume will be used for the base Debian 11 system that will be later transferred to ZFS. Name it, for example, debian:

You should leave approximately 8 Gb of free space - so, you have to allocate to your logical volume (all free space - 8 Gb):

And write this information by clicking the Finish item:

Then select your new logical volume:

and assign Ext4 journaling file system type and root mount point / for this volume:

Then your HD configuration is ready and you should save all these changes:

Swap space will be defined later. So you have to finish the partition configuration:

Then installation will be continued. Don’t forget please to select the SSH server option in the installed components list if you plan to use remote connection to your Virtual Box in the future:

And after installation is finished just disconnect you ISO image from the Virtual Box and reboot.

After system is restarted you can continue with Web Console or with remote terminal.

Enter superuser mode and install missing packages:

su - echo "deb bullseye-backports main contrib" >> /etc/apt/sources.list.d/backports.list apt update apt install linux-headers-$(uname -r) linux-image-amd64 dkms parted rsync dosfstools apt install zfs-dkms zfs-initramfs zfs-zed zfsutils-linux

Now you can prepare the first hard drive sda for the system installation. To do this run the parted utility and do the following:

parted /dev/sda (parted) unit mib (parted) mklabel gpt (parted) mkpart Partition name? []? esp File system type? [ext2]? fat32 Start? 1 End? 129 (parted) set 1 esp on (parted) mkpart Partition name? []? boot File system type? [ext2]? Start? 129 End? 2177 (parted) mkpart Partition name? []? zp0 File system type? [ext2]? Start? 2177 End? -1 (parted) q

And then, when partitions are ready, format them please:

mkfs.vfat /dev/sda1 mkfs.ext4 /dev/sda2

After format you have to prepare directory structure, ZFS file structure and transfer Debian system to ZFS environment. It’s important to do everything step-by-step in the following order:

After this the system is transferred and you can remove snapshot that has been used for system transferring and mount required folders:

Then you need to update /etc/fstab file to make boot process correct. Open please this file with any editor. It will look like this:

Run the blkid command to get correct UUIDs for your drives:

Comment “/dev/mapper/vg0-debian …“ line:

Then change UUID for sda1 (UUID=”XXXX-XXXX” in the blkid output):

Then add a line for sda2 with correct UUID:

And finally add a line for swap, save file and exit editor:

And finally update GRUB:

Reboot. Congratulations, you Debian 11 is installed on ZFS with UEFI

After reboot you don’t need auxiliary drives and partitions any more and you can remove them if you’d like:

And as a last step run this command to let BeAdm utility working properly (if it exists in your system):

The final structure should look like this: