zram is a generic in-memory compressed block device. To get frontswapfunctionality, such a device (/dev/zram0) can be exposed to a VM asa 'raw disk'. Such a disk can be used for _any_ purpose by the guest,including use as a swap disk.

Here /dev/zram0 of size 2GB was created and exposed to Windows VM as a'raw disk' (using VirtualBox). This disk was detected in the guest and NTFSfilesystem was created on it (Windows cannot swap directly to a partition;it always uses swap file(s)). Then Windows was configured to swap over afile in this drive.

Obviously, the same can be done with Linux guests. Thus, zram is usefulin both native and virtualized environments with different use cases.