Unable to flash SD card in guest OS

Discussions related to using VirtualBox on Windows hosts.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Unable to flash SD card in guest OS

Post by scottgus1 »

This could mean that on this host PC the SD card reader cannot be passed into the VM.
hvansia_thor wrote:On my other laptop it shows up as USB device and there I have no problem writing on SD card. I have problem with this laptop where the SD card is not mounted on the USB hub.
Did you try this?
scottgus1 wrote:You'd have to give the VM direct control of the SD card reader. See https://www.virtualbox.org/manual/ch08. ... cardreader. The host might require the Extension Pack to be installed.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Unable to flash SD card in guest OS

Post by mpack »

I have never come across a PC that attaches a slow storage option directly to the PCIe bus. The whole idea seems ridiculous to me - huge overkill, possible PCIe performance hit, and I assume it means needing a whole raft of specialist drivers, instead of just using the USB mass storage API like everyone else. And it's not like it means they don't need to provide USB hardware as well.

However, if it really is a PCIe drive then it can't be accessed by a VM: this is the same rules as per every other PCIe device on the host. Your only recourse would be the VMDK trick after offlining the drive.
hvansia_thor
Posts: 12
Joined: 24. Sep 2021, 05:56

Re: Unable to flash SD card in guest OS

Post by hvansia_thor »

Hey scottgus1, yes, I have tried that too. But I do not see any change in the way Guest OS starts up. Nor any change in the writing behaviour.
hvansia_thor
Posts: 12
Joined: 24. Sep 2021, 05:56

Re: Unable to flash SD card in guest OS

Post by hvansia_thor »

@mpack: That is the trick I am using. I am creating the .vmdk file and I can access the SD card but I cannot write to it. The only thing is that I cannot take the SD card offline. Each time I try doing it I get the message along the lines that the removable storage media cannot be taken offline. Also one correction, it is on the PCI bus not PCIe.

@scottgus1: Yes, I think so. That is the reason why I created the .vmdk file via createrawdisk and I can access the SD card but cannot write on it. Also, the extension pack is installed.
Last edited by hvansia_thor on 27. Sep 2021, 17:12, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Unable to flash SD card in guest OS

Post by scottgus1 »

hvansia_thor wrote:But I do not see any change in the way Guest OS starts up. Nor any change in the writing behaviour.
So the VM does not show any new hardware? If not, maybe it won't work because of the PCI connection. Passing SD cards into a VM is not something I've tried.
hvansia_thor wrote:removable storage media cannot be taken offline
I have also found that Windows will not allow removable drives to be taken offline. It might be better to try troubleshooting that idea through some web-searches.
hvansia_thor
Posts: 12
Joined: 24. Sep 2021, 05:56

Re: Unable to flash SD card in guest OS

Post by hvansia_thor »

Correct, the VM does not show new hardware. I am just curious about the fact that I am able to create rawdisk for SD card and I can access it but I cannot write to it. Why is that?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Unable to flash SD card in guest OS

Post by scottgus1 »

hvansia_thor wrote:Why is that?
scottgus1 wrote:I have also found that Windows will not allow removable drives to be taken offline. It might be better to try troubleshooting that idea through some web-searches.
arQon
Posts: 228
Joined: 1. Jan 2017, 09:16
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Ubuntu 16.04 x64, W7

Re: Unable to flash SD card in guest OS

Post by arQon »

I can't help with this specific case, but... since I DON'T have an SD card reader on this machine, but need to be able to use it to create and backup images for a Pi, I just use a $5 SD/mSD USB adapter. Since it's a generic USB device, VBox captures it just fine. Considering a time/cost assessment of your problem, you might want to just do the same.
Post Reply