Can a Macbook Pro SD card be accessed by a VirtualBox Linux VM?

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
dionw
Posts: 3
Joined: 22. Feb 2018, 16:38

Can a Macbook Pro SD card be accessed by a VirtualBox Linux VM?

Post by dionw »

I have a Linux image running on an early 2013 MacBook Pro. The MBP is fitted with a SD card socket.

The VM is working AOK but I want to access a SD card from the VM. Is it possible to connect a VirtualBox VM to the SD card socket?

If so how do I go about achieving this?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can a Macbook Pro SD card be accessed by a VirtualBox Linux VM?

Post by mpack »

An SD card is no different than any other USB memory stick (internally such devices are attached to the USB bus).

So yes, you can access it as a USB device. Or, if you don't need sector level access then you can access it even more simply using a shared folder. Don't try to do both at the same time.
dionw
Posts: 3
Joined: 22. Feb 2018, 16:38

Re: Can a Macbook Pro SD card be accessed by a VirtualBox Linux VM?

Post by dionw »

Thanks @mpack

I thought as much but appreciate the confirmation. Anticipating this I've been studying the advice in forum topic viewtopic.php?f=35&t=82639 regarding "Capturing a USB device in VirtualBox".

Following this guidance I've clicked the USB icon at the bottom of the screen, found reference to the "Apple Internal Memory Card Reader", selected this with a pop up confirmation that the device has been "Captured". I tried to attach a screen image of the desktop showing this pop up but I'm apparently too much of a newbie to have that permission to do that as yet.

My problem is the device does not appear to be showing up as accessible to the OS. I ran the

Code: Select all

sudo fdisk -l
command in a terminal window and in addition to VM file disk there is a device showing as:
Disk /dev/loop0: 252.8MiB ...
This does not appear to be the SD card.
Last edited by socratis on 23. Feb 2018, 05:38, edited 1 time in total.
Reason: Added missing URL.
dionw
Posts: 3
Joined: 22. Feb 2018, 16:38

Re: Can a Macbook Pro SD card be accessed by a VirtualBox Linux VM?

Post by dionw »

As an alternative I tried running the Debian image native off an external USB stick with the same sized disk space as the VM and had no difficulty accessing the SD Card device.

Whatever is problem while running as a VM appears to be isolated to the VM environment.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Can a Macbook Pro SD card be accessed by a VirtualBox Linux VM?

Post by socratis »

Take a look at ch. 8.8.8. USB card reader settings. It's too small, so I'll quote the whole ch. here:
The following setting defines access to a USB Card Reader by the guest environment. USB card readers are typically used for accessing data on memory cards such as CompactFlash (CF), Secure Digital (SD) or MultiMediaCard (MMC).
  • --usbcardreader on|off: Enables/disables the USB card reader interface.
Sometime the distinct "hardware presence" is required to trigger services/daemons in the guest.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Nap
Posts: 30
Joined: 22. Jul 2014, 02:06

Re: Can a Macbook Pro SD card be accessed by a VirtualBox Linux VM?

Post by Nap »

Ok, and where does this setting go? How is it used?

I have a Ubuntu 18.04.3 LTS guest running on my MacBook Pro using VB 6.1. I have setup a filter in the VM's Settings assigning the Card Reader (Apple Internal Memory Card Reader [0820], Vendor ID 05ac, Product ID 8406, Revision 820, ...) but Ubuntu never sees the card reader.
I have also tried assigning it using the USB tool in the status bar at the bottom of the guest's window, but then I get a message:

"Failed to attach the USB device Apple Internal Memory Card Reader [0820] to the virtual machine <VMname>".

Whenever I plug in a SD card, the Mac mounts the partitions.

I operate VB exclusively through the GUI. Is this something that should be done via CLI?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Can a Macbook Pro SD card be accessed by a VirtualBox Linux VM?

Post by scottgus1 »

Nap wrote:where does this setting go? How is it used?
If "this setting" refers to '--usbcardreader on|off', a quick way to find it is to open the PDF copy of the Virtualbox manual found in the Virtualbox installation folder and search for 'usbcardreader'.

My searching reveals to me that '--usbcardreader' is part of the command-line 'vboxmanage modifyvm' command.
Post Reply