You will be asked to enter your Apple ID.After installation completes, the virtual machine will automatically shut down.Choose that storage for the installation of OS X to install. You will find a new storage media, which is like a hard disk.You will be prompted to enter the name for the storage.Erase the Storage by clicking the 'Erase' button on the top.Note: You may have to select View/View All Devices You will see a window with different storages on the left.On the upper-left corner, you will see a 'Utilities' button.Then you will be asked where to install macOS.After a while, you will need to choose the language for installation.If you use the command 'exit' you can shift to the EFI menu, but changing the settings doesn't seem to affect the progress of the UEFI Interactive Shell, which stops at the Shell> prompt. This part needs clarification - UEFI Interactive Shell loads, but nothing happens.When it boots, you will see some data being displayed.In the SATA controller, click 'Add Optical Disk'.Choose your version (if you have Mojave or Catalina, choose Mac OS X (64 bit). Type the name for virtual machine and Mac OS X for type.This is your file for installation in VirtualBox. Enter hdiutil convert /Your/Path/To/YourCdrFile.cdr -format UDTO -o /Your/Path/To/macOSInstaller.iso.After conversion completes, you will see a.Also choose the name for installer disk and the final destination. In the window, choose the InstallESD.dmg to convert and the disk type to be 'DVD/CD-R master for export'.Inside the sub-folder Contents/SharedSupport you will find a InstallESD.dmg file.When download finishes, find the app, right-click and select 'Show Package Contents'.Download the macOS Installer file from the App Store (OS X El Capitan and Sierra is downloadable from Apple's website).
The manual installation requires access to the Mac App Store through an existing installation of macOS.