Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.


  Search this Thread
Old 08-30-2006, 11:51 AM   #1
LQ Newbie
Registered: Jul 2005
Distribution: Debian unstable
Posts: 4

Rep: Reputation: 0
DISCUSSION: Howto run Windows with VMware Player in Linux for free

This thread is to discuss the article titled:
Howto run Windows with VMware Player in Linux for free

OK, so you've bought a new PC and have Windows pre-installed. First, you shrank Windows partition to the minimum and installed your favorite Unix distribution. Then setup a dual boot to either operating systems and wondering if you really need to reboot to Windows each time you need to test how something looks on Windows or perhaps your girlfriend wants to do wicked stuff. This page explains how to run Windows in Linux environment without a need to reboot or reinstalling Windows. The solution is to run VMware Player from raw Windows partition under Linux. Everything on this page is pure hacking, even worse, not a single manual has been read. Everything you do falls under your responsibility and your own risk. You've been warned. Actually there's a good reason for VMware not to release manuals on vmx and vmdk formats: you should use their tools (VMware Workstation) to do such things and not poke around. Here is a to-do list of this howto:
  1. Install VMware Player
  2. Create a Virtual Machine
  3. Create a Virtual Disk
  4. Decontaminate Hazardous Booting Options
  5. Prepare Windows for the Last Journey
  6. Boot It Up and Install VMware Tools
CAUTION: This howto contains many commands that can destroy the contents of your harddisk if misspelled, wrongly understood or just typed-in into wrong terminal. I've done this twice on two separate Debian machines: with Windows 2000 Professional and Windows XP Home Edition. It worked, but one more warning: Windows XP asked for another key for product activation. I had to call special phone number (provided by Windows), talk to a Microsoft guy and exchange some numbers to activate Windows XP on "new hardware" provided by VMware Player. After re-activation the normal boot back to the old hardware discards the activation and ... don't know, haven't been that far. If you don't reactivate and come back to virtual solution, Windows reactivates itself without additional numbers. Installing VMware Player in Linux This is supposed to be easy, if not, don't bother going any further. VMware Player instructions are here You will probably want to get a .deb file instead of rpm, but don't bother, the solution with alien did not work out for me, so save time and install from tar.gz. Then run to setup kernel module, guest network, etc.. If you are not sure what type of network you want, choose defaults, NAT (Network Address Translation) should hide your Windows-sins from the rest of the world. If you have custom kernel, VMware Player may require sources or at least headers of your kernel. So make sure you install your proper linux-headers-X.Y.Z before installing the kernel image linux-image-X.Y.Z, this will make sure that proper links to headers are created and can easily find them. By default VMware Player uses Control+Alt key combination to jump out of the guest. Then Control+Alt+Delete is accessible via Control+Alt+Insert. If you also find this annoying you can change the jumping out shortcut to Control+Alt+Shift by adding the following lines to your ~/.vmware/preferences: pref.hotkey.shift = "true" pref.hotkey.control = "true" pref.hotkey.alt = "true" This key combination is especially useful when running Linux guests. Creating a Virtual Machine You might want to use this javascript vmx builder: to get the initial version and come back here for disk options. Here we go with windows.vmx, the lines starting with # are comments: #!/opt/local/bin/vmplayer config.version = "8" virtualHW.version = "4" MemAllowAutoScaleDown = "TRUE" MemTrimRate = "-1" uuid.location = "56 4d aa ca 7f f2 08 05-5b 60 2c 15 00 a8 58 db" uuid.bios = "56 4d aa ca 7f f2 08 05-5b 60 2c 15 00 a8 58 db" uuid.action = "create" checkpoint.vmState = "" # # Here the interesting stuff begins: # the title of vmplayer window when running this machine: displayName = "Windblows" # prepare for WindowsXPHome, also see guestOS = "winxphome" # allocate 384M of RAM for your guest memsize = "384" # networking stuff, please change the last three numbers of generatedAddress ethernet0.present = "TRUE" ethernet0.connectionType = "nat" ethernet0.addressType = "generated" ethernet0.generatedAddress = "00:0c:29:a8:58:db" ethernet0.generatedAddressOffset = "0" # usb.present = "TRUE" usb.generic.autoconnect = "FALSE" usb.startConnected = "FALSE" # we may want to have sound: sound.present = "TRUE" sound.autodetect = "TRUE" sound.startConnected = "FALSE" # es1371 is good for PCI, you can also try sb16, or remove completely sound.virtualDev = "es1371" sound.fileName = "-1" # no SCSI devices this time.. scsi0.present = "FALSE" scsi0:0.present = "FALSE" scsi0:1.present = "FALSE" # # Here I connect my Windows 98 boot floppy to to get rid of grub in MBR: floppy0.present = "FALSE" floppy0.fileName = "bootWin98SE.img" floppy0.filetype = "file" floppy0.startConnected = "FALSE" # # This is the important part about our disk with everything on it: ide0:0.present = "TRUE" ide0:0.fileName = "rawdisk.vmdk" ide0:0.mode = "independent-persistent" ide0:0.deviceType = "rawDisk" ide0:0.writeThrough = "FALSE" ide0:0.startConnected = "TRUE" ide0:0.redo = "" # ide0:1.present = "FALSE" # # I connected my /dev/hdb DVD-ROM as secondary master IDE: ide1:0.present = "TRUE" ide1:0.deviceType = "atapi-cdrom" ide1:0.filename = "/dev/hdb" ide1:0.startConnected = "FALSE" ide1:1.present = "FALSE" # # synchronize the time of guest with host system clock: tools.syncTime = "TRUE" tools.remindInstall = "FALSE" Creating a Virtual Disk This is the most complicated part, and the most dangerous. Never ever boot from the same (root) partition twice at the same time. This will almost definetly result in tragic loss of data. You might not even be able to boot after that! So before you see your boot menu in VMware Player, take care and remove the automatic boot selection and timeout features. In order to operate on raw harddisk you will need to give user permissions to access the /dev/hd* files. Those files usually belong to disk group in Debian, so add your user to this group while being root: adduser johndoe disk. You will have to logout-login for the new group to take effect. First I found how to plug the whole physical disk into VMware Player machine, it's simple but is very dangerous. So go to the next method if you can. Plain Physical Disk -- Dangerous I assume that you have Windows and Linux installed on the same physical hard disk, but on different partitions. The boot manager is installed in the Master Boot Record (MBR) of the disk. First, remove the timeout feature from your boot manager. In grub it is done by commenting out the line with "timeout 30" in /boot/grub/menu.lst file. If you use other than grub, please consult the documentation, it is crucial that the bootloader won't boot the default partition, you should be able to change it and there should not be any rush. You will almost definetly loose the data and might not even boot again if you boot the same partition twice. Here is the example of virtual disk file: # Disk DescriptorFile version=1 CID=f7e370a1 parentCID=ffffffff createType="fullDevice" # # The number 78140160 is the size of my whole disk in 512B sectors # consult "sfdisk -d /dev/hda" if not sure. # If vmplayer complains, look at vmware.log for the "facts" # Extent description # length type file offset RW 78140160 FLAT "/dev/hda" 0 # # The Disk Data Base #DDB # # This geometry should work for almost all drives. # If wmplayer complains, again, look at vmware.log for "facts" ddb.virtualHWVersion = "4" ddb.geometry.cylinders = "16383" ddb.geometry.heads = "16" ddb.geometry.sectors = "63" ddb.geometry.biosCylinders = "1024" ddb.geometry.biosHeads = "255" ddb.geometry.biosSectors = "63" ddb.adapterType = "ide" ddb.toolsVersion = "6404" Generic Boot Manager Separation OK, so now we want to avoid accidental select of Linux partition upon VMware Player boot. The trick is to use different Master Boot Record (MBR) where the boot manager sits. But on the other hand we still want to use the same physical partitions where Windows sit. This is probably the only safe way to go if you have extended partitions (I could not find configuration of partitionedDevice with extended partitions). First, save a copy of your /dev/hda disk MBR to a file mbr.img: dd if=/dev/hda of=mbr.img bs=512 count=63. OK, I admit that boot manager sits in the first 446 bytes (the next 56 bytes contain partitioning information, so don't harm it), but for VMware Player you need 63 sectors, for some reason, like here: Then create the disk descriptor file, here is an example: # Disk DescriptorFile version=1 CID=a15a2810 parentCID=ffffffff createType="monolithicFlat" # # The idea is the similar: # 1st line means the first 63 sectors are in "FLAT" file mbr.img starting from 0 # 2nd line means the following 78140097=78140160-63 of /dev/hda file from pos.63 # Extent description # length type file offset RW 63 FLAT "mbr.img" 0 RW 78140097 FLAT "/dev/hda" 63 # # The Disk Data Base #DDB # The same as in previous example: ddb.virtualHWVersion = "4" ddb.geometry.cylinders = "16383" ddb.geometry.heads = "16" ddb.geometry.sectors = "63" ddb.geometry.biosCylinders = "1024" ddb.geometry.biosHeads = "255" ddb.geometry.biosSectors = "63" ddb.adapterType = "ide" ddb.toolsVersion = "6404" Now that you have separated MBR from physical disk into file you can overwrite your virtual MBR. I used Windows 98 boot floppy to run "fdisk /mbr" and wipe grub from virtual MBR and install default boot loader witch gives control to the first bootable partition (Windows). The other solution could be (I haven't tried) boot VMware Player from Linux Live CD and erase the first 446 bytes: dd if=/dev/zero of=/dev/hda bs=446 count=1. If VMware Player starts complaining about new disk in virtual machine and asks to remove and add it again, then something went wrong with virtual BIOS information. In this case I just remove nvram file (rm nvram) and retry. Disk as Partitioned Device If you don't have extended partitions, then you can gain more control and specify disk as a set of partitions, where some of them (e.g. Linux) can be hidden (from Windows). First, save a copy of your /dev/hda disk MBR to a file mbr.img: dd if=/dev/hda of=mbr.img bs=512 count=63. Then create the disk descriptor file by following the example: # Disk DescriptorFile version=1 CID=46956dfd parentCID=ffffffff createType="partitionedDevice" # # Extent description # length type file offset RW 63 FLAT "mbr.img" 0 RW 20980827 FLAT "/dev/hda" 63 RW 55086885 ZERO RW 1044225 FLAT "/dev/hda" 76067775 RW 1044225 ZERO # the structure above reflects the output of sfdisk -d /dev/hda: #(mbr.img : start= 0, size= 63) #/dev/hda1 : start= 63, size= 20980827, Id= 7, bootable #/dev/hda2 : start= 20980890, size= 55086885, Id=83 #/dev/hda3 : start= 76067775, size= 1044225, Id= e #/dev/hda4 : start= 77112000, size= 1044225, Id=82 #My Windows live in hda1 and hda3. #Put ZERO to hide hda2 and hda4 (Linux) partitions (prevent Windows even seeing #them!). #Notice that VMware Player does not accept devices like /dev/hda1. # # The Disk Data Base #DDB # ddb.toolsVersion = "6404" ddb.adapterType = "ide" ddb.geometry.biosSectors = "63" ddb.geometry.biosHeads = "255" ddb.geometry.biosCylinders = "1024" ddb.geometry.sectors = "63" ddb.geometry.heads = "16" ddb.geometry.cylinders = "16383" ddb.virtualHWVersion = "4" Use the procedure above to get rid of grub from virtual MBR. Prepare Windows This is probably your last Windows boot with real hardware. In order to tell Windows that you are going to run on different (i.e. virtual) hardware, you need to create a separate software and hardware profile for each hardware setup. Sadly I don't know such thing as "software profile" in Windows. We will have to get rid of auto-startups of all sorts of system utilities, which might get in the way while running in VMware Player. You should examine your start menu (Start-Program Files-Startup) and remove everything that is your hardware specific (they won't work anyway), this includes laptop fan, CPU frequency control, multimedia button support, special video utilities running in system tray, wireless network setup utilities etc.. Also cleanup the registry:
  1. Launch the registry editor: Start-Run-Open: regedit
  2. Backup the registry by clicking on the top most node ("My Computer"), choose File-Export, type in some meaningfull name, such as reg2006-08-26
  3. Goto HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run and see what programs are started. You might discover a virus or two sitting already there. Cleanup as you did with your "Startup", you should keep the anti-virus if you have one
  4. Goto HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run and cleanup there as in previous step. You want to come back here more often to remove other weird stuff like RealPlayer/AcrobatReader "quick startup".
Here are the steps to create a hardware profile for VMware Player:
  1. Right-click on "My Computer" icon, choose "Properties".
  2. Choose "Hardware" tab in "System Properties".
  3. Click "Hardware Profiles" button.
  4. Click "Copy" button, this should create one more profile (usually there is only one profile, unless you use docking station..).
  5. Click on "... (Current)" profile, click "Rename" button and rename it to e.g. "vmware".
  6. Click "OK"..."OK" until you close all windows except "System properties".
  7. Click "Device Manager" button
  8. Disable all your network adapters, display adapters, sound drivers (except "Legacy" and don't touch codecs, only drivers!) and any exotic non-generic devices you might have, like TVcard. The network, sound and especially display adapter drivers will be provided by VMware tools.
Now I am assuming that you will run the "vmware" profile that is going to be dedicated to VMware Player virtual hardware. Say good-bye and reboot back to Linux now. Booting it Up in VMware Player Now you work in Linux. Launch VMware Player with vmplayer windows.vmx. If not successful look at vmware.log and try googling for the solution, has plenty of advices. Typical problems are wrong disk configurations. Sometimes deleting nvram helps. If Windows finally got up and running, it will find plenty of new hardware, but you must cancel all the driver setup until VMware Tools are installed. Don't even click on a System Tray balloon asking to change Display adapter resolution or whatever, this might result in blue screen of death. You only need network card for now, perhaps Windows will find some default (AMD?) drivers for your virtual network card. My Windows XP Home Edition required a new product activation when I first logged in. Not sure if it's because of infamous Windows Genuine Advantage program, but Windows 2000 Professional still works without any call-home or sentiments to real hardware. The product re-activation looked like the following: Windows rejects the old key, then the other choice in the dialog is to call a local Microsoft representative, luckily that was charge-free number, dialog displays the long installation number and asks for activation number which is dictated via phone. Eventually click finish and it's done. Except that you might not be able to run Windows on a real hardware anymore since it will need product re-activation (in 3 days) again. Installing VMware Tools in Windows VMware Tools are optional, but they provide drivers for display adapter (to run in higher than 640x480 resolution) and greatly improve the interaction with virtual machine, so it's highly recommended. Here are the steps from <ol> Get the VMware Workstation from, e.g.
Old 08-30-2006, 11:09 PM   #2
Senior Member
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
VMware server is free and has more virtual network support features
Old 09-01-2006, 03:23 AM   #3
LQ Newbie
Registered: Jul 2005
Distribution: Debian unstable
Posts: 4

Original Poster
Rep: Reputation: 0
Originally Posted by musicman_ace
VMware server is free and has more virtual network support features
hm.. yes that's true, VMware Server can do most of the things in friendly fashion. But I still have problems with extended partitions: VMware complains about the disk configuration it tries to create, it says remove the disk and put it back again. Perhaps it's a vmware bug.
And besides, vmware-server still requires registration (serial number) for some reason :-/
Old 09-01-2006, 03:24 AM   #4
LQ Newbie
Registered: Jul 2005
Distribution: Debian unstable
Posts: 4

Original Poster
Rep: Reputation: 0

Last edited by mariusm; 11-06-2006 at 07:11 AM.
Old 11-05-2006, 12:44 PM   #5
LQ Newbie
Registered: Oct 2006
Location: Ohio
Distribution: Fedora Core 6
Posts: 5

Rep: Reputation: 0
Anyone have a howto to accomplish the opposite, boot a Linux physical disk/partition in VMWare from Windows?
Old 12-31-2006, 07:36 AM   #6
LQ Newbie
Registered: Dec 2006
Posts: 1

Rep: Reputation: 0
simpler way to install vmware tools


First thank you for a great article, it solved all my problems.

I just wanted to point out that once you have windows.iso on your linux box, instead of going through step 5 6 and 7 to copy the iso in the windows VM, you could edit your vmx file to point to the windows.iso. You need to replace this line :

ide1:0.filename = "windows.iso"

make sure the windows.iso file is in the same directory of your wmx file.
Boot your windows VM and open up "My computer" you should see your cd-rom "VMware Tools ( D: )" Double click on this icon and it will launch the setup.

There you go.

André Tessier
Old 01-01-2007, 11:15 PM   #7
Registered: Jun 2002
Location: Orange County, CA
Distribution: Debian (squeeze), kernel 2.6.30-2-amd64
Posts: 32

Rep: Reputation: 15
Linux is my primary OS. For years I've used a dual-boot system, with Win2000 and Debian. I just recently installed vmware server on my linux system, and now I'm running Win2000 in linux with minimal effort! Now I rarely find any reason to reboot at all. From what I've read on this post, running vmware server is MUCH easier than dealing with vmware player, although you have to have the Windows installation media at hand.
Old 01-25-2007, 05:59 AM   #8
LQ Newbie
Registered: Jul 2005
Distribution: Debian unstable
Posts: 4

Original Poster
Rep: Reputation: 0
you don't want to do that...

Originally Posted by ninevoltz
Anyone have a howto to accomplish the opposite, boot a Linux physical disk/partition in VMWare from Windows?
just look for example here, how I tried to install SP1 for Visual Studio 2005:

Do you understand what proprietary OS can do to you?

You simply don't want to run anything on Windows, not even VMware, trust me.
Old 05-11-2007, 01:29 PM   #9
LQ Newbie
Registered: Jun 2006
Posts: 4

Rep: Reputation: 0
Thanks a lot, wanted to do this for a while already!
Old 06-07-2008, 05:59 PM   #10
Registered: Aug 2004
Location: London, UK
Distribution: Ubuntu 10.10, ubuntu 11.04, suse 9.2, OSX
Posts: 259

Rep: Reputation: 30
seriously rocks. One thing thou the link under creating a virtual machine doesn't work anymore . But I guess I can just copy and paste the files.
One thing which would be a nice update is to have explaination for multiple hard drives and for sda instead of hda. If it all works i'll post my updates
Once this is up and working I think I might reach computing heaven

Last edited by PB0711; 06-07-2008 at 06:18 PM.
Old 02-13-2012, 09:28 AM   #11
Criminal Bizzy
LQ Newbie
Registered: Feb 2012
Posts: 1

Rep: Reputation: Disabled
Flexible Distributions

I am looking into creating a virtual Windows machine on Linux. So far the only real choices that I have are KVM, Virtualbox OSE, or this VMware hack that you have posted. My question to you is how flexible is this method to multiple distributions? Have you tried this on more than one distro with the same partition or do I have to go through this again every time I decide to change my distro?
Old 03-01-2012, 09:13 AM   #12
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,352
Blog Entries: 4

Rep: Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334Reputation: 3334
I suggest but three things:
  1. When you purchase a computer, immediately buy a retail copy of the operating system at the same time. Wipe the drive and install the retail version. You don't know what the vendor might have put on the box, and you can't change it, and you can't recreate it. In other words, "useless." Windows is over-priced, yes, but maybe not outrageously so. Carefully select the features that you actually need. Set up passwords and limited-user accounts according to best practices.
  2. Full versions of VMWare are inexpensive, and well worth the expense. They can be hosted by any operating system, and since the actual magic is being done by the microprocessor itself, all hosts are more or less equally efficient. The simplest scenario will have Windows as the host-OS ... why not?
  3. External hard-drives with either USB 2.0 or FireWire connections are also inexpensive now, and again, well worth the expense. Use an external drive to be the guest operating systems' system residence volume. (Hey, I might be an old VM/XA mainframer at heart, but I didn't say SYSRES or DASD, now did I?)
My two-cents here is that there are many times when "free" really isn't worth it. If you give value to your own time and to your own present and future flexibility with regard to managing your own system, "free" can rapidly turn into the most expensive proposition. Give the Devils their due. Fair is fair.

Last edited by sundialsvcs; 03-01-2012 at 09:19 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: LINUX ALTERNATIVES HOWTO krishvij LinuxAnswers Discussion 2 03-03-2009 05:41 PM
DISCUSSION: Linux GPRS howto XavierP LinuxAnswers Discussion 2 02-25-2007 11:11 AM
Free VMware Player oblivious69 General 3 10-31-2005 03:48 AM
Run all windows software VMware 5 beta free AwesomeMachine Linux - Software 4 02-02-2005 10:45 PM
Can Windows Media Player run on linux? njschroe Linux - Software 25 12-03-2004 11:50 PM > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion

All times are GMT -5. The time now is 03:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration