Shrink Raspberry Pi Images - Using Windows, Virtualbox running Raspberry Pi Desktop
Massive Pi Images are a pain as they take too long to write to a sd card, so trimming them down speeds up prototyping.
My personal "setup pi image" is 3gb which is all the apps and setting I want for a fresh Raspberry Pi, which has ssh, vnc, ect installed while all the stuff I never need is removed.
-USB memory card reader
-Win32DiskImager (available from sourceforge)
-Virtualbox running Linux ( I am running Raspberry Pi Desktop available on the raspberry pi website, you could Ubuntu ect)
Before we begin make sure that you have expanded your Raspberry Pi file system.
Choose "Advanced Options" then "Expandfilesystem"
In the terminal type: sudo raspi-config
Before starting, backup your raspberry pi image using Win32DiskImager encase something goes wrong!
Backup your image.
sudo apt-get install gparted
Mount YOUR usb-memory card reader in Virtualbox
Choose your memory card.
Unmount card (right click).
Resize drive (right click).
Move the slider and leave a gap to fit the file system in, I leave a couple hundred megabytes just to avoid issues.
Nothing has changed yet, you need to click "Apply All Operations".
Wait it takes a few mins.
Congratulations your done!
Now make a new image using Win32DiskImager