It is necessary to obey the created name of the virtual machine to work.
Copy and paste in a text editor and save with the name you want, eg vim script.sh
Give execute permission and execute
Only after creating the virtual machine and adding the .vdi
If it doesn’t work try to run one command at a time.
If you have any questions, see the video below. Remembering that the video is in Portuguese, but you can understand the steps just by viewing. Or even enabling subtitles.
The video has English subtitles native to the video itself and with the correct translation. To enable, use the settings in the footer of the video itself, according to the images shown here below.