I usually put the swap partition at the beginning to prevent such issues when resizing later. If you don't need more than 4 partitions, the extended partition is not needed.
I suggest you just remove sda5 and sda2, resize sda1 and add a new swap partition. But you'll need to adjust the operating system inside the VM for the new UUID and/or partition number of the swap.