Run Existing Windows Installation on Ubuntu with Vmware Player

Status
Not open for further replies.

infra_red_dude

Wire muncher!
Run Existing Windows Installation on Ubuntu with Vmware Player



Running existing Windows installation on Ubuntu is piece of cake. What you need is Vmware player and 10 minutes of spare time.

The easiest way to install Vmware player on Ubuntu is with Automatix. Automatix is great application that install software you can't live without with cuple of clicks, including free Vmware player and it's real time and nerve saver for newbies like me. If you don't have Automatix, get it here.


There are two ways you can get your existing Windows installation to run in Vmware player:

1. Vmware Conventer - Converts you existing physical Windows installation into virtual machine - means; if your Windows installation is 30 GB big, you will need another 30 GB of free space to store it somewhere. Not an option in my case.

2. To setup Vmware player to use physical Windows installation. Don't worry, you will still be able to boot and use your Windows like you used to do.

Let's start with the dirty work:

I will save you a lot of trouble with creating necesarry .vmdk and .vmw files. These are files that contain your virtual machine information and are used by Vmware player. Download windows.vmdk and windows.vxm but don't just fire 'em up yet. Read on.

Open console. You will use program "parted" to get some of your disk information and modify windows.vmdk file. Parted is already there in Ubuntu by default.
Strat parted with "sudo parted", (or if you have several disks "sudo parted /dev/hdx" where x the letter of the disk containing Windows installation) and type: "unit s" then "print". You will get something like this:

*www.advicesource.org/ubuntu/images/parted1.png

Note the underlined number. Now type: "unit cyl" and "print". You will get this:

*www.advicesource.org/ubuntu/images/parted2.png

Again, note the underlined numbers.

Open windows.vmdk file with text editor and find this part of file:

*www.advicesource.org/ubuntu/images/vmdk.PNG

Underlined values should be replaced with the values given by parted but there is a catch. Note that second RW value from vmdk file is not the same as the one you got from parted "Disk /dev/hda/". Thats because first partition on disk is master boot record or MBR which points to boot files of operating systems. It's lenght in this case is 63, and as far as I know, it is pretty standard value.

We will use copy of MBR so actual start point of Windows parititon is parted's value "Disk /dev/hda" 240121727 minus 63.

240121727 - 63 = 240121664 <- result goes to vmdk file

Now, you do the same for your values and modify vmdk file. Don't forget about "ddb.geometry.heads" and "ddb.geometry.cylinders".

Type "quit" in parted and make copy of MBR. Copy-paste this command into console:
"dd if=/dev/hda of=windowsxp.mbr bs=512 count=63"

Ubuntu part of work is done but DON'T run Vmware player yet. Put vmdk and vmx files together with copy of MBR windowsxp.mbr which is already in your home directory.

If you use Vista instead of XP, click here and come back after you imported IDE drivers.
If you use XP - read on.

Now reboot into Windows and set up another hardware profile for Vmware.
Start-> Control Panel-> System, click on Hardware tab and Hardware profiles. You will find Profile 1 (Current), highlight it and click Copy, give it new name, Vmware for instance and move it up.While at Hardware tab in System properties, you can disable driver signing.

One more thing to do. As you may know, work in Vmware machines is easier with Vmware tools. I took Vmware tools installation out of Vmware Server to spare you of downloading 100 MB + file and you can download it here. Unpack archive and put it somewhere on Windows partition.

If you don't trust me, go to Vmware web site and download whole Vmware Server package for Linux. You will find Vmware tools for Windows inside windows.iso file.

Finally, boot back to Ubuntu, run windows.vmx, choose newly created hardware profile at prompt and install Vmware tools once in Windows.

Oh and, windows.vmx contains some of virtual machine properties like amount of RAM or enabled or disabled peripherals so scroll thru it with text editor and customize it with your own needs.


Troubleshooting and additional info:

- I you get ""Cannot open the disk" error, add your user to "Disk group";

- If you have Windows that requires activation, be sure to know what are you doing. I'm not familiar with Windows Activation procedures and rights so I can't help you with that;

- If you get 0x000000xx BSOD in Windows upon boot, google for that error. One of the most common problems are hidden or restore partitions on brand-name/laptop computers;

- Xlib: extension "XFree86-VidModeExtension" missing on display ":1.0". error: Turn off Beryl or Compiz and try again;

- For SATA hard drives, open windows.vmdk file with text editor and change ddb.adapterType = "ide" to : ddb.adapterType = "scsi", "/dev/hdX" to "/dev/sdX".

- Vmware player can be installed from repositories, just enable "multiverse" and "apt-get install vmware-player"

Couple of things not recommended to do:

- Don't copy files in Ubuntu to the Windows partition while Windows run's in Vmware. This makes inconsistency in the file-system, and confuses windows, although rebooting and letting chkdsk to run fully, will fix the inconsistencies.

- Do not close Vmware without proper shutdown. When you do that Vmware copy a snapshot of memory and make something like hibernation for quick resume. I noticed that if you do that, and then reboot into native Windows, and then come back to Vmware, it makes Windows unstable and crashy.

Source

if anyone has tried it then do post ur experiences.
 
Last edited:

RCuber

The Mighty Unkel!!!
Staff member
Really good article. @Infra can u please edit you post and add the full content. I think this can be made sticky.
 

RCuber

The Mighty Unkel!!!
Staff member
^^O my god .. how did I miss that thread :O !! and its sticky too :mad: ..
I think there is no point keeping this thread open as it is already posted. I request mods to close this thread.
 
Status
Not open for further replies.
Top Bottom