VirtualBox

Ticket #14724 (new enhancement)

Opened 4 years ago

Last modified 3 years ago

Need way to move virtual-disk files of running VM

Reported by: jimav Owned by:
Component: VM control Version: VirtualBox 5.0.6
Keywords: Cc: anonymous1
Guest type: other Host type: Linux

Description

This is an enhancement request to permit virtual disk files to be moved while they are in use by a (paused) VM.

If an out-of-disk condition occurs, VBox very nicely pauses the VM and pops up a message so you can fix the problem and resume. However, it continues to hold the virtual disk (including snapshot) files open, so even if they are moved and replaced by symlinks, no disk space can be freed up. If the VM was running in a dedicated partition, i.e., there is nothing else to move or delete besides VM's files, then there is no possible recovery without loosing VM state; VBox won't close the old files until the VM is shut down, and it and it can't save the VM state if disk is full.

Following are a couple of suggestions, one basic and the other fancy:

Method A (Basic): When a VM is "paused", close all the VM's files, at least the virtual disks; re-open them only when the VM is resumed.

This would let you manually relocate a virtual disk and replace it with a symlink while the VM is paused. Using the symlink would be necessary because the .vbox file still could not be edited while VBox is running.

Method B (Fancy): Provide a comprehensive command to move a virtual disk, updating VirtualBox.xml or the VM's .vbox file as appropriate. For example

VBoxManage modifyvm <vmident> --movemedium <uuid|filename> /destination/folder/ VBoxManage modifyvm <vmident> --movesnap <snapid|filename> /destination/folder/

This would

  1. pause all VMs using the specified virtual disk *if not already paused*

(and make them close the underlying files, just as in the simpler method above);

  1. move the file,
  2. update and rewrite VirtualBox.xml or the VM's .vbox file with the new path;
  3. resume VMs paused in step 1 (but not VMs which were already paused)

Change History

comment:2 Changed 3 years ago by michael

  • Cc anonymous1 added

New CC list: anonymous1

Note: See TracTickets for help on using tickets.

www.oracle.com
ContactPrivacy policyTerms of Use