Page 1 of 1

cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 00:53
by idkwhatimdoing
Using win10 I am trying to load debian-10.4.0-amd64-netinst from a microSD in a USB adapter with the intention of setting up some features and then using it in a raspberry pi because I need a 64 bit OS yet somehow cannot get it to load correctly by itself. that is how I find myself here:

I have gone through the steps of creating the .vmdk file

Code: Select all

("C:\Program Files\Oracle\VirtualBox\VBoxManage" internalcommands createrawvmdk -filename "c:/Hard Disks/sdcard.vmdk" -rawdisk "\\.\PHYSICALDRIVE2")


and assigning it as the SATA controller,
usb debian storage.png
usb debian storage.png (40.93 KiB) Viewed 3590 times
I am able to get it to boot to a setup screen but when it gets to the point where it asks for drivers from a cdrom or removable medium there is nothing to be found
cannot readremovable media.png
cannot readremovable media.png (21.83 KiB) Viewed 3590 times
Does anyone know what I should do at this point? I have tried using Plop to boot from the usb but it ends up crashing or not finding the usb.

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 04:33
by scottgus1
Start the guest from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the guest from within the guest OS if possible. If not possible, close the Virtualbox window for the guest with the Power Off option set.

Right-click the guest in the main Virtualbox window's guest list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 05:59
by idkwhatimdoing
scottgus1 wrote:Start the guest from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the guest from within the guest OS if possible. If not possible, close the Virtualbox window for the guest with the Power Off option set.

Right-click the guest in the main Virtualbox window's guest list, choose Show Log. Save the far left tab's log, zip it, and post the zip file, using the forum's Upload Attachment tab.
usb debian-2020-07-07-23-54-25.7z
(23.2 KiB) Downloaded 15 times
The guest OS doesn't crash, it just somehow does not have the right access.

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 14:20
by scottgus1
You have full VT-x capability in the guest, so the problem apparently isn't what I thought it was (active host Hyper-V).

Please try this: disconnect the SD card vmdk from the guest, add a new regular same-size .vdi in its place, and run the test and vbox.log again.

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 16:59
by idkwhatimdoing
scottgus1 wrote:You have full VT-x capability in the guest, so the problem apparently isn't what I thought it was (active host Hyper-V).

Please try this: disconnect the SD card vmdk from the guest, add a new regular same-size .vdi in its place, and run the test and vbox.log again.
I'm fairly new to this so I don't know exactly what you mean by disconnecting the USB and adding a new VDI. The USB was what held the operating system image it would not have any operating system in it without the USB, if you meant to create a new VDI and attach the operating system image I plan on using to that then I have tried that and it allows me to get past the prompt asking to mount the cdrom.

here is the storage settings:
usb debian storage setup suggestion.png
usb debian storage setup suggestion.png (52.78 KiB) Viewed 3552 times
here is a screenshot of it having gotten past the cdrom prompt:
New Empty VDI using Debian Image.png
New Empty VDI using Debian Image.png (24.87 KiB) Viewed 3552 times
Here is the log from having gotten past the cdrom prompt

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 17:25
by idkwhatimdoing
scottgus1 wrote:You have full VT-x capability in the guest, so the problem apparently isn't what I thought it was (active host Hyper-V).

Please try this: disconnect the SD card vmdk from the guest, add a new regular same-size .vdi in its place, and run the test and vbox.log again.
#############################################################################
I tried a new approach where I went back to the initial settings of having the USB VDMK as the SATA controller and added the debian image to the cd:
sd card vdmk & debian cd vbox settings.png
sd card vdmk & debian cd vbox settings.png (43.81 KiB) Viewed 3548 times
when launching the vm it is able to get past the cdrom error screen, I was able to create a user account but after that I got a new error message from virtualbox on creating the partition:
usb vdmk & debian cd.png
usb vdmk & debian cd.png (49.82 KiB) Viewed 3548 times
here is the copied text from that error message:
An error has occurred during virtual machine execution! The error details are shown below. You may try to correct the error and resume the virtual machine execution.

The I/O cache encountered an error while updating data in medium "ahci-0-0" (rc=VERR_ACCESS_DENIED). Make sure there is enough free space on the disk and that the disk is working properly. Operation can be resumed afterwards.

Error ID: BLKCACHE_IOERR
Severity: Non-Fatal Error
here is the log file after closing the crashed virtual machine:

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 17:52
by scottgus1
In your last message reporting that the vmdk process worked, it then had the Access Denied message. This happens because Virtualbox must be Run As Administrator on Windows hosts to do Raw Disk Access. Additionally, the disk that is being Raw-accessed must be offline in the Windows Disk Management. Web-search how to do these things, they are Windows procedures.

Regarding the question on how to replace the "USB" vmdk with a vdi for a test in the previous post, you figured it out. The fact that the guest continued to operate shows the ISO is apparently good, and the issue you were having is related to the vmdk, not the ISO or Virtualbox.

Use the vmdk as shown in the last post, offline the USB disk in Disk Management, and Run Virtualbox as Administrator. This should remove normal obstacles to Raw Disk Access that happen on Windows hosts. I don't know if you will have further obstacles, though. If so please post back.

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 19:02
by idkwhatimdoing
scottgus1 wrote:In your last message reporting that the vmdk process worked, it then had the Access Denied message. This happens because Virtualbox must be Run As Administrator on Windows hosts to do Raw Disk Access. Additionally, the disk that is being Raw-accessed must be offline in the Windows Disk Management. Web-search how to do these things, they are Windows procedures.

Regarding the question on how to replace the "USB" vmdk with a vdi for a test in the previous post, you figured it out. The fact that the guest continued to operate shows the ISO is apparently good, and the issue you were having is related to the vmdk, not the ISO or Virtualbox.

Use the vmdk as shown in the last post, offline the USB disk in Disk Management, and Run Virtualbox as Administrator. This should remove normal obstacles to Raw Disk Access that happen on Windows hosts. I don't know if you will have further obstacles, though. If so please post back.
Thank you for all your help so far but I am still having issues,

I have been using virtualbox as administrator this whole time, if I don't the vm gives this error message immediately:
Failed to open a session for the virtual machine usb debian.
Could not open the medium 'C:\Hard Disks\sdcard.vmdk'.
VD: error VERR_ACCESS_DENIED opening image file 'C:\Hard Disks\sdcard.vmdk' (VERR_ACCESS_DENIED).
Result Code: E_FAIL (0x80004005)
Component: MediumWrap
Interface: IMedium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}
Could you elaborate on what you mean by offline the disk? to do that is it just going to Windows disk management and eject the USB that I have been working on like so:
win10 disk management - eject.png
win10 disk management - eject.png (26.75 KiB) Viewed 3545 times
after ejecting and trying to launch the virtual machine it gives this error message:
Failed to open a session for the virtual machine usb debian.
VD: error VERR_INVALID_FUNCTION opening image file 'C:\Hard Disks\sdcard.vmdk' (VERR_INVALID_FUNCTION).
Failed to open image 'C:\Hard Disks\sdcard.vmdk' in read-write mode (VERR_INVALID_FUNCTION).
AHCI: Failed to attach drive to Port0 (VERR_INVALID_FUNCTION).
Result Code: E_FAIL (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
If that is not the way to offline the drive then I am unsure how to do it, I found a separate forum post on the Windows Server forum, my account is too new to post URLs but here is the answer:
it appears that making a disk online/offline is not supported on removable media(USB drive), it’s by design, we can’t switch external drive’s online/offline state via disk management UI.
I'm beginning to think i should start a new thread because I solved the original issue of getting stuck on the CDrom prompt and now need to find a way to correctly partition the drive on initial boot

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 19:51
by scottgus1
Good that you were running as admin for raw disk access. It is necessary. There must be another reason you can't do what you want.

I was talking about right-clicking the square that says 'Disk 2...Online' and choose Offline. But apparently that cannot be done.

If this SD card reader is an unplugable USB device, you could try using a USB filter to pass the USB device into the guest OS directly, see USB basics and troubleshooting, instead of the raw disk VMDK.

Also, instead of the raw disk VMDK, try this command:
'vboxmanage modifyvm "vm name" --usbcardreader on
Finally, if none of these works, maybe Virtualbox is not the right tool for this task. Try web-searching or look on Raspberry Pi's forums. I'm sure someone has figured out how to load an OS onto a SD card for RPi's.

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 20:11
by idkwhatimdoing
scottgus1 wrote:Good that you were running as admin for raw disk access. It is necessary. There must be another reason you can't do what you want.

I was talking about right-clicking the square that says 'Disk 2...Online' and choose Offline. But apparently that cannot be done.

If this SD card reader is an unplugable USB device, you could try using a USB filter to pass the USB device into the guest OS directly, see USB basics and troubleshooting, instead of the raw disk VMDK.

Also, instead of the raw disk VMDK, try this command:
'vboxmanage modifyvm "vm name" --usbcardreader on
Finally, if none of these works, maybe Virtualbox is not the right tool for this task. Try web-searching or look on Raspberry Pi's forums. I'm sure someone has figured out how to load an OS onto a SD card for RPi's.
Again I have to thank you for all your help in pointing me in the right direction, it does seem that using virualbot to set up this image is too troublesome and that I should look to using something else to get a 64 bit os on a raspberry pi. The main reason I was looking into this was that I was trying to run a node.js webserver with mongoDB off of the raspberry pi to host a personal website, I have the initial site up and running but apparently MongoDB stopped supporting 32bit operating systems like the raspberry pi os is was using at the time. Initially i found a workaround to get an older version version of mongoDB but that became overly complicated for me and by following the instructions I was getting errors. I decided to try and move everything to a 64 bit OS to just use the newest release of MongoDB. After imaging the debian iso I was planning on using onto the SD card for the PI and powering on nothing seemed to happen, the pi had a solid green and red light meaning that it wasnt going to do anything and produced no video output. I guessed that It was a problem the image so that started with me coming here to attempt some kind of configuration to get it to work. Writing out all of my steps taken makes me realize some missteps but thats all in hindsight and the fact that I don't exactly know what I'm doing.
thanks for all the help scottgus1

Re: cannot read removable media/cd on boot from USB

Posted: 8. Jul 2020, 20:15
by scottgus1
Glad to be of assistance. If you wish to try Virtualbox for anything else and run into trouble, please don't hesitate to ask us.

I don't know if it will help, but take a look here: https://www.raspberrypi.org/documentati ... ng-images/ The link therein to how to use Windows to load the SD card mentions Balena Etcher, which I have and have used to put ISO's on USB sticks successfully.