Problem running Win XP (already installed on a real drive)

Discussions related to using VirtualBox on Linux hosts.
Post Reply
casidiablo
Posts: 2
Joined: 17. Sep 2008, 18:36

Problem running Win XP (already installed on a real drive)

Post by casidiablo »

Hi everyone,

I'd like to run the Windows XP OS already installed on a hard drive, from Ubuntu using Virtual Box. But I have a strange problem.

First I had a problem with the permissions of /dev/sdb. But I solved that issuse thanks to this topic:

http://forums.virtualbox.org/viewtopic.php?t=333

But, now I can create the virtual partition normally, but when I try to start it, the virtual machine does not run :( It just displays a blak screen and that's it.

If I restart the vm, I can see the typical windows menu that allows me to select between: start normally or in safe mode. I tried to start it in safe mode, then I get this:

http://img176.imageshack.us/my.php?image=problemuy5.png

And the vm freezees :(

I use Ubuntu 8.04 and Virtual Box 2.0.2
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

Don't chmod the permissions on the raw partitions to 666 or 777 if unless you don't mind trashing your file systems. There is a howto tutorial just being developed which gives a better way. This also explains some of these issues.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

You forgot to include a proper MBR. This is a common problem. If the above topic did not mention this, I'm sure that a different one does. Also see the Terry's Tutorial: All about VDIs for some additional info.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
casidiablo
Posts: 2
Joined: 17. Sep 2008, 18:36

Post by casidiablo »

TerryE wrote:Don't chmod the permissions on the raw partitions to 666 or 777 if unless you don't mind trashing your file systems. There is a howto tutorial just being developed which gives a better way. This also explains some of these issues.
OK, I Understand. Now I have my /dev/sdb normally, and I'm doing all the proccess as root. But the same happens :(

I tried to do it with other hard disk... it has Ubuntu and Windows XP, and when Virtual Box starts that vm, I see the grub menu. Then:

* If I start Ubuntu, it runs correctly
* But, if I select Windows XP, it happens the same (a black screen is displayed)

I think I've followed all the instructions in a lot of tutorials, but may be I have not seen the tutorial that you say, TerryE, so could you give me the link, please?

@Sasquatch: thanks for the link, I'm reading right now.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Post by Sasquatch »

You can see his work-in-progress in the Windows Guests section.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
jdmendez
Posts: 3
Joined: 20. Sep 2008, 06:20

Solving RawDisk problem

Post by jdmendez »

Hi guys!!!

I think I have solved part of the problem with the rawdisk! Since it worked what I did, I think it was not an sda permission.

What I did was running VirtualBox as ROOT. ej. sudo VirtualBox.

Also, to create the vkmd file, I noticed that the error message was appearing because I was trying to create the file in a non-existing folder.

Now, my problem is that when VirtualBox is booting my primary partition (sda1, my kubuntu is on sda2) grub is showing ERROR 17.

Do anybody knows how to specify a new booting parameter to skip this situation?

Thanks
vkov_tinsky
Volunteer
Posts: 218
Joined: 5. Apr 2008, 20:18

Post by vkov_tinsky »

jdmendez wrote:Since it worked what I did, I think it was not an sda permission. What I did was running VirtualBox as ROOT. ej. sudoVirtualBox.
No, it definitely is about /dev/sd* permissions: As root user you have permission for everything, that's all, but it's not a good idea to run VirtualBox as root. A better solution would be to create a separate user for this with the right permissions (just for raw disk access) which is not as difficult as it sounds. (Have a look at point 3.c. of this posting.)
jdmendez wrote:(sda1, my kubuntu is on sda2) grub is showing ERROR 17
That's most likely because grub is trying to access the /boot/grub directory on sda2. What you could do is set the MBR (via -mbr parameter) when using createrawvmdk. To generate the mbr file you can do install-mbr --force someName.mbr (this utility is part of the mbr package in Ubuntu).

Regards,
VT
Last edited by vkov_tinsky on 21. Sep 2008, 18:36, edited 1 time in total.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: Solving RawDisk problem

Post by TerryE »

jdmendez wrote:Hi guys!!!Now, my problem is that when VirtualBox is booting my primary partition (sda1, my kubuntu is on sda2) grub is showing ERROR 17.
When you do a createramwmdk, this virtual disk gives you read access only to the partitions that you list, and you should only list the partitions that are dedicated to your VM. Each such VMDK has its own private MBR which is copied from the MBR of the raw disk by default. In the case of a Grub loader this executes the stage 1.5 bootstrap from the partition containing /boot when grub was configured (in this case sda2). However, when the MBR reads these sectors the VM treats this request as out-of-bounds and returns zeros. The MBR code then raises this ERROR 17 message. The way to fix this is to boot the VM from a liveCD (such as your Ubuntu Media) and do a grub-install to point the virtualise MBR at the /boot partition in your VM partition.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
jdmendez
Posts: 3
Joined: 20. Sep 2008, 06:20

Re: Solving RawDisk problem

Post by jdmendez »

Thanks all you for your reply. I did what you told me. Now, when my VM try to boot, it finds the menu for the multiple OS (Kubuntu and WiinXP).
After I select WinXP (my guest OS), "Starting up..." shows up and then in crashes, showing some weird characters throw the screen.

Is that A compatibility issue with the Video Card?
I have allready multiple hardware profiles on Windows that should show after that, but they are not.

thanks again.
jdmendez
Posts: 3
Joined: 20. Sep 2008, 06:20

Re: Solving RawDisk problem

Post by jdmendez »

Hi Everybody, I still have the same problem. My RawDisk VM is crashing as soon it try to get into Windows XP partition (/sda1) from a Kubuntu Host at /dev/sda2.

When I boot the VM, Grub shows the options. If I try booting again /sda2 (kubuntu) it works. When I try to boot the Windows XP at /sda1, it only show "Starting up...." and crashes.

At least I assume the it is reading the boot sector because it is showing grub. And is not compatibility problem because I have a Win XP installed on a Virtual File too, and is running great.

I have try everything:
1. Creating a different user with privilege to access the partition and VM.
2. Create new profiles for Windows
3. Incorporating a new MBR with the -mbr option.
4. Including and not including -relative and -register
5. Creating the specific raw disk /dev/sda1 without the paritions command.
6. Giving access to the whole drive /dev/sda --partitions 1,2
7. Trying to Install Vbox with the Live Kubuntu CD. No success to install VBox.

Any other idea?
Do you think grub is trying to boot himself again?
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Post by TerryE »

No, the reason that your XP instance is crashing is the same reason that it would crash if you took the HDD out and put it in a completely different system with a different motherboard, etc. That's because the virtual machine has a different H/W configuration from the "bare metal" machine from the OS perspective.

If you want to "dual boot" then you need to set your XP instance to have two profiles and the Virtual profile needs to disable all of the bare metal H/W related drivers in that profile and load the VBox ones instead. Doing this is quite complex for an existing install, but one of the VBox wiki pages describes this. It is a lot easier for a fresh XP install as in VTs tutorial on this.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Post Reply