How to unlock the bootloader of a Sony Xperia device
https://www.youtube.com/watch?v=iIdJg7KNH3A
Sony has uploaded a video to its developers channel that demonstrates how to unlock the bootloader of a Sony Xperia device, allowing for custom ROMs to be installed. Sony warns that you may void your device’s warranty and cautions about certain other risks that may occur.
The process involves generating an unlock code for your device through Sony by entering a unique IMEI number associated with the device. Then, you must install the Android SDK and all drivers and connect to Fastboot. Sony has a list of supported devices on its website.