To convert an .img file to .vdi in Linux, so that you can directly use it in VirtualBox, open a terminal and paste this: