Accessing SD Card from Linux VirtualBox Guest on Windows Host

This post shows steps to enable SD card access from Linux VirtualBox guest on Windows host. In this post, I use Windows 10 as the host and Ubuntu 18.04 as the guest.

 

Contents
– Steps
1. Create Virtual Machine Disk file (VMDK) for the SD Card device
2. Attach SD card VMDK to VM
3. Verify
– Troubleshoot

 

Steps
1. Create Virtual Machine Disk file (VMDK) for the SD Card device
1-1. Open Command Prompt as administrator (“Windows” key + “x” and select “Command prompt (admin)”).

1-2. Check the device ID for the SD card device

The result should be like this. In this example, the deviceID for the SD card is “\\.\PHYSICALDRIVE1”.

1-3. Create VMDK file for the SD card device by using “VBoxManage” command.

Note:
Replace “C:\Program Files\Oracle\VirtualBox” and “\\.\PHYSICALDRIVE1” with the installation folder of your VirtualBox and the device ID from the previous step respectively. The result should be like this.

and “sdcard.vmdk” file will be appared on the Desktop.

 

2. Attach SD card VMDK to VM
2-1. Launch VirtualBox as administrator.

2-2. Navigate to “Settint” > “Strage”.

2-3. Click on “Controller: SATA”.

2-4. Check “Use Host I/O Cache” check box.

2-5. Then, click on “Adds hard disk” icon.

2-6. Select “Choose Existing Disk”.

2-7. Navigate to Desktop and select the “sdcard.vmdk” file.

 

3. Verify
3-1. Launch the VM and verify. In my case it appeared as “/dev/sdb” as below (Raspbian OS image in 32GB SD card).

 

Troubleshoot
If you got the error below (during/after you made changes on the SD card), please go back to Step 2 and make sure “Use Host I/O Cache” check box is checked.

“I/O cache encountered an error while updating data in medium “ahci-0-1″ (rc=VERR_ACCESS_DENIED)”

 

 

Sponsor Link

Leave a Reply

Your email address will not be published. Required fields are marked *