Accessing raw partitions with VMDK (VirtualBox 1.4)

This is for discussing general topics about how to use VirtualBox.

Postby TerryE » 20. Jul 2008, 12:20

Guy good to hear that you got this working, but what you are now talking about are the issues of configuring dual boot Linux. Off this topic, so I don't want to discuss it here. Preferably search for a more relevant one or failing that start a new thread and we can pick this up there.
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

Postby Dwarf » 7. Nov 2008, 01:30

Greetings to all.
i've followed the steps and successfuly managed to install a fresh system via vBox on a separate hard drive set as a rawdisk. I'm very pleased vith the performance since i use vBox to access Photoshop and other graphics software, and all of them work much faster now that they are on a real (physical) and separate drive. I also use a separate rawdisk partition for scratch files which also benefits the performance.

I have only one question. It is said that no concurent access should be allowed, so the rawdisk's partitions shouldn't be mounted into host OS. Does that count only for when the virtual machine is running? I mean, can i mount those partitions into host when i'm not running virtual box without something going bad if i copy some files to and from those partitions ?

thx to everyone here for being so persistent and determined in problem solving. I'm very much into experimentation with virtualBox, and after trying various virtualisation solutions i found it as the best, and hope that it will only be better in the future. Keep up the good work :)
Dwarf
 
Posts: 5
Joined: 7. Nov 2008, 01:14
Location: Sabac, Serbia

Postby guyr » 7. Nov 2008, 07:58

Sure, if the VM is not running then you can access the other partitions. The general rule is you need to avoid simultaneous access to the same filesystem by two different OSs that don't know about each other. It would be the same as if you wrote two programs that both updated a single file without knowing about each other - the file would get horribly corrupted.
Guy Rouillier
guyr
 
Posts: 34
Joined: 14. May 2007, 06:55

Postby Dwarf » 7. Nov 2008, 22:12

@guyr: thanks for confirming mate :)

btw, if i understood this method (use of raw disk) correctly, the hard drive i used to setup windows on could be set up as primary and booted outside virtualbox on a real computer, but ,of course, would run onto a new and completely different hardware configuration and most probably would not complete the startup sequence (unless i've created a hardware profile for that hardware) ?
Dwarf
 
Posts: 5
Joined: 7. Nov 2008, 01:14
Location: Sabac, Serbia

Postby guyr » 8. Nov 2008, 07:21

Correct. Theoretically, what you say is possible. In the Linux world, they've built an entire structure around that very concept. In reality, it's hard to pull off because the virtual hardware platform that VirtualBox (or any VM) presents will not be the same as your real hardware.
Guy Rouillier
guyr
 
Posts: 34
Joined: 14. May 2007, 06:55

Postby TerryE » 8. Nov 2008, 16:29

Guy, dual booting Linux is quite straight forward as long as you reset the udev rules for the MAC addresses on your NICs (physical vs. virtual). VTs post discusses how to do this for Windows. It can be done. I've got a test rig which can boot the XP install on the bare H/W and on the VM. You need to have two profiles -- one which loads your native H/W drivers and one which loads your virtual H/W ones. So it is possible but is not really something that I would recommend you trying unless you really understood virtualisation and Windows configuration.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
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

Postby mwsealey » 11. Nov 2008, 23:16

I'm having just as much trouble on Windows;

Code: Select all   Expand viewCollapse view
C:\Program Files\Sun\xVM VirtualBox>vboxmanage internalcommands listpartitions -
rawdisk //./PhysicalDrive0
VirtualBox Command Line Management Interface Version 2.0.4
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

Number  Type   StartCHS       EndCHS      Size (MiB)  Start (Sect)
1       0x07  0   /1  /1   1023/254/63         29996           63
5       0x83  1023/254/63  1023/254/63           258     61432623
6       0x83  1023/254/63  1023/254/63         16386     61962768
7       0x0c  1023/254/63  1023/254/63         29651     95522553

C:\Program Files\Sun\xVM VirtualBox>vboxmanage internalcommands createrawvmdk -f
ilename D:\Virtualbox\raw.vmdk -rawdisk //./PhysicalDrive0 -partitions 6 -r
egister
VirtualBox Command Line Management Interface Version 2.0.4
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

RAW host disk access VMDK file D:\Virtualbox\raw.vmdk created successfully.

[!] FAILED calling aVirtualBox->OpenHardDisk(filename, hardDisk.asOutParam()) at
 line 1207!
[!] Primary RC  = E_FAIL (0x80004005) - Unspecified error
[!] Full error info present: true , basic error info present: true
[!] Result Code = E_FAIL (0x80004005) - Unspecified error
[!] Text        = VD: error opening image file 'D:\Virtualbox\raw.vmdk' (VE
RR_FILE_NOT_FOUND)
[!] Component   = HardDisk, Interface: IHardDisk, {fd443ec1-000f-4f5b-9282-d7276
0a66916}
[!] Callee      = IVirtualBox, {557a07bc-e6ae-4520-a361-4a8493199137}

C:\Program Files\Sun\xVM VirtualBox>


Anyone know why this might fail here? partition 6 is actually an ext3 partition from an existing Linux install I am hoping to migrate..
Matt Sealey
Genesi USA, Inc. http://www.genesi-usa.com/
Product Development Analyst
mwsealey
 
Posts: 9
Joined: 29. Jun 2007, 21:16

What if I can't run MergeIDE?

Postby wmcbrine » 31. Jan 2009, 18:22

I have the "Check for viruses" etc. screen problem. I've read through this thread, and the wiki entry. It looks like MergeIDE would solve my problem... except that it has to run on the original system. But, my original system is dead. That's why I want to boot the drive with VirtualBox -- I pulled the drive from my dead laptop, and put it in an external case.

I can mount the drive under Linux and write to it. Is there a way to apply the necessary changes from there?
wmcbrine
 
Posts: 4
Joined: 31. Jan 2009, 18:12

Re: What if I can't run MergeIDE?

Postby TerryE » 1. Feb 2009, 16:07

wmcbrine wrote:I can mount the drive under Linux and write to it. Is there a way to apply the necessary changes from there?

IIRC, if you look at Vkov's tutorial at the head of Windows Guests you will see this discussed and the links to a Linux tool that can edit the registry hives on the Windows boot partition.

Of course, the alternative is to boot from your Windows media in recovery mode in the VM and make the fixes that way.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
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

Re: What if I can't run MergeIDE?

Postby wmcbrine » 2. Feb 2009, 05:23

TerryE wrote:IIRC, if you look at Vkov's tutorial at the head of Windows Guests you will see this discussed

I don't see that there.

and the links to a Linux tool that can edit the registry hives on the Windows boot partition.

I did find that. Unfortunately, it's very... manual. It won't just accept a .reg file and apply it. But I couldn't find any other way, so I started going through the steps in MergeIDE by hand -- extracted the files with cabextract, and started creating the registry entries. At one point, I stopped. I realized that most of them wouldn't actually be needed, although I wasn't sure which would. So I just tried with what I had, and I got lucky. Then all I had to do was reactivate XP.

Of course, the alternative is to boot from your Windows media in recovery mode in the VM and make the fixes that way.

Yeah, I couldn't do that either. No media -- I got this laptop without it. (It had been a display unit, not that that excuses it.)

Anyway, that was a lot more of a chore than I expected, but I'm happy now.
wmcbrine
 
Posts: 4
Joined: 31. Jan 2009, 18:12

Re: What if I can't run MergeIDE?

Postby Sasquatch » 2. Feb 2009, 16:22

wmcbrine wrote:
TerryE wrote:IIRC, if you look at Vkov's tutorial at the head of Windows Guests you will see this discussed

I don't see that there.

It's a sticky. You can't miss it.
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.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Re: What if I can't run MergeIDE?

Postby wmcbrine » 2. Feb 2009, 21:56

Sasquatch wrote:
wmcbrine wrote:
TerryE wrote:IIRC, if you look at Vkov's tutorial at the head of Windows Guests you will see this discussed

I don't see that there.

It's a sticky. You can't miss it.

I saw the tutorial. It's the discussion of my issue within it that I don't see.
wmcbrine
 
Posts: 4
Joined: 31. Jan 2009, 18:12

Re: What if I can't run MergeIDE?

Postby TerryE » 2. Feb 2009, 23:53

wmcbrine wrote:I have the "Check for viruses" etc. screen problem. ...
I can mount the drive under Linux and write to it. Is there a way to apply the necessary changes from there?

Yes, you are correct. This is because some Virus packages check for changes to the MBR and that's what happens when you P2V. You click "ignore" and carry on. That still doesn't prevent any of the other driver chain issues causing your boot to stall.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
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

Re: What if I can't run MergeIDE?

Postby Sasquatch » 3. Feb 2009, 22:40

wmcbrine wrote:
Sasquatch wrote:
wmcbrine wrote:
TerryE wrote:IIRC, if you look at Vkov's tutorial at the head of Windows Guests you will see this discussed

I don't see that there.

It's a sticky. You can't miss it.

I saw the tutorial. It's the discussion of my issue within it that I don't see.

The Tutorial is meant as a step by step approach of how to get it working. Try it from the beginning, remove your RAW Disk VMDK images, then start all over again using that Tut. If you get errors along the way, report them here, or it's discussion topic (should be a link in that Tut).
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.
Sasquatch
Volunteer
 
Posts: 17800
Joined: 17. Mar 2008, 13:41
Location: /dev/random
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux

Re: Accessing raw partitions with VMDK (VirtualBox 1.4)

Postby wisdom_wei » 15. Nov 2010, 15:22

The right way to solve this problem is this:
1) sudo su
2) umount /dev/sda2
3) chmod 666 /dev/sda* OR add current user kilou to the group disk and login again
4) VBoxManage internalcommands createrawvmdk -filename /home/kilou/.VirtualBox/WinXP.vmdk -rawdisk /dev/sda -partitions 2 -relative -register
5) chown kilou:users /home/kilou/.VirtualBox/WinXP.vmdk
6) exit
wisdom_wei
 
Posts: 1
Joined: 15. Nov 2010, 15:17
Primary OS: Ubuntu other
VBox Version: OSE other
Guest OSses: Windows XP

PreviousNext

Return to Using VirtualBox

Who is online

Users browsing this forum: Bing [Bot] and 16 guests