How can I mount a sdcard and view it in /dev of a virtualbox guest

7

I'm trying to insert a SD card into my laptop (it's got a side slot for one) and have it show up on the guest machine running in a virtual box.

Host: Windows 7 64 for x86 Guest: Ubuntu 64bit

I want to configure things such that when I insert the SDcard into my laptop and my virtual box session is running I want to be able to see the device show up in /dev/sdX on my virtual machine.

Anyone know a way to do that? None of the settings seem to deal with SD cards.


EDIT:
It was suggested I create a rawdisk with the VBoxManager.exe with elevated privlages, I attempted it, but it fails for other reasons:

C:>"Program Files\Oracle\VirtualBox\VBoxManage" internalcommands createrawvmdk -filename MySSDDisk.vmdk -rawdisk \.\PHYSICALDRIVE3
VBoxManage.exe: error: Failed to create the VirtualBox object!
VBoxManage.exe: error: Code CO_E_SERVER_EXEC_FAILURE (0x80080005) - Server execu tion failed (extended info not available)
VBoxManage.exe: error: Most likely, the VirtualBox COM server is not running or failed to start.

windows-7
ubuntu
virtualbox
sd-card
asked on Super User Feb 22, 2013 by Mike • edited Aug 8, 2013 by Mike

1 Answer

2

From the Windows host determine the physical drive

wmic diskdrive list > drives.txt
notepad drives.txt

Once you know your drive, you can attach it as a raw disk. Example below uses PhysicalDrive2. The following command must be done with elevated privileges:

VBoxManage internalcommands createrawvmdk -filename MySSDDisk.vmdk -rawdisk \\.\PhysicalDrive2

Attach the disk to the Virtual box and you should see the /dev/sdx when you start up Ubuntu

answered on Super User Aug 6, 2013 by Sentient

User contributions licensed under CC BY-SA 3.0