Page 1 of 1
Retrieve file from old Virtualbox guest...
Posted: 7. Jan 2017, 18:31
by thesun
I recently updated my computer, hard disk and all. I have the old hard disk. I have a new, working Ubuntu host Virtualbox and a working (new) guest Win7.
Unfortunately, I thought I could "copy" my old Virtualbox to the new one...but that seems very challenging. Is there any simple way to access a file that's been saved only in the old virtualbox guest Win7?
If so, can someone provide fairly easy, step-by-step instructions?
(Or link me to where this is answered? I've found lots of places where a file is corrupt and so on, but this is not corrupt...I can go back if I have to, reinstall the old hard drive, use Virtualbox there, but I feel like I should be able to hook the old hard drive up by USB and somehow run Virtualbox in a way that it can access this old system. Is that crazy?)
Thank you!
Re: Retrieve file from old Virtualbox guest...
Posted: 7. Jan 2017, 18:41
by Perryg
Easiest way would be to attach the old *.vdi ( guest ) to the new one as a second drive using the main manager storage section. ( guest must be shut down not saved state, Etc. )
Re: Retrieve file from old Virtualbox guest...
Posted: 7. Jan 2017, 18:46
by thesun
Thanks, Perryg!!!
But can you tell me how I actually do that? The steps I'd take?
1. Start Virtualbox but don't start a guest?
2. Attach old hard drive, find the .vdi file (where?) and use the Storage section of the (new, host) to add it?
I don't know what the state was. I had some snapshots, but they're all old. So I was usually just starting VB, using it, then shutting down Windows and exiting VB. Am I screwed?
Re: Retrieve file from old Virtualbox guest...
Posted: 7. Jan 2017, 19:12
by Perryg
Snapshots add another wrinkle. Your data will be scattered throughout the entire chain. Given this new information you would be better off adding the guest and retrieving your data. Steps are close to the same.
- Connect the old drive to the new host in what ever way you need. Find the guest folder ( should be in ~/VirtualBox VMs/ by default unless you changed it ) and copy the entire folder to the host.
Start the VirtualBox main manager and use the add feature to add the old guest to the host.
Then you can use shared folders or a network share to copy the old data off and place it where you will.
Re: Retrieve file from old Virtualbox guest...
Posted: 7. Jan 2017, 23:23
by thesun
Thanks again, Perryg.
I have the old Virtualbox VM folder on the original drive. I've navigated to it from the "Choose Existing Disk" option in the Storage...
Getting the following:
Failed to open the disk image file /my/path/is/here/VirtualBox VMs/Windows 7 Ultimate/Windows 7 Ultimate.vdi.
The medium '/my/path/is/here/VirtualBox VMs/Windows 7 Ultimate/Windows 7 Ultimate.vdi' can't be used as the requested device type.
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MediumWrap
Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
Callee: IVirtualBox {0169423f-46b4-cde9-91af-1e9d5b6cd945}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
I have a similarly named NEW .vdi file...is it that I can't have two .vdis with the same name? Will renaming the old one cause other issues?
I seem to be getting I/O errors when I'm trying to cp -a the directory, too. Maybe I should cut my losses and run?
Re: Retrieve file from old Virtualbox guest...
Posted: 8. Jan 2017, 00:06
by thesun
Tried copying the old folder entirely to a "oldvirtualbox" folder on my home directory, with the Win 7 and Snow Leopard folders in there...navigated to the folder and got this error:
Cannot register the hard disk '/my/home/path/oldvirtualbox/VirtualBox VMs/Windows 7 Ultimate/Windows 7 Ultimate.vdi' {ea0d95cc-f540-424c-bc5a-c55a78b0d431} because a hard disk '/my/different/usb/disk/home/path/VirtualBox VMs/Windows 7 Ultimate/Windows 7 Ultimate.vdi' with UUID {ea0d95cc-f540-424c-bc5a-c55a78b0d431} already exists.
Thought I just needed to remove the other disk, but that hasn't helped. Even removing it and entirely shutting down, with no .vdi file at all, then starting Virtualbox again, didn't work.
Re: Retrieve file from old Virtualbox guest...
Posted: 8. Jan 2017, 00:19
by BelJoost
thesun wrote:Unfortunately, I thought I could "copy" my old Virtualbox to the new one...but that seems very challenging.
It is easy peasy. I do it the commandline way on a headless Ubuntu server.
- Power down the virtual machine.
- Stop virtualbox completely. (I am not sure if this step is needed)
- Copy the folder(s) containing .vbox, snapshot folder and .vdi to the new system.
- Issue a VBoxManage registervm [complete/path/to/virtualmachine].vbox command.
That’s it!
Now you can issue a e.g.
or
Code: Select all
VBoxManage showvminfo [virtualmachine]
or
Code: Select all
VBoxHeadless --startvm "[virtualmachine]" &
In my case I always create the
.vdi in the virtual machine folder. So just copying that folder includes all necessary files.
The virtualbox command reads:
But just the filename with
.vbox extension is not enough.
You need to submit the complete path as in:
Code: Select all
VBoxManage registervm /home/[username]/VirtualBox\ VMs/[virtualmachine]/[virtualmachine].vbox
btw. I replaced the actual username, filename, foldername and virtualmachine name with placeholders between square brackets.
Re: Retrieve file from old Virtualbox guest...
Posted: 8. Jan 2017, 00:32
by Perryg
@ BelJoost,
Sure that would work if they had not already created a machine with the same name.
@ thesun,
Yes you need to remove the new one ( but do not select delete )
Then you need to rename the folder that has the new machine to anything else ( just remember exactly what it was ) because the old one is named the same.
use the add feature to add the old machine and it should start. ( it may complain about registration not sure but you should be able to boot it and retrieve your data )
Once you have your data saved on the host you remove the old one from the main manager ( without delete ) and rename the old folder to something else and rename the new one back to what it was and add it back using the main manager.
Note: the reason for all the renaming of these machines is to protect you from loosing machines caused by overwriting important data.
Re: Retrieve file from old Virtualbox guest...
Posted: 8. Jan 2017, 00:36
by thesun
@BelJoost, I got a bit farther using your (excellent!) instructions. I also found that renaming my .Virtualbox file helped get me past the identical named disks error...I used the VBoxManage command and registered the new (actually the old!) copy of the drive...But now I've got something else preventing it from running:
Failed to open a session for the virtual machine Windows 7 Ultimate.
Implementation of the USB 2.0 controller not found!
Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings.
Note! This error could also mean that an incompatible version of the 'Oracle VM VirtualBox Extension Pack' is installed (VERR_NOT_FOUND).
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: ConsoleWrap
Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}
Where do I go from here?
Re: Retrieve file from old Virtualbox guest...
Posted: 8. Jan 2017, 03:28
by thesun
So thanks to you guys I have gotten further than I would have otherwise. I can see the full 9 snapshots of the old Vbox Win7. But when opening the last one, it fails with several errors. 2 are (I think) safe to ignore, it just doesn't like that the paths to some shared folders is no longer correct, but 2 things happen: it either fails entirely with the below message and a "Failed to start VM" or something. Or it brings up a black, Windoze-looking "Disk read error. Press Cntl-Alt-Del to restart" but of course when I press Cntl-Alt-Del it doesn't do anything.
When it fails the message is this:
Failed to load unit 'cpum' (VERR_SSM_FIELD_OUT_OF_BOUNDS).
I searched around online and found this connected to an error when you upgrade your Virtualbox and try to use an older version's files. That's probably the case here, as I had Vbox installed several years ago. It may be 4.x or even older. And this current version I installed via "apt-get" and it's 5.0.24.
If I'm totally hosed and it's not going to work, I think my best (quickest) option might be to reinstall the old hard drive in the computer and boot it up...then hope to get the OLD Vbox working, and then use that to copy the files somewhere that I can get to them. It probably will take a couple hours of fiddling but maybe is just easier. Somehow in my mind I thought the snapshots were more portable.
Thanks for the help though. I may opt to do this hard drive thing tomorrow so if there's other things I can try without going through that hassle, I'd love to hear them!
Re: Retrieve file from old Virtualbox guest...
Posted: 8. Jan 2017, 04:24
by thesun
And turns out that's what I did. Just swapped out the old hard drive, went into the old Virtualbox, grabbed the files, copied them to USB, and now I have them.
And now the frustration is in trying to get things back to normal with my NEW system, which is turning into a nightmare too. I can't seem to get the new one back...it keeps trying to load up the old one (which can't load).
So I'm probably just going to wipe it, reinstall, and go from there. Haven't done anything much in the new system other than install Windows and TurboTax. Shouldn't be too ghastly a nightmare to reinstall.
Thanks for taking the time to offer suggestions and help, too!! I really appreciate it!
Re: Retrieve file from old Virtualbox guest...
Posted: 8. Jan 2017, 05:05
by thesun
Okay, so now I'm kind of stuck with a different problem: why can't my Virtualbox "forget" the old info? Where is the config file? I've apt-get removed the files and there's no .Virtualbox file but when I reinstall, it's still looking for the old, no-longer-there file!!!
I just want to wipe everything and start with a clean, no VM state.
Thanks!!!
Re: Retrieve file from old Virtualbox guest...
Posted: 8. Jan 2017, 05:45
by thesun
Renaming the /my/home/dir/.config/Virtualbox directory did the trick. I'm golden.