Iwant to format an SD card from my Linux virtual machine. I have a built-in SD card reader in my laptop. I tried using VirtualBox and VMware Player and installed Ubuntu 10.04 guest. None of them are showing the SD card reader as a device. I can access the SD card from the Windows host.
On newer MacBook Pro's the SD card slot is no longer exposed as a USB device. Because of this you'll need to attach the raw device to the VM in order to gain raw access to the whole card. Full documentation is in the Advanced Storage Configuration section of the VirtualBox documentation.
Warning - Raw hard disk access is for expert users only. Incorrect use or use of an outdated configuration can lead to total loss of data on the physical disk. Most importantly, do not attempt to boot the partition with the currently running host operating system in a guest. This will lead to severe data corruption.
In my case the "NO NAME" volume is the SD card, so I take note of the /dev/disk2s1 part. In this particular case the s1 part represents a partition (slice) on the raw device, so the part we'll use later is just the /dev/disk2 part.
It seems some people may have trouble with accessing the raw device in step 3.2 or 4.6. Attempts to run some of the commands with sudo won't help as VirtualBox will be running as your logged in user and still won't be able to access the raw device correct or the generated vmdk file.
The permissions on the device should also permit your usual user account to both read (r) and write (w) to this device. DO NOT CHANGE PERMISSIONS ON THE DEVICE UNLESS YOU ABSOLUTELY KNOW WHAT YOUR'RE DOING.
Turns out OSX Mountain Lion created the device with "root:operator" privileges and 0640 permissions. Unfortunately for now the only way to gain access to this device is to "sudo chown $USER" it to your current user each time you insert the device, however this is not recommended unless you really understand what you're doing. Hopefully either Apple or VirtualBox will find a more suitable solution.
To overcome this problem you can simply use an external Usb Memory Card Reader (i.e. sd card to usb adapter) instead of built-in card reader. It will expose your sd card as a USB device so that you can mount it easily just like any usb device. They're cheap devices and would be an acceptable solution considering all the hassle in the other way.
However, the essence of my solution--for Mountain Lion users--is as follows (use JinnKo's steps above, but insert my step here before running the 'VBoxManage internalcommands createrawvmdk [...]' command (that is, in between his steps 2 & 3):
* CAUTION * The below is only for those who want to risk permanently destroying data on their hard drive or flash storage drive. DO NOT DO THIS if you aren't sure you know what you're doing:
* CAUTION * DO NOT DO THIS if you aren't sure you know what you're doing. The above is only for those who want to RISK permanently destroying data on their hard drive or flash storage drive.
OP wasn't interested in a solution using shared folders, but if you're coming here because you just want to access an SD card in your VM and don't mind using shared folders: Setting up a shared folder is an easy way to get this working.
To be able to access /media as normal user, run sudo usermod -G vboxsf -a $(whoami) to add your user to that group for new sessions, and then run newgrp vboxsf to replace your current session (run groups to verify that it contains vboxsf).
I installed the "Virtual Box Guest Additons CD" files, but my SD card reader was not showing in my Windows XP Virtual Machine. I was able to get mine working by enabling the USB device in Virtual Box and then re-starting the Virtual Machine.
As kobaltz mentioned. To support the USB 2.0 and 3.0 versions you need to install the Virtual Extension Pack, I installed the 5.2.22 Oracle VM VirtualBox Extension Pack, and you can download it from the Virtual Box download page. Once you download the file, you can directly go ahead and install it, the same will be added to your Virtual Box extensions.
Luckily, you can open VMDK files with WinZip, Linux Reader or VMware Workstation Player. Read on to learn about the methods to recover the content of VMDK virtual disk files. Note that these methods only apply if the virtual disk is not encrypted or corrupted.
VMDK is a virtual machine disk file format, which is the open format developed by VMware. This virtual disk format has the .vmdk extension for files and is used by VMware and VirtualBox virtual machines. However, virtual machines residing on ESXi servers use a slightly different format of vmdk virtual disks. On the ESXi datastore, the virtual disk descriptor and the virtual disk extent that contains raw data of the virtual disk are two separate files.
The pattern of the virtual disk descriptor name is diskname.vmdk and the pattern of the virtual disk extent name that contains all raw data is diskname-flat.vmdk. As for virtual disks of the VMware Workstation format, they are represented as a single diskname.vmdk file (monolithic sparse), which is an extent data file containing an embedded virtual disk descriptor. A virtual disk descriptor defines the structure of the virtual disk, virtual disk geometry, virtual hardware version, and IDs.
A virtual disk descriptor is represented as plain text. On the left side of the screenshot below, you can see a virtual disk descriptor of the ESXi format (a vmdk file that can be opened with any text editor). On the right side of the screenshot, you can see the data of the virtual disk descriptor that is embedded into a single vmdk file of the VMware Workstation format. The vmdk file can be opened in a HEX editor.
As you can see, the embedded disk descriptor data is written to the monolithic vmdk file of the Workstation format from the 0x200 address, which is the number of the first byte. If you transform the 200 HEX value into a binary and decimal format, you will get:
This means that if you want to extract the embedded descriptor from the vmdk file, you should extract a portion of data starting from the 512th byte. You can find more information on VMware virtual disk descriptor files and learn how to extract, edit, and import an embedded virtual disk descriptor in the blog post about converting VMware VMs to Hyper-V VMs.
To open VMDK files by powering on existing VMs, you need a hypervisor such as VMware ESXi, VMware Workstation, VMware Player, or Oracle VirtualBox to be installed on your physical computer. You can opt for the legacy method by using a live DVD or by mounting the VMDK file as a virtual disk.
The idea behind this method is that you have a VM and can boot from a DVD disc. The ISO disk image can be used as the DVD disc inserted into the virtual DVD drive of the VM. After booting the operating system from a DVD media, you can mount the partitions of your virtual disk and copy files from the virtual disk to a USB hard disk attached to the VM or to your host machine, or to any other machine via the network. Some Live DVD distributions mount disks (partitions) automatically.
This is a legacy method because the principle is similar to copying files from physical disks of physical computers when the installed operating system cannot boot. This method can be used to extract data from VMDK disks of VMs running on VMware ESXi and VMware Player/Workstation.
Be aware that the operating system booted from Live DVD must recognize file systems of partitions of your virtual disk whose files you want to access. For example, Windows cannot work with Linux file systems such as EXT3, EXT4, ReiserFS, etc., by default. Using additional tools on Windows may help to resolve this issue. In turn, modern Linux recognizes Windows file systems such as NTFS and FAT32, and this is why you can use Linux-based Live DVD discs to copy files stored on virtual disks used by your Windows VM that cannot boot.
NOTE: The workflow for newer versions of the products considered in this blog post is the same. You can use VMware Workstation 17, ESXi 8.0, Windows Server 2019, Ubuntu Linux 22.04, etc., and use the working principle explained in this article.
This method is similar to the previous one, but in this case, the VMDK virtual disk should be attached to an existing virtual machine that has a functioning operating system. You can attach a VMDK file as an additional virtual disk to an existing VM running on an ESXi host, VMware Workstation, and VMware Player.
Keep in mind that the functioning operating system on the first (healthy) VM must be compatible with file systems used on the virtual disk of the second VM that has a non-bootable operating system (a VM whose VMDK file you want to attach as an additional virtual disk to extract files).
This example is similar to the previous one, but a VM running on VMware Workstation is used to open VMDK files of the ESXi VM. This method can be used when there is no free disk space on the ESXi datastore to copy a virtual disk, for example. A virtual disk of the Win-test2 VM that was mentioned in the previous example will be mounted to a VMware Workstation VM to extract its content.
This method requires a VMware Workstation installation on a Windows or Linux operating system running on your physical computer. VMware Workstation provides a nice feature that allows you to mount VMDK files to your host operating system. Virtual disks of the ESXi format and delta disks related to VM snapshots are supported. Similarly to all previous methods considered in this blog post, your operating system must support the file systems of virtual disk partitions.
If you have snapshots of your virtual machine, the delta virtual disks are created after creating each snapshot. You should have a parent virtual disk and delta disks available if you want to open a virtual disk state the moment after taking one or another snapshot. In this case, you should mount the appropriate delta virtual disk to your host operating system. Dependencies related to the parent virtual disk will be resolved automatically.
3a8082e126