0

I have a virtual machine (guest=linux, host=windows) that is run from a physical disk which was created by VBoxManage internalcommands createrawvmdk.

I'm about to max out the space on that SSD, so I want to migrate it all to a new, bigger one and while I'm at it, move it into a virtual disk image -- possibly also so that I can start creating snapshots.

Is this possible without reinstalling the guest OS (without creating a new VM)?

Else I'd have to create a new one, install the OS and rsync the stuff from the old SSD and "reinstall" all the stuff in the new one. It isn't that much because I use Docker a lot, which makes a manual migration easy, but there are also non-Dockerized DB's which would need to get migrated by hand, and I'd really like to avoid that. Or would you recommend creating a new VM anyway for some really specific reason?

1 Answer 1

0

There are two steps involved.

1) Copy the data

Creating a virtual image is easy. Shut down the VM, then in VirtualBox Manager open File -> Virtual Media Manager and click Copy. Select your hard disk (*.vmdk) and start the cloning/copying process. I chose VMDK as a target format. I also created an VDI, but the VMDK turned out to be faster.

Then go to the Settings of the VM -> Storage and in Controller: SATA choose the hard drive you want to replace. There's an icon to click where you can then navigate to the newly created file.

OK that and boot into the VM, you're now running from that file.

2) Resize the partition and the filesystem, for that see the following Q&A:

Resize Ubuntu /dev/sda1 partition in VirtualBox VMDK when /dev/sda is already larger

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .