Howto: Windows XP in both VM and native - DISCUSSION

Discussions about using Windows guests in VirtualBox.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Sorry, but no :-(
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
nw60312
Posts: 8
Joined: 9. Nov 2008, 05:48

Stuck at 'Starting up ...'

Post by nw60312 »

Hello - got the VB version running and now trying to boot natively. It hangs 10+ minutes at the text Starting up ... screen. No chance to select HW profile or boot.ini option. Any suggestions to get past this?

Thanks!

-Nate
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Difficult to help without more info. This sounds like a timeout issue. You say this is with you bare metal boot? Is your VM boot OK? Remember that you do need to match your NT kernel to your bare H/W, e.g. you want to boot an SMP kernel on a multi-core CPU. Also try booting in safe mode with diagnostics to get a better idea of where you are hanging.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
nw60312
Posts: 8
Joined: 9. Nov 2008, 05:48

More details...

Post by nw60312 »

Hello - Did some more digging. Was a grub error. Regardless I started over, but now ran into a new set of problems.

I can create a new guest instance of XP mounted to vdi on the filesystem. Installs and runs fine. I can no longer get a raw disk to work, it installs, but when XP restarts to finish the install it won't boot, invalid boot.ini.

Code: Select all

fdisk -l emits this partition setup

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       18102   145404283+   7  HPFS/NTFS
/dev/sda2           18103       36481   147629317+   5  Extended
/dev/sda5           18103       19075     7815591   82  Linux swap / Solaris
/dev/sda6           19076       34049   120278623+  83  Linux
/dev/sda7           34050       36481    19535008+  83  Linux

I have RW access (I am pretty sure) to /dev/sda & /dev/sda1. I tried creating the vmdk both with and without a fake mbr file but both didn't change the outcome.

Code: Select all

VBoxManage internalcommands createrawvmdk -filename /home/home/.VirtualBox/Disks/rawDiskXP.vmdk -rawdisk /dev/sda -partitions 1  -relative 
Host is Ubuntu 8.10 64bit VB 2.0.4 non-ose version.

Any suggestions?

Thanks!
davelbarton
Posts: 17
Joined: 14. Nov 2008, 01:16
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows XP

Re: More details...

Post by davelbarton »

nw60312 wrote:Hello - Did some more digging. Was a grub error. Regardless I started over, but now ran into a new set of problems.
I beg you, what kind of grub error and how did you fix it? I'm stuck now on the same error you described before: I did a script with all the DMI installation commands, and when I try to boot Windows as a guest from Linux, I get the same kind of error:

Code: Select all

Configuration error: Querying "DmiSystemVersion" as a string failed.
VBox status code: -2107 (VERR_CFGM_NOT_STRING).

Result Code: 
NS_ERROR_FAILURE (0x80004005)
Component: 
Console
Interface: 
IConsole {e3c6d4a1-a935-47ca-b16d-f9e9c496e53e}
So how can I fix the grub error? Or whatever error it is?
nw60312
Posts: 8
Joined: 9. Nov 2008, 05:48

Grub error...

Post by nw60312 »

Grub would not start the windows boot loader. Different problem from what you have. I have same error as well, I have not been able to get around that one either, for now I just had to leave it blank. I have not tried activation yet.

-Nate
davelbarton
Posts: 17
Joined: 14. Nov 2008, 01:16
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows XP

Re: Grub error...

Post by davelbarton »

nw60312 wrote:Grub would not start the windows boot loader. Different problem from what you have. I have same error as well, I have not been able to get around that one either, for now I just had to leave it blank. I have not tried activation yet.
Then I throw myself upon the mercy of the group. Help! My dmiset script is as follows:

Code: Select all

#! /bin/bash
VMNAME="WinXP"                            # Name of the virtual machine
VSETED="VBoxManage setextradata $VMNAME"  # The command to set data
CFGPATH="VBoxInternal/Devices/pcbios/0/Config"
$VSETED $CFGPATH/DmiBIOSVendor         "Hewlett-Packard"
$VSETED $CFGPATH/DmiBIOSVersion        "F.21"
$VSETED $CFGPATH/DmiBIOSReleaseDate    "07/18/2008"
$VSETED $CFGPATH/DmiBIOSReleaseMajor   "2"
$VSETED $CFGPATH/DmiBIOSReleaseMinor   "4"
$VSETED $CFGPATH/DmiBIOSFirmwareMajor  "2"
$VSETED $CFGPATH/DmiBIOSFirmwareMinor  "4"
$VSETED $CFGPATH/DmiSystemVendor       "Hwelett-Packard"
$VSETED $CFGPATH/DmiSystemProduct      "HP Pavilion dv7 Notebook PC"
$VSETED $CFGPATH/DmiSystemVersion      "1"
$VSETED $CFGPATH/DmiSystemUuid         "8A7688D1-8A6F-11DD-8155-001EECB74F5D"
$VSETED $CFGPATH/DmiSystemFamily       "103C_5335KV"
As you can see, everything is a string (except I just noticed I misspelled "Hewlett"; I'll fix that). In particular, the system version is a numeric string. So what am I missing? Is my CFGPATH wrong?
nw60312
Posts: 8
Joined: 9. Nov 2008, 05:48

Post by nw60312 »

I think this is a bug, just found this:

http://www.virtualbox.org/ticket/2481

-Nate
nw60312
Posts: 8
Joined: 9. Nov 2008, 05:48

Getting further....

Post by nw60312 »

Hello - I hope I almost have it. I have both VM and native versions running. I am hitting the problem if Windows reinstalling the ACPI drivers when switching between VM and Native. Once you reboot back into the same profile it's fine until you switch again. It's almost like it's ignoring the HAL parameters in boot.ini. This is XP sp2 and here is the boot.ini:

Code: Select all

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Native" /execute /fastdetect /kernel=ntkrnlmp.exe /hal=halmacpi.dll
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Virtual" /execute /fastdetect /kernel=ntkrnlsp.exe /hal=halsp.dll
Any suggestions?

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SystemStartOptions look good.

If you drill into the DeviceManager \ Computer \ DriverDetails the driver files are always hal.dll ntoskrnl.exe regards of instance. Not sure if the dialog is broken or it really isn't booting off of the specified kernel and hal.

This is a quad core machine, as is reported by the system properties when running under VB. Could this have caused problems in the renaming of the HAL?

Thanks!
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

The NTldr tends to rename HALXXXX.dll to HAL.dll etc. You have to click on the properties to see its internal name. A real pain.

Also there is no point in your having the default line in your boot.ini since both boot options match multi(0)disk(0)rdisk(0)partition(1)\WINDOWS, so the boot loader will just pick the first which is the default anyway.

What I ended up doing was to in put a script wrapper around my VBoxSDL command which has a preamble and postamble. The preamble mounts the XP boot partition if not already mounted, swaps the activation files, boot.ini, HAL.DLL, ... for VM boot then umounts any of the partitions used in XP. It then starts VBoxSDL in my raw disk access service account. The postamble does the reverse, leaving it so that if I do a bare reboot, then I will go into the base XP configuration.

You still need two hardware profiles, and you must make sure that you select the correct one on boot up, but apart from this, it's all reasonably automated.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
nw60312
Posts: 8
Joined: 9. Nov 2008, 05:48

Ranamed HAL...

Post by nw60312 »

Hi - Any good way to check if it was renamed, other than delete the file and reboot? Since neither seems to booting off the correct hal, the driver reinstall each time, I thinking I should do the following:

1) Load & reboot the VB instance and then copy hal.dll to halsp.dll
2) Load & reboot the native instance and then copy hal.dll to halmacpi.dll

The aspect that is a little weird to me. When I start the VB instance after running natively, it finds the new ACPI hardware and installs the driver (I think this is directly related to the HAL being used?). It then asks for the reboot, after the reboot it no longer changes the acpi driver until you switch instances. If the hal specified in boot.ini isn't correct for the hardware, why does it work after the reboot? I would expect it to get stuck in a constant driver swap/reboot loop...

The recipe seems to imply that you don't need to script swapping the components out and changing boot.ini will handle it, is this not you experience? Todo this, do you know the correct single proc ACPI hal.dll file to grab out of the install CD?

Thanks!
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Hi, I documented the different HALs and NTkernels in a related topic so look that up. The reasons that I do it my way are
  1. I do refer to my NTFS partitions from Ubuntu, so they can get auto-mounted by Linux. You really don't want to boot XP from a partition that is already mounted in the host OS. This is pretty much a guaranteed way of trashing said partition(s). Hence the wrapper to guarantee integrity.
  2. By doing these swaps you have less key presses during startup, less startup errors and less change of picking an inconsistent set.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
nw60312
Posts: 8
Joined: 9. Nov 2008, 05:48

Giving it one last try

Post by nw60312 »

Hi Terry - Any scripts you would be willing to share? I am still running into the same problem. I started from scratch, XP SP3. When ever I switch between versions it has to reload the ACPI drivers.

After running VB restart the native instance, message found ACPI computer followed by, found new hardware multiproc ACPI. After a reboot back to the same instance all is well.

Boot back into VB, message found multiproc ACPI, followed by found new hardware ACPI. Again, after a reboot back to the same instance all is well.

Boot options look like this:

Code: Select all

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP (Native)" /noexecute=optin /fastdetect /kernel=ntkrnlmp.exe /hal=halmacpi.dll
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP (VM)" /noexecute=optin /fastdetect /kernel=ntkrnlsp.exe /hal=halsp.dll 
In halsp.dll, the original file name property is halacpi.dll which I believe is correct. Its like is has some old references to the acpi drivers that are not just setting the correct hal at boot?

I tried the script approach but still have the same problem, started from the script list for setting the hardware profile.

Code: Select all

#! /bin/bash

VISTA_VM=NativeXP
VISTA_PARTITION=/dev/sda1
VISTA_MOUNT=/mnt/rawXP
HIVE_PATH=/WINDOWS/system32/config
HWPROFILEKEY=ControlSet001\\Control\\IDConfigDB\\CurrentConfig
HWPROFILEVM=2     # VM hardware profile number
HWPROFILENATIVE=1


 # Native hardware profile number

setHwProfile() {
  sudo umount $VISTA_MOUNT
  sudo mount -t ntfs-3g -o rw $VISTA_PARTITION $VISTA_MOUNT
  #/usr/bin/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
}

setVMKernel() {
  sudo umount $VISTA_MOUNT
  sudo mount -t ntfs-3g -o rw $VISTA_PARTITION $VISTA_MOUNT
  
  rm $VISTA_MOUNT/WINDOWS/system32/hal.dll 
  rm $VISTA_MOUNT/WINDOWS/system32/ntoskrnl.exe 

  cp $VISTA_MOUNT/WINDOWS/system32/halsp.dll $VISTA_MOUNT/WINDOWS/system32/hal.dll
  cp $VISTA_MOUNT/WINDOWS/system32/ntkrnlsp.exe $VISTA_MOUNT/WINDOWS/system32/ntoskrnl.exe
	
  sleep 1
  sudo umount $VISTA_MOUNT

}

setNativeKernel() {
  sudo umount $VISTA_MOUNT
  sudo mount -t ntfs-3g -o rw $VISTA_PARTITION $VISTA_MOUNT

  rm $VISTA_MOUNT/WINDOWS/system32/hal.dll 
  rm $VISTA_MOUNT/WINDOWS/system32/ntoskrnl.exe 

  cp $VISTA_MOUNT/WINDOWS/system32/halmacpi.dll $VISTA_MOUNT/WINDOWS/system32/hal.dll
  cp $VISTA_MOUNT/WINDOWS/system32/ntkrnlmp.exe $VISTA_MOUNT/WINDOWS/system32/ntoskrnl.exe
  sleep 1
  sudo umount $VISTA_MOUNT

}

#setHwProfile $HWPROFILEVM
setVMKernel
/usr/bin/VirtualBox -startvm $VISTA_VM
setNativeKernel
#setHwProfile $HWPROFILENATIVE

Any suggestions as to what I am doing wrong?

Thanks!
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Sorry but I wasn't tracking Vkov's last set of changes, so I a little behind. The regsetdword utility is a bit of a find as this will remove the need for the manual profile select that I currently do. I was really confused about your naming conventions until ($VISTA... when your partition is XP) until I realised that you'd done a cut and paste from one of his vista scripts.

My problem is that I've got a lot on the go at the moment and I just don't have the bandwidth to pick this one up to sort it out. I have an XP laptop. My dual boot works, but to be honest I don't really need Windows OSs enough on my Linux boxes to devote a lot of time to this, other than to help answer Qs here. It's a Q of priorities and hours in the day :-(

Unfortunately Vkov went "on sabatical" at the beginning of this month so isn't around to do it either.

As far as my setup goes, I toggle between the ACPI non SMP and the ACPI SMP configurations. I also have a Run WSH script registered to start various stuff in the VM and I toggle this as well because I need to start different things in the two configurations (for example the M/B utilities and the video systray tool just error if I start them in the VM). My general comment about this scripts is the lack of state maintenance and error handling (as well the confusing naming conventions). I notice that it also doesn't toggle the activation files.

So sorry but maybe in a few weeks. Until then hopefully one of the other forum supporters can help :(
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
mrhobbeys
Posts: 43
Joined: 24. Nov 2008, 03:38

Post by mrhobbeys »

Hi
I am about to give this a try but I wanted to make sure first becasue I have the 2.0.6 installed.

Thanks
Post Reply