Running Windows XP under linux with Vmware player
In this tutorial I will show you how to run Windows XP under linux with the free Vmware player. With slight modifications you can use this the other way around, to run linux under Windows if you would like to try it out, but aren't ready to format your drive.Background
I started looking into ways to run Windows as a virtual machine under linux, as I sometimes needed it and had a license for it that came with the computer, and really hated to reboot just to get to windows. The following setup has worked fine for my use, but I haven't tested it with any really demanding programs, so I can't tell you how the performance is for that. But for using IE to test out webpages and other light stuff it works fine.Step one, installing Vmware Player
The first thing you need to do is install the vmware player from vmware.com. I grabbed the rpm version as SuSE uses rpms to manage packages, if your distro doesn't grab the tar. I'll only explain how to install from the rpm, but the tar should be pretty straight forward aswell, just follow the instructions by vmware. And if you're running windows, grab the windows installer ofcourse and click next a few times.After downloading the rpm open up a console and type the following:
sudo rpm -ivh VMware-player-1.0.1-19317.i386.rpmSidenote: for a cool and really handy console, check out yakuake, once you've tried it you can't live without it!
Now that we have the player installed, we need to configure it. While still in the console, type in:
sudo /usr/bin/vmware-config.plThen answer the questions, if vmware doesn't come with a module for your exact kernel it will bild one. It needs gcc (a compiler) which you can install from YaST if you're running SuSE.
Note, this will fail on SuSE 10.1. I found the following workaround here:
Go to /usr/lib/vmware/modules/source. There you'll find two tar files, extract them. In both the tar files you will find a Makefile.kernel file, you need to modify them with a text editor and add -DKBUILD_BASENAME=\"$(DRIVER)\" \ after -Iinclude2/asm/mach-default. Then tar the folders back and replace the old ones and it should work.
Incase you're lazy and just want it to work you can just use the ones I made. Replace the ones in /usr/lib/vmware/modules/source.
vmmon.tar
vmnet.tar
When you're finished with that you should have a functioning vmware player you can run by typing in 'vmware' in a console. But there's still a few things we need to do to actually install an operating system onto it.
The good part - installing the OS
For this we'll need a few things. Head over to linux.wolphnation.com and grab OS.zip. Extract it to some directory where you would like to keep your operating system, I chose /home/marcus/windows for it. Now open up OS.vmx in your text editor of choice and make changes if necessary. Below is my OS.vmx which I used to install windows from a cd. The original will enable you to install directly from a ISO file, which can be easier especially if you've downloaded a linux distro. But since I had my windows on a cd I made some changes to the file:#!/usr/bin/vmware
config.version = "8"
virtualHW.version = "3"
memsize = "512"
ide0:0.present = "TRUE"
ide0:0.fileName = "OS.vmdk"
ide1:0.present = "TRUE"
ide1:0.fileName = "auto detect"
ide1:0.deviceType = "cdrom-raw"
ethernet0.present = "TRUE"
ethernet0.connectionType = "nat"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Windows XP Pro"
guestOS = "winxppro"
nvram = "testos.nvram"
scsi0:0.redo = ""
ethernet0.addressType = "generated"
uuid.location = "56 4d e3 34 1c ea 98 dd-17 ed 18 a3 71 a3 15 8e"
uuid.bios = "56 4d e3 34 1c ea 98 dd-17 ed 18 a3 71 a3 15 8e"
ide1:0.autodetect = "TRUE"
ethernet0.generatedAddress = "00:0c:29:a3:15:8e"
ethernet0.generatedAddressOffset = "0"
checkpoint.vmState = "OS.vmss"
tools.remindInstall = "TRUE"
ide0:0.redo = ""
uuid.action = "create"
usb.autoConnect.device0 = ""
The important lines are memsize, ide1: and guestOS. Memsize is the amount of ram you want the virtual machine to have, the ide1: is used to access the cd-drive and the guestOS tells vmware what operating system you're planning to run on the player. Valid guestOS values are:
"dos"--DOS
"freebsd"--Generic FreeBSD distribution
"netware6"--Netware 6
"other24xlinux"--Generic distribution with the Linux 2.4.x kernel
"other26xlinux"--Generic distribution with the Linux 2.6.x kernel
"otherlinux"--Generic distribution with the Linux kernel
"redhat"--Red Hat Linux
"solaris10"--Solaris 10
"suse"--SUSE Linux
"win95"--Windows 95
"win98"--Windows 98
"winme"--Windows ME
"winnt"--Windows NT
"winnetstandard"--Windows Server 2003
"winxphome"--Windows XP Home
"winxppro"--Windows XP Professional
Once you have edited the file to your liking save it and fire up vmplayer. When it asks for a virtual machine, point it to the .vmx file you just edited. Be sure to have the cd in the drive if you're installing from cd and hit open.
Now the virtual machine will boot and you can install the operating system as usual. Once installed, you should be able to use it as you would normally use windows. To get the vmware window to release the mouse back to linux press ctrl and alt simultaneously.
If you close the vmware window with windows still running vmware will suspend it and resume it when you open it again. You may also power down windows as usual if you want.
Moving files
Moving files to and from the virtual machine can be a bit difficult since they are two different machines as far as they're concerned. A way to make file transfer pretty easy is to first enable file sharing on the windows machine and share a folder like my documents. Then in linux install smb4k, which is a windows share browser. To be able to mount the windows share as a user you will have to first type in the following in a consolechmod +s /usr/bin/smbmntThen, open up smb4k, go to shares->mount manually. In the share box write "//hostname/sharename", in my case the hostname I set up during install was marcus-laptop and the share name was md so in my example I wrote "//marcus-laptop/md". In the ip field write whatever ip-address your windows machine gives you and for the workgroup whatever you set it up to be when you installed. You can check this under control panel>system if unsure.
Now if all goes well you should be able to mount the windows share and access it under ~/smb4k/sharename just like any other folder.
Note! For this to work your windows virtual machine must be turned on.
If you prefer doing this from the console make a directory where you would like to mount your share, and then type in the following in a console:
sudo smbmount //ip-address/sharename /path/to/mount/directory
And there you go.
Post install
Now that we have it installed I still want to do a few things. First off, I want a desktop shortcut directly to my windows virtual machine so I don't have to search the .vmx file every time I want to run windows. To do this in KDE right-click on the desktop and choose 'create new'-> 'link to application'. In the first tab you can choose a name for the shortcut and a icon. In the application tab do the following:

The command line is
vmplayer /home/marcus/windows/OS.vmx
So now all I have to do to run windows is click on an icon, sure beats booting, huh?
Questions, comments? Post them in the forum.
Observations
A few things I've observed while using this setup:You have to manually "repair" the network connection in windows when resuming a virtual machine. Rightclick and select repair on the network icon in the system tray to fix.
USB only works in 1.1 mode, not very good for transferring large files, a small problem perhaps in conjunction with the next problem.
Since it's a virtual machine, there isn't really a way of moving files from one to another exept a external drive or a ftp server. I'll look into this and post an update. --fixed
Still haven't figured out how to get my ipod to work with this, probably due to the USB limitation. Haven't put that much effort into this yet, I'm sure I could get it working with a little bit of hacking. I'll post details if/when I get it to work.
One windows patch refuses to install for some reason, all others worked fine except this one. No idea why.
Tried vatching a video on the virtual machine, the video was a bit laggy and processor usage went up to about 45% for windowed mode and 60% for fullscreen. Not such a big deal, since it really doesn't make any sense to watch a video on a virtual machine anyway.
Refrences
linux.wolphnation.com - the inspiration for trying to run windows under linuxScreenshot
