
어떤 이유로 새 VM을 만들고 OS를 설치한 후 설치가 완료된 후 부팅이 중지됩니다. VM이 정상적으로 작동하려면 설치에 사용한 ISO를 다시 마운트해야 합니다. Virtualbox는 최신 버전이고 iso는 기본 Windows 7 SP1 x64입니다. VM Trough 명령줄 배치 파일을 만듭니다.
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
내가 뭔가 잘못하고 있는 건가요? 아니면 VM을 실행하기 위해 ISO를 항상 마운트해야 하는 것이 예상되는 동작인가요?
답변1
--tempeject on
다음과 같은 방법으로 [ ]를 사용하여 명령줄을 통해 "Live CD/DVD"를 활성화할 수 있었습니다 .
VBoxManage.exe storageattach %VM_NAME% --storagectl "SATA Controller" --port 1 --device 0 --type dvddrive --tempeject on --medium %VBOX_HOME%\VBoxGuestAdditions.iso