1. Download clonezilla and gparted live CD
2. Create a new VDI with bigger size, attach it to the VM, boot the VM with clonezilla live CD
3. Clone the old VDI to new VDI
4. Detach old VDI (don't delete it before new VDI is verified to work)
6. Boot the VM with gparted live CD, delete swap and extended partition, expand the primary partition, and then recreate the extended and swap partition
7. Remove CD and boot the VM, verify if it works
8. Delete old VDI

BTW, for Virtual Box shared folders:

sudo mount -t vboxsf share_name /path/to/mount

To mount it permanently, append a line to /etc/init.d/rc.local with above command.