Errors when compacting VirtualBox VHD Image
My host OS is OS X Lion running a Windows XP client with VirtualBox 4.2.0. I'm wanting to make a copy of the image and compact it to share with a colleague. First, I used the VirtualBox command line to clone the image via clonehd
.
VBoxManage clonevdi /path/to/image.vhd /new/path/to/image.vhd
Next, I tried compacting the image with the following command:
VBoxManage modifyhd /new/path/to/image.vhd --compact
In which I'm presented with the following error:
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Failed to compact hard disk
VBoxManage: error: Could not compact medium '/new/path/to/image.vhd' (VERR_INVALID_STATE)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium
VBoxManage: error: Context: "int handleModifyHardDisk(HandlerArg*)" at line 577 of file VBoxManageDisk.cpp
I've tried my hand at resolving the issue by searching, but I've came up empty handed up to this point. Any help will be greatly appreciated.
virtualbox
add a comment |
My host OS is OS X Lion running a Windows XP client with VirtualBox 4.2.0. I'm wanting to make a copy of the image and compact it to share with a colleague. First, I used the VirtualBox command line to clone the image via clonehd
.
VBoxManage clonevdi /path/to/image.vhd /new/path/to/image.vhd
Next, I tried compacting the image with the following command:
VBoxManage modifyhd /new/path/to/image.vhd --compact
In which I'm presented with the following error:
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Failed to compact hard disk
VBoxManage: error: Could not compact medium '/new/path/to/image.vhd' (VERR_INVALID_STATE)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium
VBoxManage: error: Context: "int handleModifyHardDisk(HandlerArg*)" at line 577 of file VBoxManageDisk.cpp
I've tried my hand at resolving the issue by searching, but I've came up empty handed up to this point. Any help will be greatly appreciated.
virtualbox
add a comment |
My host OS is OS X Lion running a Windows XP client with VirtualBox 4.2.0. I'm wanting to make a copy of the image and compact it to share with a colleague. First, I used the VirtualBox command line to clone the image via clonehd
.
VBoxManage clonevdi /path/to/image.vhd /new/path/to/image.vhd
Next, I tried compacting the image with the following command:
VBoxManage modifyhd /new/path/to/image.vhd --compact
In which I'm presented with the following error:
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Failed to compact hard disk
VBoxManage: error: Could not compact medium '/new/path/to/image.vhd' (VERR_INVALID_STATE)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium
VBoxManage: error: Context: "int handleModifyHardDisk(HandlerArg*)" at line 577 of file VBoxManageDisk.cpp
I've tried my hand at resolving the issue by searching, but I've came up empty handed up to this point. Any help will be greatly appreciated.
virtualbox
My host OS is OS X Lion running a Windows XP client with VirtualBox 4.2.0. I'm wanting to make a copy of the image and compact it to share with a colleague. First, I used the VirtualBox command line to clone the image via clonehd
.
VBoxManage clonevdi /path/to/image.vhd /new/path/to/image.vhd
Next, I tried compacting the image with the following command:
VBoxManage modifyhd /new/path/to/image.vhd --compact
In which I'm presented with the following error:
Progress state: VBOX_E_FILE_ERROR
VBoxManage: error: Failed to compact hard disk
VBoxManage: error: Could not compact medium '/new/path/to/image.vhd' (VERR_INVALID_STATE)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component Medium, interface IMedium
VBoxManage: error: Context: "int handleModifyHardDisk(HandlerArg*)" at line 577 of file VBoxManageDisk.cpp
I've tried my hand at resolving the issue by searching, but I've came up empty handed up to this point. Any help will be greatly appreciated.
virtualbox
virtualbox
asked May 25 '13 at 17:22
naivedevelopernaivedeveloper
13019
13019
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You can only compact VDI images using the VirtualBox commandline as far as I know. You can use 3rd party tools to compact a VHD - Google is your friend.
If your host is Windows 7 or Windows Server 2008 R2, you should be able to use compact vdisk
according to the page at technet.microsoft.com/en-us/library/gg252556.aspx.
In the VirtualBox world, here's how...
VBoxManage modifyhd pathtodisk.VDI --compact
...if you've created a disk in a different format - e.g. VHD, exec the following command first...
VBoxManage clonehd "pathtovhdformat.vhd" "pathtovdiformat.vdi" --format vdi
See this example..., as well as this comprehensive example by Matt Wrock on how to optimise a VirtualBox VM, ready for packaging.
1
I have noticed that when converting from VHD to VDI, the result is already optimized, so you don't have to run --compact on it again.
– evilpenguin
Jul 20 '17 at 10:47
add a comment |
Same happened to me just now but I quickly fixed it by just shutting down the virtual machine.
-Looks like you can't shrink virtualbox storage while it's in use.
I'm not sure that this is relevant to this question, since the image that the OP was trying to compact was already a clone/copy of an existing VM.
– Scott
Jan 12 at 22:01
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f599905%2ferrors-when-compacting-virtualbox-vhd-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can only compact VDI images using the VirtualBox commandline as far as I know. You can use 3rd party tools to compact a VHD - Google is your friend.
If your host is Windows 7 or Windows Server 2008 R2, you should be able to use compact vdisk
according to the page at technet.microsoft.com/en-us/library/gg252556.aspx.
In the VirtualBox world, here's how...
VBoxManage modifyhd pathtodisk.VDI --compact
...if you've created a disk in a different format - e.g. VHD, exec the following command first...
VBoxManage clonehd "pathtovhdformat.vhd" "pathtovdiformat.vdi" --format vdi
See this example..., as well as this comprehensive example by Matt Wrock on how to optimise a VirtualBox VM, ready for packaging.
1
I have noticed that when converting from VHD to VDI, the result is already optimized, so you don't have to run --compact on it again.
– evilpenguin
Jul 20 '17 at 10:47
add a comment |
You can only compact VDI images using the VirtualBox commandline as far as I know. You can use 3rd party tools to compact a VHD - Google is your friend.
If your host is Windows 7 or Windows Server 2008 R2, you should be able to use compact vdisk
according to the page at technet.microsoft.com/en-us/library/gg252556.aspx.
In the VirtualBox world, here's how...
VBoxManage modifyhd pathtodisk.VDI --compact
...if you've created a disk in a different format - e.g. VHD, exec the following command first...
VBoxManage clonehd "pathtovhdformat.vhd" "pathtovdiformat.vdi" --format vdi
See this example..., as well as this comprehensive example by Matt Wrock on how to optimise a VirtualBox VM, ready for packaging.
1
I have noticed that when converting from VHD to VDI, the result is already optimized, so you don't have to run --compact on it again.
– evilpenguin
Jul 20 '17 at 10:47
add a comment |
You can only compact VDI images using the VirtualBox commandline as far as I know. You can use 3rd party tools to compact a VHD - Google is your friend.
If your host is Windows 7 or Windows Server 2008 R2, you should be able to use compact vdisk
according to the page at technet.microsoft.com/en-us/library/gg252556.aspx.
In the VirtualBox world, here's how...
VBoxManage modifyhd pathtodisk.VDI --compact
...if you've created a disk in a different format - e.g. VHD, exec the following command first...
VBoxManage clonehd "pathtovhdformat.vhd" "pathtovdiformat.vdi" --format vdi
See this example..., as well as this comprehensive example by Matt Wrock on how to optimise a VirtualBox VM, ready for packaging.
You can only compact VDI images using the VirtualBox commandline as far as I know. You can use 3rd party tools to compact a VHD - Google is your friend.
If your host is Windows 7 or Windows Server 2008 R2, you should be able to use compact vdisk
according to the page at technet.microsoft.com/en-us/library/gg252556.aspx.
In the VirtualBox world, here's how...
VBoxManage modifyhd pathtodisk.VDI --compact
...if you've created a disk in a different format - e.g. VHD, exec the following command first...
VBoxManage clonehd "pathtovhdformat.vhd" "pathtovdiformat.vdi" --format vdi
See this example..., as well as this comprehensive example by Matt Wrock on how to optimise a VirtualBox VM, ready for packaging.
edited Feb 26 '15 at 2:08
Eric G
940521
940521
answered Feb 26 '15 at 1:27
TechSpudTechSpud
213
213
1
I have noticed that when converting from VHD to VDI, the result is already optimized, so you don't have to run --compact on it again.
– evilpenguin
Jul 20 '17 at 10:47
add a comment |
1
I have noticed that when converting from VHD to VDI, the result is already optimized, so you don't have to run --compact on it again.
– evilpenguin
Jul 20 '17 at 10:47
1
1
I have noticed that when converting from VHD to VDI, the result is already optimized, so you don't have to run --compact on it again.
– evilpenguin
Jul 20 '17 at 10:47
I have noticed that when converting from VHD to VDI, the result is already optimized, so you don't have to run --compact on it again.
– evilpenguin
Jul 20 '17 at 10:47
add a comment |
Same happened to me just now but I quickly fixed it by just shutting down the virtual machine.
-Looks like you can't shrink virtualbox storage while it's in use.
I'm not sure that this is relevant to this question, since the image that the OP was trying to compact was already a clone/copy of an existing VM.
– Scott
Jan 12 at 22:01
add a comment |
Same happened to me just now but I quickly fixed it by just shutting down the virtual machine.
-Looks like you can't shrink virtualbox storage while it's in use.
I'm not sure that this is relevant to this question, since the image that the OP was trying to compact was already a clone/copy of an existing VM.
– Scott
Jan 12 at 22:01
add a comment |
Same happened to me just now but I quickly fixed it by just shutting down the virtual machine.
-Looks like you can't shrink virtualbox storage while it's in use.
Same happened to me just now but I quickly fixed it by just shutting down the virtual machine.
-Looks like you can't shrink virtualbox storage while it's in use.
answered Jan 12 at 21:22
gamingradeongamingradeon
1
1
I'm not sure that this is relevant to this question, since the image that the OP was trying to compact was already a clone/copy of an existing VM.
– Scott
Jan 12 at 22:01
add a comment |
I'm not sure that this is relevant to this question, since the image that the OP was trying to compact was already a clone/copy of an existing VM.
– Scott
Jan 12 at 22:01
I'm not sure that this is relevant to this question, since the image that the OP was trying to compact was already a clone/copy of an existing VM.
– Scott
Jan 12 at 22:01
I'm not sure that this is relevant to this question, since the image that the OP was trying to compact was already a clone/copy of an existing VM.
– Scott
Jan 12 at 22:01
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f599905%2ferrors-when-compacting-virtualbox-vhd-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown