Freeing space from my home directory by moving vdi?

Discussions related to using VirtualBox on Linux hosts.
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Freeing space from my home directory by moving vdi?

Post by robbyx »

My active usable vdi is in

/home/rob/.Virtualbox/win2knew.vdi

I would like to move it to another drive. Is it a case of just moving only the vdi to the new location and then loading it via the virtual media manager?

Do I need to change the permissions for the file in its new location? I think the command is chmod but I do not know what qualifier if any to use.


Robin
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Freeing space from my home directory by moving vdi?

Post by Sasquatch »

If you move the file to a location where you already have read/write permissions, then you only need to unregister the VDI from the media manager, move the file, then register it and hook it to the VM it belonged to. To make sure all other files and settings are stored on the new location, change the paths in the VB global preferences. After that, you need to change the location of the snapshots of existing VMs, else it will be stored in your home folder where it continues to use your hard drive space.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Freeing space from my home directory by moving vdi?

Post by robbyx »

Thank you for your quick and very helpful reply.

looking in the VB-file--preferences I can see under general two default folder locations: Harddisks and Machines. Is that all I have to change or are there other locations to be changed elsewhere for the snapshots?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Freeing space from my home directory by moving vdi?

Post by Sasquatch »

Snapshots are in the VM settings itself too. New VMs will copy the machine folder location. If you have snapshots, then you have to edit the <machine>.xml and VirtualBox.xml files to reflect the new location, so they are still available.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Freeing space from my home directory by moving vdi?

Post by robbyx »

Thank you. To avoid having to manually change locations I propose to shut down windows from within VB so that all the windows settings are saved. Is there a way of merging the snap shot so it becomes redundant and disappears. I can then create new snapshots at the new location.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Freeing space from my home directory by moving vdi?

Post by Sasquatch »

That's possible, but you still need to change the location in the VM settings itself. For the snapshots, you have to discard them (icon with single arrow). Using the command line VBoxManage snapshot <vmname> discard <snapshotname> might be a bit better to use. I tested this myself, and the snapshot I had on the VM with the test merged with the base VDI.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Freeing space from my home directory by moving vdi?

Post by robbyx »

Sasquatch wrote:If you move the file to a location where you already have read/write permissions, then you only need to unregister the VDI from the media manager, move the file, then register it and hook it to the VM it belonged to.
I am looking at the Sun VB control and it shows on the left my one VB ie Win2k(Snapshot 1) --powered off
Right clicking shows the settings.

What should I do next to unregister the VDI?

Robin
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Freeing space from my home directory by moving vdi?

Post by Sasquatch »

You still have the snapshot, that needs to be removed first. In the main GUI, select the VM on the left side, and go to the Snapshots tab on the right side. There you can merge the data of the snapshot with the base VDI (single arrow icon) after which you can remove the empty snapshot (double arrow icon). Close VB, move the VDI, start VB and it will complain after which you can use the Media manager to remove the file from the list and register it again from the new location. Open the VM settings and check the hard drive section. Select the VDI again if it's missing as hard drive.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Freeing space from my home directory by moving vdi?

Post by robbyx »

Sasquatch wrote:You still have the snapshot, that needs to be removed first. In the main GUI, select the VM on the left side, and go to the Snapshots tab on the right side. There you can merge the data of the snapshot with the base VDI (single arrow icon) after which you can remove the empty snapshot (double arrow icon). .
Thank you for being so very helpful.

I followed the above and received the following error message:

Failed to discard the current snapshot and the current state of the virtual machine Win2k.
Hard disk '/home/rob/.VirtualBox/Win2knew.vdi' has more than one child hard disk (2).

Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
HardDisk
Interface:
IHardDisk {91648dc6-bb19-46bf-9e1c-4bf5b960c8e2}

When I tried to load the vdi after the error message the following error message flowed:

Failed to start the virtual machine Win2k.
Unable to restore the virtual machine's saved state from '/home/rob/.VirtualBox/Machines/Win2k/Snapshots/{e3f29267-5d6c-4784-45b0-27e1362f06af}.sav'. It may be damaged or from an older version of VirtualBox. Please discard the saved state before starting the virtual machine (VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION).


Robin
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Freeing space from my home directory by moving vdi?

Post by robbyx »

Here are some screen shots of my .virtualbox directory:
screenshot_001.png
screenshot_001.png (77.18 KiB) Viewed 2926 times
screenshot_002.png
screenshot_002.png (47.51 KiB) Viewed 2926 times
Robin
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Freeing space from my home directory by moving vdi?

Post by Sasquatch »

You still had more snapshots, you didn't mention that. I thought you would know that you need to merge all snapshots before you could unregister the VDI. Moving them and changing the XML files manually would have saved a lot of trouble and is probably faster too.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Freeing space from my home directory by moving vdi?

Post by robbyx »

In the control panel I can only see one snapshot. I think that is the problem. What should I do?

Can I still move the snapshots. The VB vdi will not open at the moment and I do not know how to merge the other snapshots as they do not appear in the control panel. I am wondering if the snapshots are a left over from an earlier attempt at using VB with a vdi of a different name.

Robin
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Freeing space from my home directory by moving vdi?

Post by robbyx »

I have just tried the discard arrow from within the Sun VB control panel when the details tab is showing not the snapshot tab. It is a down arrow and it worked. VB loaded without an error.

I would still like to move the files to the new location. As the control panel is showing just one snapshot how should I proceed? I happy not to merge the files but there seems to be more files than I need!

Robin
screenshot_004.png
screenshot_004.png (29.33 KiB) Viewed 2918 times
robbyx
Posts: 159
Joined: 8. Jan 2008, 13:57
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: WinXP

Re: Freeing space from my home directory by moving vdi?

Post by robbyx »

Whilst waiting for a reply I moved the whole .VirtualBox folder from home to the new location.
The machine win2k.xml did not have anything in it that needed changing so I left it alone.

I have changed the HD locations in VirtualBox.xml to the new location.

In virtual Media Manager I have tired to add the new location but as it is a hidden file it is not being seen in the Hard Disks Tab. I think it may be something to do with the chmod settings. I had this problem once before when I tried to run a program from the a non home directory. Do you know the command line?


Robin
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: Freeing space from my home directory by moving vdi?

Post by Sasquatch »

Hidden files and folders can be made visible. It's just a file manager setting. When browsing for a file in the File Browser opened from VB, right click on an empty part of the file manager files and folders display and select 'show hidden files and folders'. Snapshots are a branch of the current VDI, so the VDI entry will have a + sign meaning you can expand it.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply