Author Topic: Clone a Virtualbox VDI  (Read 19866 times)

0 Members and 1 Guest are viewing this topic.

Offline Scott Hauser

  • Newbie
  • *
  • Posts: 18
  • User-Rate: +0/-4
Clone a Virtualbox VDI
« on: May 14, 2008, 05:07:32 PM »

I found this little gem on the Puppy Linux forum.


Quote
Here's what I want to do:

1. Create a basic installation of XP under VirtualBox.
2. Apply all patches and updates, plus apply basic apps like antivirus
3. Copy that installation to another disk file so I can have 2 different VM's, say, one for development and another for testing

Easy right? VBoxManage clonevdi is designed to do this. Only it doesn't work -- it's a well-documented bug.

Here's the easy fix:

cp disk1.vdi disk2.vdi
VBoxManage internalcommands setvdiuuid disk2.vdi

You could have figured out the first command -- just copy the disk file, right? But when you try to register the 2nd disk with VirtualBox, will complain that a disk with the same UUID is already registered. The second undocumented command will assign a new UUID to the disk file, and voila! You have a new copy of your disk!

http://murga-linux.com/puppy/viewtopic.php?t=21796

His solution to this works very well. The bug in the VBoxManage clonevdi still exists in the latest version.

RE:
Quote
The second undocumented command will assign a new UUID to the disk file
Do you suppose there is a Linux equivalent to Depends.exe?

 I created a second VM called Win2000 bare, which is a bare bones Windows 2000 installation. This allows me to  test my InnoSetup install/uninstall in a separate VM. For giggles, you can run both VMs simultaneously if you wish.

Scott

Offline Donald Darden

  • Sr. Member
  • ****
  • Posts: 363
  • User-Rate: +3/-13
Re: Clone a Virtualbox VDI
« Reply #1 on: May 14, 2008, 08:48:33 PM »
I have three copies of my Windows 2000 Pro virtual disk image (VDI), each one set up under a different install of VirtualBox, each on a separate install of Ubuntu as host on one of three partitions.  After a number of years of computer breakdowns and software gone bad, I believe in safety in numbers.

The really great thing about building a VDI of Windows, is that once you set it up, you can copy and run it anywhere.  What I mean is, it is not like a regular install of Windows that has to be reconfigured to run on different hardware.  IN virtual mode, Windows always sees the Virtual C drive as being the same, with a virtual D CD-ROM drive, so it runs with no fuss at all.  And no need to reinstall Windows or spend all that time doing the updates and installing your applications again.

In my case though, I just went into the VDI folder (you have to find .VirtualBox folder and go up from there), and copied the VDI file from one partition to the next, then the next.  I then started up Ubuntu and VirtualBox for that partion, and added the image to that environment.  Once I did that, and made any other selections for CD images, USB devices, and so on, I just started up Windows in virtual mode, and everything on it was immediately available to me.  I would say that allowing for about 15 minutes to copy the 4 GB virtual drive file from one partiton to the next, each added VDI only took about a half hour. 

Right now I am doing development work on my first Ubuntu install, which is the first partition of my second hard drive (added for this purpose), using PB/CC in my virtual install of Windows, and it is working just fine.  In fact, when I want to, I just use full screen mode for Windows, and it feels and looks like I am just running Windows.

On my older box, the only noticable impacts is that sound is choppy when the headphones are used under my virtual Windows, and the game Pinball won't let me shoot a ball because I cannot register a key (spacebar) as constantly held down in order to pull back the plunger.  Minor annoyances, and everything else works remarkably well.  I'd love to see how well this software will run on a multicore machine, rather than here, but it is absolutely usable just as-is. 

Offline Scott Hauser

  • Newbie
  • *
  • Posts: 18
  • User-Rate: +0/-4
Re: Clone a Virtualbox VDI
« Reply #2 on: May 15, 2008, 06:15:08 AM »
I am running it on a Intel dualcore with 1 gb ram. It seems to perform pretty well (roughly 35 seconds to the login screen). I did find that if I was running Open Office word and spreadsheet in the Ubuntu host at the same time that; switching to seamless mode brought the system to its knees and the desktop turned black. I was cutting and pasting between the Office apps and decided to start Win2K. It was working fine until I switched to seamless. I suspect that Open Office may have had quite a bit of ram in use before I launched Windows.

Edit...

The problem is not related to Open Office. I was able to duplicate the symptoms with a cold boot followed by launching the Win2k vdi in seamless mode. If I move the mouse along the left side of Ubuntu's lower tray the Windows Start menu appears. If I click the start button on the win menu the Ubuntu desktop reappears. Using the troubleshooting logic: "What was the last thing that was changed before the problem appeared? Points to 230 +- mb of updates Ubuntu installed three days ago... Sigh!
« Last Edit: May 15, 2008, 05:53:57 PM by Scott Hauser »

Offline Donald Darden

  • Sr. Member
  • ****
  • Posts: 363
  • User-Rate: +3/-13
Re: Clone a Virtualbox VDI
« Reply #3 on: May 15, 2008, 10:59:01 PM »
I'm having a little trouble with Ubuntu after the last 17 packages were updated.  It works fine for the most part, but it keeps forgetting my USB headset, and I can't get the taskbar volume control to work with the headset - I have to dig around for the sound control.

But that's minor, and I might expect that this will get resolved going forward.

As to Open Office, best open a bug report if you want it fixed sooner or later.  I set up Office 2000 under my virtual Windows, so I haven't had to contend with Open Office much yet.

Offline James C. Fuller

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 595
  • User-Rate: +11/-8
Re: Clone a Virtualbox VDI
« Reply #4 on: May 22, 2008, 09:11:09 PM »
Quote
I have three copies of my Windows 2000 Pro virtual disk image (VDI), each one set up under a different install of VirtualBox, each on a separate install of Ubuntu as host on one of three partitions.  After a number of years of computer breakdowns and software gone bad, I believe in safety in numbers.

Donald,

Doesn't this violate the Windows licensing agreement?

James

Offline Donald Darden

  • Sr. Member
  • ****
  • Posts: 363
  • User-Rate: +3/-13
Re: Clone a Virtualbox VDI
« Reply #5 on: June 13, 2008, 12:12:25 AM »
Why? I am only using one at a time, on the same machine.  It is a method of disaster prevention in that I have prepared several installs of Windows in case one suddenly blows up or crashes on me.  What happens when you make backup copies of your hard drive?  You also make copies of the operating system, right?  Does your license agreement say anything concerning THAT practice?  And if it did, such as saying "any backups of the hard drive and contents must exclude all files related to or containing any code or data specific to and/or about the operating system", would that be something that you would believe was justified or an entitlement by the person or party making that claim?  I could argue in that case that an email that happened to mention the word "Windows" should also be excluded from backups.

I am not granting any favors to any license that it does not specifically call for, and I am not limiting myself in a way that jeopardizes my continued use of the PC or ability to recover from hardware or software failures that may (and likely will) occur.  They deny any warrantee or guarantee as to suitability to purpose or use,
and therefore I intend to protect myself as best I am able against their shortcomings. 

Offline Donald Darden

  • Sr. Member
  • ****
  • Posts: 363
  • User-Rate: +3/-13
Re: Clone a Virtualbox VDI
« Reply #6 on: June 18, 2008, 01:19:26 AM »
An interesting result of having several installs of Windows 2000 on my PC.  The ones in virtual environments accepted the last round of Microsoft updates with no problems, while the ones installed normally only took the first one of the four updates.  I'm not sure why this happened, but because the results were consistent across the board, I immediately concluded that the added security features for the normal installs were likely to be a factor, and that since I have pretty much changed over to booting to Ubuntu then running Windows in virtual mode, that I could forego having to worry about the installs that would not update.