VMWare Image Modification - vmware

If I already have an image that exists, can I create an image based on the existing one, except I want to make changes to the exisiting one (mainly configurations).

I do this all the time. I actually keep each of my VMs in a separate directory and duplicate the entire directory to make a copy. All references within the VMX file (configuration) are relative to the current directory.
One thing you need to watch out for. The VMX file has a line with the MAC address of the virtual network card:
ethernet0.generatedAddress = "00:0c:29:ff:1f:c7"
You'll need to change that if you want to run both VMs at the same time - I usually just bump the final digit up by 1 (to c8).
I also change the displayName in that file so I can tell the difference between them when they're running.

Yes, you can just copy the image off to external storage. Just find the image file(s) on your drive and do the copy when the image is not running. You can then change the original all you want. Is this what you are after?

What I do is create a base "clean" VM which I then run Sysprep on before cloning. You can run into a few problems when you don't reset the 'unique' elements of a windows installation and you're trying to run them simultaneously.
I'm running ~20 VMs at the moment and if any one gets seriously messed up (they're used for testing) I've got clean base images of Windows 2000, Windows XP, Vista and Server 2003 at the ready so I can be back up and running in 20mins or less.

Depending on what your needs are, you might try the (free) VMWare Converter. It lets you change drive sizes and other image parameters.

As others have said, this is exactly how you implement full backups for your VMs.
When the VM is not running, merely copy the virtual disks into a different location, then restart the VM.

Related

Virtualbox - Automatically return to snapshot

I've been trying for quite a while now to get the following thing to work - without success. I know that my approach is a bit of a dirty hack, so I'm always open for suggestions about how to do this in a better way.
We're running VirtualBox on Linux machines in a school environment. There are a couple of applications that absolutely need to be run under Windows, which is why there's no way around VirtualBox (forget wine!). So we put a Virtual Machine image on every local hard drive which the students can run if they need to. This image really ought to be "read only" in one way or another. Obviously, even running the machine will make changes to that image, so we need a mechanism that automatically reverts those changes. We're somewhat flexible about when this is supposed to happen. To me, doing this at each reboot seems to be the best approach but I wouldn't mind it being done at, say, logoff.
Right now we're using rsync on the image every time the computer boots which works as long as the virtual machine isn't started until that process is finished. Despite the fact that it works, it's a pain for the administrator as it may lead to various kinds of errors that are hard to reproduce, so there must be a better way.
My idea was to use a snapshot which I automatically revert to. Since simply deleting the Snapshot VDIs won't work, I wanted to create a "template snapshot vdi" (around 180MB) which is copied to a world writeble location (e.g. /tmp) at boot time. I know there's still a race condition but copying 180MB on a local hard drive should be significantly faster and predictable than rsyncing some 15GB. I then configure the virtual machine to use that snapshot.
Doing this VirtualBox produces error
Parent UUID {00000000-0000-0000-0000-000000000000} doesn't match UUID {12345678-1234-1234-1234-123456789012} in the xml file.
A possible cause is this issue with VirtualBox, though I'm not sure about this.
What came to my mind right now while writing those lines is using a script to copy/rsync the snapshot VDI template to the "right" path within the home directory just before the machine is being started by that script.
Are there any other suggestions?

How to set up, maintain and distribute a template VM in VMware

(i posted this question on VMware community forums, with no response)
All of my developers use VMware workstation 11 for running their Visual Studio development environments in Windows. I originally created a base VM, and then simply shared it around to all the users, unbeknown to all the issues it would cause with computer name conflicts, joining the domain, etc. Apparently I didn't 'sysprep' it. Someone with some VMware knowledge tried to help me out to set it up, but im still not sure if it is 100% correct.
I am now at a point where I need to make changes/updates to the base VM (new VS, run Windows Updates, etc) and distribute a new one around to all the developers again, and I need some help to make sure I do it properly this time:
I have 2 VM images currently: 1) a ‘base’ one that opens up to this screen http://screencast.com/t/tBO0IUvwtpbY and 2) one that opens up to this screen http://screencast.com/t/DLV71PeNygrk . I’m assuming it is the ‘base’ one that I make the ‘edits’ to?
If I do edit the ‘base’ VM, what option(s) should I choose in that sys prep dialog?
Once I make the necessary updates to the base VM, what do I need to do to 'prepare' it for distribution to my developers (do I need to run sys prep, do I need to make a copy of VM beforehand, etc)?
Currently the VM has 2 HD's: 1) used for the OS and applications (Persistent and non-Independent), and 2) used to store data files (Persistent and Independent) . Is this the best way to set it up and use the VM (and then use 'snapshots' to revert back to previous states), or should the OS disk be set up as 'non-persistent' after the user has set up the VM for first use (i.e. joined the domain, set up VS Workspace, etc) ? Basically we have had a few scenarios recently where the OS and VS have been corrupted and it took the devs a while to fix it, so I want them to have some sort of way to revert back to a known clean working state.
Thank you
In answer to your questions you are on the right track.
the first screen that opens is correct, customise everything you require in the OS then run the OOBE before distribution
Choose OOBE and tick Generalise, then choose shutdown.
Once the VM is shutdown export it and pass it round your developers. they will need to complete the wizard and then join to the domain if required, this will ensure all the sids are different on each server, remember they must still change the Servers name before joining the domain
Snapshots are best, if your dev needs to reboot etc he doesn't want to loose his changes, he then has the option to revert to a snapshot.
Hopefully this has answered your question, let me know if there is anything else you need :)

How to make a tslib-based calibration stay permanent?

I'm having problem making a permanent calibration in my embedded solution. I'm developing a Qt-based app for a Embedded Linux environment with touch screen. For this last part, I use tslib (configured by previous developers).
In what comes to simply calibrate the touch screen, everything is fine: ts_calibrate runs and creates the pointercal file correctly. If after calling ts_calibrate I run my Qt app (or ts_test), I can notice that the calibration is successful.
The problem is that the calibration results only works for 1 opening of my app: I calibrate with ts_calibrate, run my app, close it and if I run my app again, the screen is one again non-calibrated.
Now obviously I don't want to have to call the calibration each time my app is closed and reopened. The question is: how to make the calibration results become permanent? (that is, till another calibration is made)
Extra info:
I did some research on the web and I found this SO thread telling about a way to handle this problem using QWSServer. At first I disliked this solution since it depends on the Qt framework to do the job (I was expecting a more general, "C++ solution" (or a call to a script, whatever)). But I implemented it and it worked - but only in a specific case, namely, if I calibrate, open my software, close it and reopen it, then the calibration is maintained. But the problem nevertheless persists if I shut down the hardware completely, turn it on and run my app without a call to ts_calibrate (reloading the Linux kernel in the process); so this show to be only a partial solution and, therefore, not acceptable.
Trying to find the source of the problem, I created a copy of the pointercal file just after calibration and another copy of it after shutting down and turning up my hardware (and confirming that the calibration was over) and I noticed that the file was changed in the middle despite no call to the ts_calibrate or similar app was made:
After calibration:
55438 118 -1920736 -543 -36058 34531168 65536 800 480
After hardware shutdown:
-55040 1280 2526720 -288 35040 -34398240 -62768
The terminal log for the linux boot (tftp; bootm command) don't mention pointercal or a relevant calibration process.
Edit
I recently learned that the pointercal file located inside /etc/ is changing between sections because that entire folder is made new when the hardware is restarted. So what is essentially happening is that Tslib is going after a file that is constantly reset to default each time the hardware is restarted, and what I need to do is to configure Tslib not to look there, but to a more secure folder (in my case, the SD Card). The new question now is: how to do that? I know I have to configure the tslib.sh file making the TSLIB_CALIBFILE variable point to the new location of pointerscal, but tslib.shis itself inside /etc/, being itself temporary.
You have to change TSLIB_CALIBFILE in the image loaded via tftp.
That should do it, since you just have to change that once.

How to clone a virtualbox guest in link mode along with its saved state?

I'm looking for a way to quickly clone a VirtualBox guest, start it, use for a while, and toss it away. Therefore I think it's best to use link mode so that there is no need to copy the whole vdi file. It will also be nice to clone the saved state as well so that the new cloned guest can be started in a few seconds without the boot process. How can I do that?
Have a look at VBoxManage. It has commands like clonevm, startvm, 'snapshot take...', and
controlvm that should let you put together a script that does what you want.
Eric

Migrating from VMWARE to VirtualBox [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm trying to migrate an existing VM from VMWARE to VirtualBox. I've made a copy of the Virtual Machine folder for the VM (so I can experiment and not destroy the original) and have successfully created a VM in VirtualBox. I've got everything booting and running, but the issue is that VM is using the "flat" disk image instead of the correct disk image causing the disk image to be from the past (I know this because all the files on the machine have a timestamp of 2009).
To elaborate, in the VM's folder i have the following vmdk files:
Win2003.vmdk (1 K)
Win2003-flat.vmdk (15 gigs)
Win2003-000002.vmdk (10 gigs)
NOTE: the disk is dynamic.
Looking in the configuration of the VM under VMWARE, it says that it's using the win2003-000002.vmdk as the disk image.
When I import the disk image into VirtualBox (the Win2003.vmdk file), it uses the Win2003-flat.vmdk disk image.
My question is, what can I do to either combine or import the Win2003-000002.vmdk disk image into the Win2003-flat.vmdk disk image so that VirtualBox will use the correct disk image?
I've some instructions on using vmware-vdiskmanager.exe to accomplish this, but I get an error stating "The parent of this virtual disk could not be opened."
After many attempts I was finally able to get this working. Essentially what I did was download and use the vmware converter to merge the two disks into one. After that I was able to attach the newly created disk to VitrualBox.
The steps involved are very simple:
BEFORE YOU DO ANYTHING!
1) MAKE A BACKUP!!! Even if you follow these instruction, you could screw things up, so make a backup. Just shutdown the VM and then make a copy of the directory where VM resides.
2) Uninstall VMware Tools from the VM that you are going to convert. If for some reason you forget this step, you can still uninstall it after getting everything running under VirtualBox by following these steps. Do yourself the favor and just do it now.
NOW THE FUN PART!!!
1) Download and install the VMware Converter. I used 5.0.1 build-875114, just use the latest.
2) Download and install VirtualBox
3) Fire up VMWare convertor:
4) Click on Convert machine
6) Browse to the .vmx for your VM and click Next.
7) Give the new VM a name and select the location where you want to put it. Click Next
8) Click Next on the Options screen. You shouldn't have to change anything here.
9) Click Finish on the Summary screen to begin the conversion.
10) The conversion should start. This will take a LOOONG time so be patient.
11) Hopefully all went well, if it did, you should see that the conversion is completed:
12) Now open up VirtualBox and click New.
13) Give your VM a name and select what Type and Version it is. Click Next.
14) Select the size of the memory you want to give it. Click Next.
15) For the Hard Drive, click Use and existing hard drive file and select the newly converted .vmdk file.
16) Now Click Settings and select the Storage menu. The issue is that by default VirtualBox will add the drive as an IDE. This won't work and we need as we need to put it on a SCSI controller.
17) Select the IDE controller and the Remove Controller button.
18) Now click the Add Controller button and select Add SCSI Controller
19) Click the Add Hard Disk button.
20) Click Choose existing disk
21) Select your .vmdk file. Click OK
22) Select the System menu.
23) Click Enable IO APIC. Then click OK
24) Congrats!!! Your VM is now confgiured! Click Start to startup the VM!
I will suggest something totally different, we used it at work for many years ago on real computers and it worked perfect.
Boot both old and new machine on linux rescue Cd.
read the disk from one, and write it down to the other one, block by block, effectively copying the dist over the network.
You have to play around a little bit with the command line, but it worked so well that both machine complained about IP-conflict when they both booted :-) :-)
cat /dev/sda | ssh user#othermachine cat - > /dev/sda
QEMU has a fantastic utility called qmeu-img that will translate between all manner of disk image formats. An article on this process is at http://thedarkmaster.wordpress.com/2007/03/12/vmware-virtual-machine-to-virtual-box-conversion-how-to/
I recall in my head that I used qemu-img to roll multiple VMDKs into one, but I don't have that computer with me to retest the process. Even if I'm wrong, the article above includes a section that describes how to convert them with your VMWare tools.
Note: I am not sure this will be of any help to you, but you never know.
I found this link:http://www.ubuntugeek.com/howto-convert-vmware-image-to-virtualbox-image.html
ENJOY :-)
This error occurs because VMware has a bug that uses the absolute path of the disk file in certain situations.
If you look at the top of that small *.vmdk file you'll likely see an incorrect absolute path to the original VMDK file that needs to be corrected.