0

Background:

Host OS: Windows 10 Professional Guest OS: Ubuntu 20.04

Host OS: I am able to add files, edit files and add folders. Verified that SD card is read and write card

Guest OS: I am able to mount and unmount the card. Able to read the changes in the text file made by host OS. Can add new files in the directory using "sudo" but the changes are not reflected back to Host OS. Also changes are lost as soon as the drive is unmounted. I can save the modifications made in the text files but these are not seen in host OS and all the changes are lost as soon as disk is unmounted

How everything was done?

Let me give you quick run down of what I have done:

  1. Making sure that SD Card is read and write.

    • Type DISKPART in windows search
    • Run DISKPART.exe
    • Type "LIST DISK"
    • Note down the disk number I am interested in
    • SELECT Disk
    • Type "ATTRIBUTES DISK"
    • Current Read-only State : No
    • Read Only: No
    • OFFLINE DISK. This is where I get the error and I am not able to take the disk offline
  2. Make sure Virtual Box is run as an administrator.

  3. Create VMDK disk: Followed the instructions over here:

  4. Assign the VMDK disk and set it writethrough

    • Followed steps 2 and 3 mentioned in the top answer over here.
    • Command line options:
      • Type "C:\Program Files\Oracle\VirtualBox\VBoxManage" modifyhd "destn\path\sdcard.vmdk" settype writethrough
      • Type "C:\Program Files\Oracle\VirtualBox\VBoxManage" storageattach --storagectl SATA --device 0 --port 0 --type hdd --medium "destn\path\sdcard.vmdk"

I am still not able to save files on SD card in the guest OS. What am I missing?

  1. I followed instructions over here. to turn USB card reader on. But I do not see any change in the way the SD card is exposed in guest OS.

  2. I have downloaded extension pack but the SD card reader is not populated in the USB filters.

What am I missing?

  • Ideas: Are there any write operations the guest can perform on the card that the host can see? Have you reflashed the card on the host to a filetype they can both utilize? Have you tried a different card? Is the physical read only sd card toggle set to rw? Are the virtual box tools installed on the guest? Do you have issues writing to other types of removable media through the guest? Are you SURE the guest is writing? (Example: Did you forget to sudo vim and :wq to save?) Can the host see other changes written by the guest to the card? (File attribute changes, touch a file, new folder, etc.) – sadtank Sep 25 '21 at 07:27
  • 1) No write operations by guest are seen by host. 2) Correct, FAT32. 3) Yes. 4)Yes, the host can write on the SD card. I am able to see the changes on guest near instantaneous. 5) I haven't tried that but I will check. 6) Yes, if open the text-editor it won't even let me save the changes.(I/o error) But if I use sudo vim/nano I am able to save the changes but those changes are not reflected back to host. 7) No, no folder creation, no text edition. It is almost that are two copies of SD card - one for host and one for guest. The guest is not able to reflect the change back to host but host can. – Dwight Schrute Sep 25 '21 at 15:20
  • Update: I have been testing SD card with my other laptop. Over there I found out that since the SD card reader/writer is on the USB I can forward it as a USB device and I was able to read and write to it. Over here, SD card can be accessed by either host or guest OS but not simultaneously. I am almost but not 100% sure that Windows is preventing guest OS to access the SD card. I simply do not know the mechanism by which it is doing it. I am really curious about it. Can somebody shed light on this? – Dwight Schrute Sep 26 '21 at 17:17
  • I’ve seen some DLP cause read issues, so if one of these devices is a work computer with say, Semantic on it, it might cause issues. Could be a driver issue. Something like USBGuard would just lock out the driver to prevent seeing it in the first place, so that’s out. If the file allocation table was corrupt then I’d expect similar behavior on all fat32 machines, barring some fault tolerance unique to one system... that should be fixed with a new format, even fast format of just a new allocation table... I’d be more suspicious of VIrtual Box after doing a fresh format... – sadtank Sep 27 '21 at 04:56
  • I do not have DLP software on my laptop. Also, I am able to read files correctly. Just not write. I was able to connect USB thumb drive and I was able to save and modify files on it. So I do not think it is file system/allocation issue. I have formatted and re-formatted dozen times but the behaviour remains the same. It feels like Microsoft is considering the SD card as an extension of hard-drive. – Dwight Schrute Sep 27 '21 at 14:13

0 Answers0