Virtualbox benötigt ISO, um VM nach der Betriebssysteminstallation zu booten

Virtualbox benötigt ISO, um VM nach der Betriebssysteminstallation zu booten

Aus irgendeinem Grund stoppt der Bootvorgang, nachdem ich eine neue VM erstellt und das Betriebssystem darauf installiert habe, nach Abschluss der Installation. Ich muss das ISO, das ich für die Installation verwendet habe, erneut mounten, damit die VM normal funktioniert. Virtualbox ist die neueste Version und das ISO ist standardmäßig Windows 7 SP1 x64. Ich erstelle die VM über eine Befehlszeilen-Batchdatei:

REM Create Entry:
VBoxManage createvm -name "Windows 7 - For Testing Purposes Only" -ostype Windows7_64 --register

REM Create Drive:
VBoxManage createhd --filename "D:\Virtual Machines\7HD" --size 12288 --format VHD

REM Add Controllers:
VBoxManage storagectl "Windows 7 - For Testing Purposes Only"  --name "SATA Controller" --add sata --sataportcount 2 --hostiocache on --bootable on

REM Attach to Controllers:
VBoxManage storageattach "Windows 7 - For Testing Purposes Only" --storagectl "SATA Controller" --port 0 --type hdd --medium "D:\Virtual Machines\7HD.vhd"
VBoxManage storageattach "Windows 7 - For Testing Purposes Only" --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --medium emptydrive

REM Set VM Parameters:
VBoxManage modifyvm "Windows 7 - For Testing Purposes Only" --memory 4096 --vram 130 --cpus 4 --accelerate3d on --boot1 dvd --boot2 none --boot3 none --boot4 none --usb on --usbehci on --audio dsound --audiocontroller hda --nic1 bridged --bridgeadapter1 "Realtek RTL8139/810x Family Fast Ethernet NIC" --bioslogodisplaytime 1 --biosbootmenu menuonly --largepages on

REM Add Shared folders from host:
VBoxManage sharedfolder add "Windows 7 - For Testing Purposes Only" --name "C_DRIVE" --hostpath C:\ --automount
VBoxManage sharedfolder add "Windows 7 - For Testing Purposes Only" --name "D_DRIVE" --hostpath D:\ --automount
VBoxManage sharedfolder add "Windows 7 - For Testing Purposes Only" --name "K_DRIVE" --hostpath K:\ --automount
VBoxManage sharedfolder add "Windows 7 - For Testing Purposes Only" --name "Q_DRIVE" --hostpath Q:\ --automount

REM Create Shortcut for the new VM on desktop:
copy NUL %temp%\CreateWVVMShortcut.vbs
echo Set Shell = CreateObject("WScript.Shell")>>%temp%\CreateWVVMShortcut.vbs
echo DesktopPath = Shell.SpecialFolders("Desktop")>>%temp%\CreateWVVMShortcut.vbs
echo Set link = Shell.CreateShortcut(DesktopPath ^& "\Windows 7 TEST.lnk")>>%temp%\CreateWVVMShortcut.vbs
echo link.Arguments = "-startvm ""Windows 7 - For Testing Purposes Only""">>%temp%\CreateWVVMShortcut.vbs
echo link.IconLocation = "%ProgramW6432%\Oracle\VirtualBox\VirtualBox.exe,0">>%temp%\CreateWVVMShortcut.vbs
echo link.TargetPath = "%ProgramW6432%\Oracle\VirtualBox\VirtualBox.exe">>%temp%\CreateWVVMShortcut.vbs
echo link.WorkingDirectory = "%ProgramW6432%\Oracle\VirtualBox">>%temp%\CreateWVVMShortcut.vbs
echo link.Save>>%temp%\CreateWVVMShortcut.vbs
cscript //nologo %temp%\CreateWVVMShortcut.vbs

REM Run new VM:
VBoxManage startvm "Windows 7 - For Testing Purposes Only" --type gui

Mache ich etwas falsch, oder ist es das erwartete Verhalten, dass das ISO immer gemountet sein muss, um die VM auszuführen?

Antwort1

Ich konnte „Live-CD/DVD“ über die Kommandozeile mit [ --tempeject on] folgendermaßen aktivieren:

VBoxManage.exe storageattach %VM_NAME% --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --tempeject on --medium %VBOX_HOME%\VBoxGuestAdditions.iso

verwandte Informationen