Howto: Windows XP in both VM and native - DISCUSSION

Discussions about using Windows guests in VirtualBox.
heiko
Posts: 7
Joined: 16. Oct 2008, 02:32

Post by heiko »

Wow - thanks for the quick answers. Looks like I have no easy choice but either clean install or trying to disable all the h/w drivers.

Just to make sure I understood everything:

1. Boot the VM profile natively - OK, have done this before and played with disabling tons of drivers

2. From the command line start the device manager (set devmgr_show_nonpresent_devices=1 && devmgmt.msc) and turn "Show hidden devices" on - that's new and I will try this

3. Uninstall all hardware specific drivers & run MergeIDE - I did disable all sorts of h/w drivers, incl. the nVidia driver. I didn't really know what to do about all the hdd drivers; I got an ICH8 2 channel, an ICH8 4 channel and some IDE drivers (don't remember exactly), altogether 4-5 hdd drivers. I believe my box gets stuck at the point it loads the disk drivers (the Virtualbox log also suggests that).

By the way, I did run MergeIDE at some point (wasn't that supposed to be run while in the native boot profile?)

4. Boot with the VM profile in VirtualBox - I'll double-cross my fingers.

5. On next boot natively (with the native profile) the drivers you uninstalled should be re-instated (since they still should be in system32 and system32\drivers) - I'll pray to Billy.

So far I've seen that whenever I change to a different h/w profile, the PC keeps digging out the drivers and installing them. This, however, leads to messages like "Driver for Multiprocessor ... has been installed, but in order to work properly the PC needs to reboot" or so. Question: will it go through this driver search and installation every time I change from native to VB boot or vice versa, or will the PC eventually have two different hardware profiles that are automatically loaded when selecting the right boot option?

TerryE, I have already read your hints about your boot script to automate the boot process - any chance I get to see and "taste" the script?

By the way, I took over control of 3 out of 4 PCs at home. If I would ever try what you did on my wife's laptop, she would fry my sorry ?ss. I certainly don't want to throw my 25 years of marriage (and myself) down the toillet :) .
heiko
Posts: 7
Joined: 16. Oct 2008, 02:32

Post by heiko »

TerryE wrote:... However, the basic approach was a clean install VM first.
The reason I'm hesitating doing a clean install is that I would have to do a little more than just a Windows install. The main reason I need Windows is for Photoshop (if only Adobe would come out with a Linux version) and some camera related software for RAW picture processing. Installing all that stuff again and recalibrating my screen with the colorimeter takes time.

Moreover, I'm still a bit uncertain if Photoshop and especially the resource heavy RAW conversion utilities would work in a Virtualbox, let alone the fact that I need the maximum screen size and color depth (24 bits at least). And I must be able to use my .icm color profile for the screen. Ideally I would even be able to calibrate my screen within the Windows guest.

Do you consider a dd if=/dev/sda1 of=/some/filename as good enough for a backup? If something goes sour, I'd like to be able to restore the Windows partition.

Thanks again for your help. I'll most likely get to try it next weekend (I'm bit short on time during the week).
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 »

AFAIR, there has been some success in getting Photoshop to run under Wine, so you might want to look at Wine HQ.

As far as backing up your system, what I have tried is the ntfsprogs but the dump utility has bugs in the version that I download , so instead I just did a dd + compress of my XP boot partition. I first defragged the partition then ran the sysinternals sDelete utility to clear all the freespace to zeros. This makes the compression both go faster and produces a lot smaller image file. I then did a dd if=/dev/sdaN | bzip2 -c > path/image.bz2. Guaranteed recovery.

I didn't go around disabling individual drivers; well I did at first but the boot hung, so I just trashed the lot. Once you've got the VM booting, its quite straight forward to switch profiles and go back to rediscovering the native H/W on the native boot. You need to have the two kernel/HAL options, plus activation files as per VT's topic, plus I have some other conditional stuff. To automate this you just need a wrapper script as I discuss in the topics.

BTW, Jan had a chuckle at your response: "It just goes to show how tolerant I am", she said.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
shenhanc
Posts: 12
Joined: 17. Sep 2008, 01:31

Post by shenhanc »

Hi, VT, one question.

I enabled raw partition SATA on vbox 2.0.4 with the "VBoxManage setextradata <VM name> VBoxInternal/Devices/ahci/0/Config/UseAsyncInterfaceIfAvailable 0" fix. And I also checked "Enable SATA Controller", the question is, which slot should I attach my raw disk, "IDE Primary XXX" or "SATA Port 0"? Any difference for them?
vkov_tinsky
Volunteer
Posts: 218
Joined: 5. Apr 2008, 20:18

Post by vkov_tinsky »

shenhanc wrote:which slot should I attach my raw disk, "IDE Primary XXX" or "SATA Port 0"? Any difference for them?
Choosing any of the IDE options will still connect it as IDE, not SATA. So use SATA Port 0. I assume you've already installed the Intel Matrix Storage Manager (Installation, step 7) or it won't boot otherwise.
Also: I did a couple of simplistic IDE vs SATA performance tests here, if you're interested.
heiko wrote:[...]
I'll pray to Billy.
If you have enough disk space you could instead put the whole Windows partitions into a VDI (see here) which of course means if something goes wrong it won't matter as you still have the real partition.

Regards,
VT
shenhanc
Posts: 12
Joined: 17. Sep 2008, 01:31

Post by shenhanc »

Hi, VT. Another problem.

Minutes ago I upgraded to 2.6.24-21-generic, and VBOX 2.0.4 stops work for any raw partition disks, I have rebuild the kernel driver(vboxdrv), re-created a vmdk from scratch and re-created a new machine with this raw partition disk, but every time I tried to boot my windows xp, the whole vbox screen becomes black and nothing happens then. (No matter whether it is a IDE or SATA) While for ordinary file-based disks, it works well.

So any suggestions?
vkov_tinsky
Volunteer
Posts: 218
Joined: 5. Apr 2008, 20:18

Post by vkov_tinsky »

I upgraded to 2.6.24-21-generic, and VBOX 2.0.4 stops work for any raw partition disks
I've got 2.6.24-21 so it should work theoretically.

To double check: When you re-created the raw vmdk, did you use the -relative parameter? In which case did you specify an MBR file and set the boot flag for the Windows partitions temporarily? (You can do install-mbr -f mbr.raw which is part of the mbr package in Ubuntu.)

Regards,
VT
shenhanc
Posts: 12
Joined: 17. Sep 2008, 01:31

Post by shenhanc »

Hi, VT! Ok, as I do double checks, I found I didn't add the mbr option to the createrawvmdk command. (What's "-mbr" mean, BTW?)

Now I attached my disk to SATA SLOT 0, and encountered new problems.

I am trying to install xp(32bit) on raw partiton sda1 with SATA enabled, and during installation I pressed F6 and selected "Intel(R) ICH8M-E/M SATA AHCI Controller" for my SATA. It successfully recognized my disks, but when I trying to NTFS-quick format it, it just complains about "Setup was unable to format the partition. The disk may be damaged." How about that?

My detailed partition information:

Code: Select all

   Device Boot      Start         End      Blocks   Id  System                                                                
/dev/sda1   *           1        6575    52813656    7  HPFS/NTFS                                                             
/dev/sda2            6576        9726    25310407+  83  Linux                                                                 
/dev/sda3            9727       18966    74220300   83  Linux

My command line to create raw vmdk

Code: Select all

VBoxManage internalcommands createrawvmdk -filename .VirtualBox/raw.vmdk -rawdisk /dev/sda -partitions 1 -relative -register -mbr myMBR.mbr
My permission:

Code: Select all

666 on /dev/sda1
666 on /dev/sda
666 on raw.vmdk
666 on raw-pt.vmdk
Any hints on this?

(Seems we are having an endless Q/A rounds :cry: )
vkov_tinsky
Volunteer
Posts: 218
Joined: 5. Apr 2008, 20:18

Post by vkov_tinsky »

shenhanc wrote:but when I trying to NTFS-quick format it, it just complains about "Setup was unable to format the partition. The disk may be damaged."
The only time I saw this is when I created the NTFS partition using gparted. If I instead chose and formatted as FAT32 (in gparted) and then during the Windows install told it to re-format as NTFS all went well. If that doesn' help switch back to IDE (which worked before right?) since you can switch to SATA afterwards anyway.
What's "-mbr" mean, BTW?
Have a look at the wiki entry for an explanation. Regarding why you need to use it - I can't put it better than the manual (section 9.9):
In some configurations it may be necessary to change the MBR code of the created image, e.g. to replace the Linux boot loader that is used on the host by another boot loader. This allows e.g. the guest to boot directly to Windows, while the host boots Linux from the “same” disk. For this purpose the -mbr parameter is provided. It specifies a file name from which to take the MBR code.
Since you have grub as your boot loader on your real disk this allows it to be changed (stored inside the .vmdk). This is only necessary when you create a raw vmdk to boot an existing installation since when you install Windows it will overwrite the MBR itself.
shenhanc wrote: My permission: [...]
Since you're creating the .vmdk with the -relative switch, only access to the partition itself is required (after vmdk creation) so you don't need to set permissions for the whole of the disk.

Regards,
VT
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 »

Just remember that that little 666 means that you are giving everyone write access to your Windows partition. If you do this then to you need to remember that as simple mistype can result in your writing directly to the partition and thereby trashing it. VT and I discussed an alternative approach which uses a service account which has disk group access and is mapped onto your .VirtualBox -- far safer.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
shenhanc
Posts: 12
Joined: 17. Sep 2008, 01:31

Post by shenhanc »

Hi, VT and Terry, thank you all for your replies/suggestions/answers.

I gave up installing SATA driver during the XP installation, instead I succeeded enabling SATA AFTER installed XP, now it works perfect! Thank you for all your posts!

I know 666 is quite unsafe. After my VB XP becomes stable for a while, I will come back to the post to solve the user/group/permission problem.
heiko
Posts: 7
Joined: 16. Oct 2008, 02:32

Post by heiko »

TerryE wrote:AFAIR, there has been some success in getting Photoshop to run under Wine, so you might want to look at Wine HQ.
I know that Wine supports older (~3-4 years old) versions of Photoshop, but I doubt that it can handle CS2 or CS3. Moreover, I use additional RAW conversion software which may not be supported. I will check with Wine, however - thanks for the hint.
TerryE wrote:As far as backing up your system, what I have tried is the ntfsprogs but the dump utility has bugs in the version that I download , so instead I just did a dd + compress of my XP boot partition. I first defragged the partition then ran the sysinternals sDelete utility to clear all the freespace to zeros. This makes the compression both go faster and produces a lot smaller image file. I then did a dd if=/dev/sdaN | bzip2 -c > path/image.bz2. Guaranteed recovery.
Thanks - I keep my Windows partition relatively small (~40 Gig) and only use it for the OS and programs. I still have enough capacity on other drives to hold a backup or two of it.
TerryE wrote:I didn't go around disabling individual drivers; well I did at first but the boot hung, so I just trashed the lot.
How do you "trash the lot"? I think I missed this one (I just learned how to disable drivers one by one).
TerryE wrote:Once you've got the VM booting, its quite straight forward to switch profiles and go back to rediscovering the native H/W on the native boot. You need to have the two kernel/HAL options, plus activation files as per VT's topic, plus I have some other conditional stuff. To automate this you just need a wrapper script as I discuss in the topics.
I like to see your wrapper script :-).
TerryE wrote:BTW, Jan had a chuckle at your response: "It just goes to show how tolerant I am", she said.
:lol:

P.S.: I haven't gotten to try your suggestions yet - I'm on a new job now and have had training the past few days, my head is spinning.
heiko
Posts: 7
Joined: 16. Oct 2008, 02:32

Post by heiko »

vkov_tinsky wrote:
heiko wrote:[...]
I'll pray to Billy.
If you have enough disk space you could instead put the whole Windows partitions into a VDI (see here) which of course means if something goes wrong it won't matter as you still have the real partition.

Regards,
VT
Well, I do have enough disk space to create a separate VDI. I'll think about it. Thanks for the suggestion.
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 »

heiko wrote:
TerryE wrote:I didn't go around disabling individual drivers; well I did at first but the boot hung, so I just trashed the lot.
How do you "trash the lot"? I think I missed this one (I just learned how to disable drivers one by one).
I just went into the device manager, switched to View Devices by Connection and Uninstalled everything that would install including the "Microsoft ACPI-Compliant System"
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

DmiBIOSVersion error

Post by nw60312 »

Hello - Trying to get this running. Installed 2.04 and got stuck setting the bios flags.

Code: Select all

# dmidecode 2.9
SMBIOS 2.5 present.

Handle 0x0000, DMI type 0, 24 bytes
BIOS Information
	Vendor: American Megatrends Inc.
	Version: 1406   
	Release Date: 10/02/2008
	Address: 0xF0000
	Runtime Size: 64 kB
	ROM Size: 2048 kB
	Characteristics:
		ISA is supported
		PCI is supported
		PNP is supported
		APM is supported
		BIOS is upgradeable
		BIOS shadowing is allowed
		ESCD support is available
		Boot from CD is supported
		Selectable boot is supported
		BIOS ROM is socketed
		EDD is supported
		5.25"/1.2 MB floppy services are supported (int 13h)
		3.5"/720 KB floppy services are supported (int 13h)
		3.5"/2.88 MB floppy services are supported (int 13h)
		Print screen service is supported (int 5h)
		8042 keyboard services are supported (int 9h)
		Serial services are supported (int 14h)
		Printer services are supported (int 17h)
		CGA/mono video services are supported (int 10h)
		ACPI is supported
		USB legacy is supported
		LS-120 boot is supported
		ATAPI Zip drive boot is supported
		BIOS boot specification is supported
		Targeted content distribution is supported
	BIOS Revision: 14.6
Relevant settings script:

Code: Select all

#! /bin/bash
VM_NAME="NativeXP" # Name of your Virtual Machine
VSETED="VBoxManage setextradata $VM_NAME"
CFG_PATH="VBoxInternal/Devices/pcbios/0/Config"
$VSETED $CFG_PATH/DmiBIOSVendor       "American Megatrends Inc."
$VSETED $CFG_PATH/DmiBIOSVersion      "1406"
$VSETED $CFG_PATH/DmiBIOSReleaseDate  "10/02/2008"
.....
When I try to start the Virtual Machine I get the following error:

Code: Select all

Configuration error: Querying "DmiBIOSVersion" as a string failed.
VBox status code: -2107 (VERR_CFGM_NOT_STRING).
It looks like the code is in fact expecting a string value here? I tried setting it as a number but that had no affect.

Any suggestions?

Thanks!
Post Reply