How do I change location of Virtual machine?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
btor
Posts: 5
Joined: 2. Jul 2012, 01:46

How do I change location of Virtual machine?

Post by btor »

Ok so basically I have a 130gb SSD and I'm using Win7 as host and using ubuntu as virtual.

I'm about to install a 2nd hard drive for my laptop so I can keep a lot of files in my virtual machine. Is there a way to transfer my virtual machine installed in the ssd right now into a bigger drive?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How do I change location of Virtual machine?

Post by mpack »

The correct procedure to move a VM is first remove it from the UI (right click on VM, select remove, be careful to keep (not delete) the physical files). Then shut down VirtualBox, copy the VM folder to its new location, restart VirtualBox and use the Machine|Add... menu item to add back the VM from its new location.

If you want to guarantee that you can backtrack, then you can make a backup copy of the <userdata>\.VirtualBox\VirtualBox.xml file before you start.

Later on, i.e. after confirming that all is ok with the new VM, you can delete the physical copy of the old VM off the old drive (along with that backup xml).
btrakd
Posts: 3
Joined: 4. Jul 2012, 06:21

Re: How do I change location of Virtual machine?

Post by btrakd »

New member so i had to add spaces to urls before and after each /

A good tutorial using HDClone (freeware) - this method smoothly booted up on a different usb drive with a larger vdi file size
- llakomy . com / articles / increasing-vdi-file-size-on-virtualbox-part-1-using-hdclone
WARNING i have a post "Increasing VDI file size destroyed my NAT " that although many network functions work fine, this method may destroy your NAT connectivity.

A command line method i did not try yet:
askubuntu . com/ questions/ 88647/ how-do-i-increase-the-hard-disk-size-of-the-virtual-machine

good luck
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How do I change location of Virtual machine?

Post by mpack »

Um. Unless I've misunderstood, the OP asked about moving his VMs onto a larger drive. He didn't ask about increasing the logical size of his virtual disk drives. If he did I would point him to "VBoxManage modifyhd --resize", or the CloneVDI tool.
velrum
Posts: 7
Joined: 16. Sep 2009, 05:19
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: XP

Re: How do I change location of Virtual machine?

Post by velrum »

Can't you just copy the diskimage files?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How do I change location of Virtual machine?

Post by mpack »

First, the OP asked about relocating a VM, not cloning one. And no, just copying the disk image files would not relocate or clone the VM.
Post Reply