Mounting .img from internal storage as USB Mass Storage
Here are the Terminal commands:

su
echo /sdcard/your_image.img &gt; /sys/class/android_usb/f_mass_storage/lun/file
echo 1 &gt; /sys/class/android_usb/f_mass_storage/lun/cdrom
setprop sys.usb.config mass_storage


(The location of LUN may vary for some devices, you can manually check/search for it even using File Explorer..)

If above commands fail, you might want to disable SE Linux by setenforce 0 command to set it to Permissive, and try again..