Never reboot linux again? Run your existing Windows install in Linux!
I promised before that I would do a write up of a simple way to run an existing install of Windows XP from within Linux. Many people run a virtual Windows install from within Linux which is pretty good but is sometimes a burden if you have an existing physical Windows install because you now have 3 operating systems that you need to move files across and most people want access to the same programs and settings in their virtual install of Windows as they have in their physical install. The process I outline below will be useful for Linux users that have an existing dual-boot setup and want the capability to access their existing Windows OS without having to go through the tedious reboot process.
As an engineering student using Linux, I have realized that some of the programs I need to use like Maple, Matlab, SolidWorks, etc. (I will show you some good alternatives to Maple and Matlab in a later post) are not available for use in Linux. This became quite annoying when I was constantly rebooting my computer and switching OSes. One solution to my problem was to create a virtual copy of Windows XP. I didn’t like this idea because it would require wasting double the hard drive space that the Windows OS files need, reinstalling all the software I need and configuring everything to the right settings. So I began searching for ways to virtualize an existing Windows partition and came across this site: Blackmh. Although this guide provides a lot of useful information for getting started, it did not work on my laptop (might work on yours) . Additionally, I figured many users don’t want to mess with figuring out the location of cylinder heads and what not, so I put together this guide that will help you quickly and easily setup your system.
1. Installing VMware:
The easiest way to do this is by using the Automatix installer. If you haven’t already installed Automatix, download and install it from here: Get Automatix, the install is very straight forward. Once, you have Automatix installed, run it and go to the Virtualization category. Here you want to select VMware Server and hit install and Automatix will take care of the rest.
2. Configuring VMware:
You need to run VMware as root so in the terminal window type:
You will now be prompted with the VMware Server Console. Make sure that “Local host” is selected and choose “Connect”. For easy setup, use the Virtual Machine Wizard by clicking on “Create a new virtual machine” and going through the following steps:
- Custom, Next
- Microsoft Windows (Choose Version, I use XP Professional), Next
- Choose a name and location, the default values are fine, Next
- For Processor Configuration I chose One Processor so that one core would be dedicated to each OS during virtualization, you can change this later. Next
- Access Rights did not make a difference, I did not make my machine private. Next
- Specify the amount of memory you want to allocate to the Guest OS. I dedicated half my memory, 512MB. However, when running simulations or using apps like SolidWorks it feels very slow so I plan to pickup 2GB after work tomorrow. Next
- For your Network Connection I recommend you use NAT (network address translation). This will be the easiest configuration since you will be sharing the same connection among both OSes. Bridged will allow each OS to use a separate connection but requires further configuration that I will not get into here. Next
- Choose BusLogic as your SCSI adapter. Next
- Choose “Use a physical disk”, Next
- Your “Device” should be the main disk that contains both your Linux partition and your Windows partition. Select “Use individual partitions”. Next
- Here select both your linux and windows partition (swap isn’t needed). Your linux partition is needed since only the first stage of GRUB resides on the MBR and GRUB will try to access your linux partition to load stage 2. Next
- Choose a Disk Filename, the default is fine. Finish
3. Configuring Windows
Before starting up your virtual machine follow these steps, I copied them from Blackmh’s site:
"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."
While you are in Windows I recommend you install the SCSI drivers for the virtual SCSI controller that VMware uses. This is necessary because VMware acts as a virtual computer with virtual hardware. Windows has the drivers it needs to operate on your system but by running it in VMware you are virtually unplugging your HD and plugging it into a computer with different hardware specs. This can pose a problem when Windows can not find drivers to access the HD (since VMware uses a SCSI controller) and you will be presented with a BSOD error 0×0000007 on startup. You can either follow the Microsoft Knowledge Base article and try to work around this problem (I’ve seen little success) or you can follow my method:
- Download the VMware Server SCSI floppy image (I’ve extracted the files into a ZIP if you don’t have a floppy drive)
- I made a video of the driver install process that you can follow:
Installing VMWare SCSI Drivers
Click “Next” and “Finish” where the video leaves off.
Now reboot into Linux.
4. Getting ready to run the Virtual Machine
Launch VMware as root as explained above and choose local host. There should be a tab for the virtual machine you created earlier, select it.
VERY VERY IMPORTANT: Before running your virtual machine, ensure that your GRUB timeout is not set to zero. You can change the timeout by accessing /boot/grub/menu.lst and increasing the “timeout” value. Refer to my post on the GRUB Menu for more information. If you leave this value as zero, it is very likely that GRUB will automatically run Linux when you first start up. You should ***NEVER VIRTUALIZE YOUR CURRENT LINUX INSTALLATION***. This will corrupt your linux install and make it unusable. With that said, I will show you a way to avoid the GRUB menu all together later in this post.
Once you have ensured that your timeout is not set to zero and GRUB will give you time to choose the OS you want to boot go ahead and click “Power on this virtual machine”. The console screen should open up and you will see your computer booting up. Once this is done the GRUB menu should load and you can choose your Windows install that you want to boot.
At this point you will either be given a choice of which hardware profile you want to boot into (choose VMware) or your screen will hang at “Starting up…”. In my case it hangs at starting up. This had to do with the location that the windows boot files are located on your hard drive and the fact that GRUB did not point to the correct location.
Don’t worry there is a solution that I recommend, even for users who can successfully boot into Windows. Reboot your computer into Windows and use your Windows install CD to make a boot CD image. If you don’t know how to do this, google it, there are many guides explaining it. However, if you are using Windows XP Pro (may work for home), I have a boot disk image that you can download. Save this file to disk and note where you saved it.
Now in VMware you should be at the virtual OS summary screen. Towards the middle right you should see “Devices”. Double click on CD-ROM and under connection change the setting to “Use ISO image”. Click “Browse” and select the file you just downloaded or the boot image you made yourself and click OK. At this point, if your BIOS is setup to boot the CD first before any other device, VMware should automatically boot windows and never even enter the GRUB menu, saving you from accidentally booting your current Linux OS. If your BIOS is not setup to do this, Google how to do this for your specific computer.
You should now be good to go. You can power on your virtual machine and Windows should boot by default. Select the VMware hardware profile and the first time you run windows you may be asked to reactivate Windows. This is because Windows has detected your hardware having changed (VMware’s virtual hardware). The activation process is very simple and straight forward and you should not be asked to activate again when you do a physical reboot into Windows. The first time you login you will be bombarded by “Found New Hardware” screens. Ignore these and just run the VMware tools you downloaded earlier. Perform a virtual reboot and all your virtual hardware will be detected.
You can now use your existing Windows install from within Linux!
Here are a few screenshots of Windows running in Linux:
OS & Browser Detect page shows WinXP & IE7:
Beryl & VMware:
SolidWorks Running in Linux (emulated):
If you have any questions you can post a comment. I will do my best to answer them.
WARNING: I am in no way a computer engineer, the guide provided here is intended for people who know what they are doing, don’t blame me if something gets messed up.
With that said, I think the best way to learn is to backup any important data you have and not be afraid of having to reinstall the OS as long as you achieve your goal and learn something at the end of the day. This guide worked on a Thinkpad X60.
Filed under: dual boot, linux, ubuntu, virtualization, vmware, windows | 104 Comments