Dolphin can store data to a virtual SD card named sd.raw. By default, it will be created with the size of 128 MB.
The virtual SD card has important use for homebrew apps on Dolphin. Project M and Mario Kart Wii custom tracks are two good examples, as some homebrew apps can only work using files stored on the SD card of the real hardware for which they were designed.
It is recommend to create one with size at least 1 GB for large homebrew apps, for example, Project M, and no more than 2 GB for best compatibility as some games don't support SD cards larger than that.
As of 5.0-16891, Dolphin can automatically generate SD cards if you set a specific folder, and it will automatically determine the size during this process. This bypasses the need for third party programs.
The built-in generation is handled in the Options → Configuration → Wii menu along with the other SD card options. It will look something like this with the user having to manually configure the paths.
The options do as follows:
Dolphin can still only use the SD Card file during emulation, but these options make it much easier to generate an SD card without the use of Third Party tools.
If you're using an older version of Dolphin or simply prefer to use a Third Party tool for some reason, there are options for most operating systems.
Download Virtual SD Card Maker, unzip it, and open the appropriate folder for your system (Linux / OS X / Windows). The tool is run with a command like:
mksdcard 2048M sd.raw
Alternatively, a non-Mediafire download link can be found by visiting https://developer.android.com/studio/#command-tools and downloading the OS-specific zip there (mksdcard is part of the Android SDK)
This example creates a 2048 megabyte (2 GB) SD card formatted as FAT32:
hdiutil create -megabytes 2048 -fs MS-DOS -layout NONE -o ~/Library/"Application Support"/Dolphin/Wii/sd.raw mv ~/Library/"Application Support"/Dolphin/Wii/sd.raw.dmg ~/Library/"Application Support"/Dolphin/Wii/sd.raw
If the above tool does not work, one can manually create a FAT32 partition image in Linux provided dosfstools is installed. First, pull up a terminal, and then chdir into the Wii folder, which under certain configurations may be located at ~/.local/share/dolphin-emu/Wii instead.
cd ~/.dolphin-emu/Wii
Then, we must create our raw disk image. This example create a 2048 megabyte (2 GB) SD card, but one can replace the 2048 with an alternate number of megabytes.
dd if=/dev/zero bs=1M count=2048 of=sd.raw
Finally, we format our image to FAT32.
mkfs.fat -F 32 sd.raw
With Dolphin's built-in tools available in 5.0-16891 or newer, you can simply Convert File to Folder Now and then change whatever you want directly in your operating system by opening that folder. When you are done, simply Convert Folder to File Now to generate a new SD card. Alternatively, you can use Automatically sync with Folder on emulation start and end to do this process automatically, but it will cause longer startup/closing time on Wii games.
If you're using an older version of Dolphin or simply wish to use other methods, there are ways to do this on most operating systems.
The virtual SD card can be edited by mounting it to a virtual disk. Create a directory as a mountpoint:
sudo mkdir /media/sdcard
Mount sd.raw to the created directory:
sudo mount -o defaults,umask=000 ~/.local/share/dolphin-emu/Wii/sd.raw /media/sdcard
When you are done, unmount the virtual SD card:
sudo umount /media/sdcard
In Terminal window, type the following to mount the virtual SD card:
hdiutil attach -imagekey diskimage-class=CRawDiskImage ~/Library/Application\ Support/Dolphin/Wii/sd.raw
The virtual SD card can then be ejected through Finder when done being edited.
If you get an error (hdiutil: attach failed - no mountable file systems), you can use these commands instead:
hdiutil mount $(hdiutil attach -nomount -imagekey diskimage-class=CRawDiskImage ~/Library/Application\ Support/Dolphin/Wii/sd.raw)
The Windows users must use a third party software that can mount the virtual SD card. Speaking of which... ImDisk Virtual Disk Driver
WinImage is unreliable, because oddly enough, it will cause desync and few other unforeseeable problems. ImDisk will be fine.
Quick guide for mounting and editing the virtual SD card with the ImDisk Virtual Disk Driver:
If you want to launch a homebrew app using Dolphin's game list or Open dialog, the boot.elf or boot.dol file for the homebrew app needs be stored outside of the SD card. Conversely, if you want to launch a homebrew app from the Homebrew Channel, you need to place the boot.elf or boot.dol file inside the virtual SD card in the apps folder. Either way, any other files used by the homebrew app must be placed inside the virtual SD card.
In 5.0-16891 or newer, Dolphin can generate deterministic SD Cards for netplay! If you have "Automatically sync with Folder on emulation start and end" enabled on all computers, and the folders have the same exact files in them (file creation dates do not matter, as they will be scrubbed during the process), the generated SD card will be identical, preventing the SD card from causing desyncs. Note that this does not sync any files - the folders on all computers must be identical.
If using an older version of Dolphin and not dealing with copyrighted content, we highly recommend just generating an SD card on one computer, and then copying that SD card to all other computers to ensure that things are the same. However, if that virtual SD card was used offline or online with write block disabled, the MD5 checksum will change ("Date Accessed" of the files are what's different in virtual SD card), but will not cause immediate desyncs. If you are using a Wii game launcher app for various mods, users on all ends must have the same copies of homebrew app and the game in their game list first, then set the game as default ISO.