Howto: Windows XP in both VM and native - DISCUSSION

Discussions about using Windows guests in VirtualBox.
darose
Posts: 12
Joined: 23. Oct 2007, 23:08

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by darose »

jss wrote:Hello, please read my posts http://www.virtualbox.org/ticket/2784#comment:5

I've just done it. I now have my preinstalled windows XP with SLP running virtualized on VB hosted by my ASUS A8Js with Ubuntu 9.10 without asking for activation. And both versions work, meaning, a P2V or a new installation.
...
Enjoy,
jss
Thanks much for the pointer, jss. Much appreciated! It sounds a bit complicated, but I'll see if I can get it to work.

Just wondering, though: how do I find out what string in the BIOS (and where in the BIOS memory) is required for my machine? (A Dell Precision 4400M)

Thanks again,

DR
jss
Posts: 17
Joined: 4. Mar 2010, 13:20
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: windows xp

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by jss »

@darose
Be patient, my friend. Let's take one step at a time. So, roadmap will be:
1. Find out which set of oembios files your PC uses (brand and CRC)
2. From a repository on the net, find out which SLP string you need in VB bios and in what memory area
4. Check that this string actually exists in your PC bios and inside the above area
5. Insert this string in VB bios (VBoxDD.so)
6. Now VB can run your P2V of wxp; but making this P2V is another story, specially if you want to run it from a physical partition (raw disk) as I did in the beginning, to ensure an eventual go back to windows, which fortunately was not necessary.

So
1a. download http://forums.mydigitallife.info/attach ... 1264333128
1b. boot your wxppro OS physically
1c. unpack the above file to a folder of your taste
1d. open a Command Prompt in this folder, or cd to it
1e. run OEMBIOS.EXE
1f. post the result here

This is all for now; next, we'll proceed to step 2 by searching your files in http://www.oembios.net/
jss
darose
Posts: 12
Joined: 23. Oct 2007, 23:08

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by darose »

jss wrote:@darose
Be patient, my friend. Let's take one step at a time. So, roadmap will be:
Thanks much for the help, but I found a big workaround for this problem, and I think I'm just going to take that. I happen to have another Windows install disk at home - which is not SLP - and was able to install and activate that under VBox.

I really just need access to *some* Windows installation under VB & Linux, but it doesn't have to be the one on my Windows partition. So I think problem solved ... by avoiding the problem! :-)

Thanks again,

DR
ilovekiruna
Posts: 1
Joined: 22. Mar 2010, 07:51
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows XP

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by ilovekiruna »

Hi terry, hi jss,
thanks for your help on making windows xp run on laptops with slp native and in VBox.

I face a similar problem compared to darose. Unfortunately I can't avoid it like darose by installing windows xp in another partition.
I need the windows from native partition. My computer is a DELL Precision M6300 laptop with pre-installed windows xp and Kubuntu 9.10. So I guess
it also uses SLP. Luckily windows xp is already booting completely. The only problem still missing seems to be the activation.

@jss Can you please help me completing the steps you told darose?

I think it might be also interesting for others facing the problem to read the complete solution.

The output of OEMBIOS.EXE is

Code: Select all

Windows XP OEMBIOS Test v1.1/269/106 (C) 2007-2010 severach @ msfn forums
F:Dell System OEMBIOS.CAT CRC=63875D1F
F:Dell System OEMBIOS.CAT CRC=B6F0EEFD
These Royalty OEM install CD's should preactivate (SLP) on your system.
Lines starting with E: are not reliably detected when running under Windows
Press Enter!
ERRORLEVEL 1
From oembios.net I found:
For 63875D1F: It seems to be invalid as it is crossed out.
For B6F0EEFD: The strings mentioned are: "Dell System", "Dell Computer", "Dell System", "Dell System", "Dell Inc"

Now I have no idea how to proceed with the steps you mentioned, for example how to find the memory areas of the SLP string.

I hope I mentioned everything that is important.

Thanks a lot for your help,

Patrick
lambart.dennis12
Posts: 1
Joined: 1. Apr 2010, 12:05
Primary OS: MS Windows 7
VBox Version: OSE Debian
Guest OSses: Windows 7

Re: Howto: Windows XP in both VM and native

Post by lambart.dennis12 »

I am new to virtual machines, so I have a few [read: a lot of] questions:

What kind of performance can you get out of a virtual machine? Can anyone link to some benchmarks comparing a virtual machine running Windows 7 to a native Windows 7 machine? I've googled, but found nothing useful.

What hardware components factor into virtual machine performance? Does more RAM improve VM performance? How about GPUs?

Can you run autoCAD or Adobe CS4 in a virtual machine and actually be able to use the programs and all their features?

For a business computer that needed to run autoCAD or Adobe CS4, what VM program would be the best if price were not the issue?
642-845 and 642-736 exam notes 642-611 and 642-504
austinmarton
Posts: 2
Joined: 2. May 2010, 00:39
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows 7

Re: Howto: Windows XP in both VM and native

Post by austinmarton »

Hello,

I am new to virtualbox. I am running the latest release of Ubuntu (Lucid Lynx). I have a dual boot with Windows7, I would like to run Windows 7 inside Ubuntu and maintain the ability to boot natively. I note it was a couple of years since this thread started, has anyone done this with Windows 7 yet?

Thanks,
Austin.
brunojcm
Posts: 5
Joined: 18. Jun 2009, 15:23
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: Windows XP

Re: Howto: Windows XP in both VM and native

Post by brunojcm »

I would love to do it too!
pedrogfrancisco
Posts: 10
Joined: 6. Jun 2010, 12:23
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by pedrogfrancisco »

Hi!
Windows 7 users:
What fails when you boot natively a guest machine with Virtual Box Additions installed?

Personally, "VBoxMouse" mouse filter will pull my mouse to left corner and won't give up doing it.

Besides that, everything else works.

I'm thinking editing HKLM/System/ControlSet001/ prior to booting the VM and adding the VBoxMouse filter and afterwards removing it. I believe it's the best thing to be done since Hardware Profiles don't work and, according to what I've snooped around in registry, don't really have a thing to say in terms of hardware like mouse, unless it's associating itself with one of the ControlSet and I'm missing such association.

Ideas? Opinions?

P.S.: if VBoxMouse would give up doing what it is doing after, I don't know, 10000 tries or something, that would be nice as well ;)
P.S. n.º 2: apparently regsetdword only edits, as its name says, DWORD value. I need to edit a string value to change the mouse filters list...
ahznb
Posts: 64
Joined: 7. Feb 2010, 13:39
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Win98, XP, Win7, Ubuntu

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by ahznb »

What type of mouse are you using? Does it need non-generic drivers?

I have a perfectly working dual boot Win 7, without the need to setup hardware profiles (it doesn't work anyway). I even have the 3.2.2 GA installed. Win 7 saves all the drivers that was ever detected, and loads them accordingly. But I have to swap in different BCDs for native and VM, because I have grub in the physical mbr, and I use a virtual mbr for the VM.

> P.S. n.º 2: apparently regsetdword only edits, as its name says, DWORD value. I need to edit a string value to change the mouse filters list...

Use reged in chntpw (http://pogostick.net/~pnh/ntpasswd/).
pedrogfrancisco
Posts: 10
Joined: 6. Jun 2010, 12:23
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by pedrogfrancisco »

ahznb wrote:What type of mouse are you using? Does it need non-generic drivers?
Normal mouse, Microsoft USB mouse. I'm guessing GA adds a mouse filter for the integration with the host OS and thus on a native run the mouse goes haywire because it doesn't receive "outside" input.
ahznb wrote: I have a perfectly working dual boot Win 7, without the need to setup hardware profiles (it doesn't work anyway). I even have the 3.2.2 GA installed. Win 7 saves all the drivers that was ever detected, and loads them accordingly. But I have to swap in different BCDs for native and VM, because I have grub in the physical mbr, and I use a virtual mbr for the VM.
Weird, I don't need two BCD, have you tried following my wonderful instructions (unbiased review ;) ) on how to copy your current MBR and fixing it with Windows CD thus having a Windows bootloader with an up do date partition info? HOWTO: Windows 7: In both VM and native
ahznb
Posts: 64
Joined: 7. Feb 2010, 13:39
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Win98, XP, Win7, Ubuntu

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by ahznb »

pedrogfrancisco wrote: Weird, I don't need two BCD, have you tried following my wonderful instructions (unbiased review ;) ) on how to copy your current MBR and fixing it with Windows CD thus having a Windows bootloader with an up do date partition info? HOWTO: Windows 7: In both VM and native
My virtual mbr (for the VM) is copied directly from a working Win7 mbr, and it has the same exact partition table as the physical mbr. But I want grub in the physical mbr, I like it better than Win crap mbr. But before swapping BCDs, every time I switch between native and VM, bootmgr complains that the boot device is unavailable and does its own repairs to the BCD to make it boot. My simple solution was to just use different BCDs.

I have a another Win7 dual boot happening that doesn't require swapping BCDs. But that Win7 partition is on another HD, so I don't need a different virtual mbr for the VM, and using the same BCD works for both types of boot.

Also, I don't use IO APIC in the VM. Win7 will detect a hal change when switching between VM and native or vice versa, and it automatically change the drivers, and ask for a reboot. But I simply cancel that dialog and continue with my work.
pedrogfrancisco wrote: Normal mouse, Microsoft USB mouse. I'm guessing GA adds a mouse filter for the integration with the host OS and thus on a native run the mouse goes haywire because it doesn't receive "outside" input.
It could be a bios problem. Both my Win7 dual boots have GA installed, and works without problems.
pedrogfrancisco
Posts: 10
Joined: 6. Jun 2010, 12:23
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: Windows

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by pedrogfrancisco »

Weird... Tried again now and it is working with no further hacks O_o (I updated VBox in the meanwhile, but the changelog doesn't mention VBoxAdditions updates)...
Jsewill
Posts: 2
Joined: 22. Mar 2008, 10:25

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by Jsewill »

This is my first post on this forum. Feel free to use this information to update the thread here: http://forum.virtualbox.org/viewtopic.php?f=2&t=9697. I want to share my success in running windows 7 using this guide, which I adapted slightly to run Windows 7. I am running windows 7 natively and using virtualbox (raw VMDK) on an ubuntu 9.10 host. No activation issues (thanks to the DMI bios section of this guide)! I no longer need to use the repair disk, as I have adapted the shell script calling regsetdword.

The reason windows repair is required to boot when switching from native to VM and vice-versa, is that windows 7 BCD keeps track of partitions by UUID. When one is missing (because VirtualBox reports different UUIDs to the guest OS than the actual UUIDs), windows won't boot. My solution is to add statements to the aforementioned script that move the current /Boot/BCD (I start with native) to /Boot/BCD.2 (the "2" is my native hardware profile identifier) and mv the /Boot/BCD.1 (my VM profile identifier) to /Boot/BCD.

I am assuming you have created your VMDK and virtual machine according to this guide, and that you've followed the Virtual Machine Configuration (especially DMI Bios) and Vista sections. If not, please do so now. Let's begin.

FYI: Windows repair backs up the BCD file it is about to replace, then replaces it with the more applicable BCD file (for whatever environment you're booting VM or Natively).
Assuming you have most recently booted into Windows 7 natively, mount the windows partition and move the most recent backup BCD.backup.X (X being the highest numbered file you can find) to BCD.N (N being the corresponding VM Hardware profile number, mine is 1). Once this is complete, use the script below instead of the one Supplied in the Vista section (or cut and paste applicable portions into it). Also, please modify it according to your configuration (Partition, mount point, hardware profiles, etc.).

My custom portion:

Code: Select all

#This code belongs within the setHwProfile funtion
  mv $VISTA_MOUNT/Boot/BCD $VISTA_MOUNT/Boot/BCD.$2
  mv $VISTA_MOUNT/Boot/BCD.$1 $VISTA_MOUNT/Boot/BCD
Full script:

Code: Select all

#! /bin/bash

VISTA_VM=Win7Raw
VISTA_PARTITION=/dev/sda2
VISTA_MOUNT=/media/test
HIVE_PATH=/Windows/System32/config
HWPROFILEKEY=ControlSet001\\Control\\IDConfigDB\\CurrentConfig
HWPROFILEVM=1     # VM hardware profile number
HWPROFILENATIVE=2 # Native hardware profile number

setHwProfile() {
  sudo umount $VISTA_MOUNT
  sudo mount -t ntfs-3g -o rw $VISTA_PARTITION $VISTA_MOUNT
  mv $VISTA_MOUNT/Boot/BCD $VISTA_MOUNT/Boot/BCD.$2
  mv $VISTA_MOUNT/Boot/BCD.$1 $VISTA_MOUNT/Boot/BCD
  /usr/sbin/regsetdword -f $VISTA_MOUNT/$HIVE_PATH/SYSTEM $HWPROFILEKEY $1
  sleep 1
  sudo umount $VISTA_MOUNT
  sudo mount -t ntfs-3g -o ro $VISTA_PARTITION $VISTA_MOUNT
}

setHwProfile $HWPROFILEVM $HWPROFILENATIVE
/usr/bin/VirtualBox -startvm $VISTA_VM
setHwProfile $HWPROFILENATIVE $HWPROFILEVM
ahznb
Posts: 64
Joined: 7. Feb 2010, 13:39
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Win98, XP, Win7, Ubuntu

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by ahznb »

You don't need to create hardware profiles for dual booting Win7, it doesn't work anyway. For you, just swapping the BCDs should be enough to boot both. No need to modify registry or use regsetdword.

Also, as previous posters have experienced, some configurations don't even need to swap BCDs at all. Your making booting Win7 native/VM overly complicated.
mkylman
Posts: 1
Joined: 12. Feb 2011, 19:51
Primary OS: Ubuntu other
VBox Version: OSE Debian
Guest OSses: Windows XP Pro(from physical partition), Windows Server 2008

Re: Howto: Windows XP in both VM and native - DISCUSSION

Post by mkylman »

In Windows XP there's also startup entries in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run, so you might want to add a note about that. I found this by just running msconfig and saw where all(or most) of the startup programs' startup entries were in the registry, and I imagine that the above location is for programs like Steam and that startup for certain users.

Otherwise, I found this guide to be great! I initially followed a guide I found in the Ubuntu forums and was having a LOT of issues, somehow I found a link to this thread and things went much more smoothly.

I had an issue with the SATA section, since after I followed the instructions and switched my drives over to SATA I got XP to boot in VB once and it was great! My CPU usage was even more stable with way less spikes to 100%. I then tested a native boot to ensure everything was still fine, which it was. However when returning to Ubuntu 10.10 and trying it again in VB I found that my desktop refused to show. After trying a few things, I wound up switching the drives back to IDE just in a "I wonder what this'll do" kind of sense, and it worked. So, I guess I'd also like to ask if that was a common error that people were running into and if there were any workarounds.
Post Reply