Page 1 of 1

Raw disk access and software RAID

Posted: 27. Dec 2010, 20:33
by kdorf
Currently, I have Windows 7 and Arch Linux installed on my desktop PC. Arch is setup in a RAID 1 with two disks. I would like to boot Arch in a VM underneath Windows 7 but I'd like to keep the RAID in good order (i.e. continuing to mirror as normal; I should still be able to boot into Arch on the bare metal). Would this be as easy as adding both RAID disks to the VM and booting it up? I suspect there may be some difficulties, perhaps with how the disks are identified. I can certainly restore from backups and rebuild the RAID if something goes wrong but I would obviously like to avoid that time-consuming process. Does anyone have any experience with a setup like this?

Thanks in advance. :-)

Re: Raw disk access and software RAID

Posted: 28. Dec 2010, 19:22
by kdorf
I tried this out and got it working, so I figured I would post an update. Yes, it really was as simple as creating two raw VMDKs corresponding to the disks used in the RAID and attaching them to the virtual machine. A couple things to look out for:
  • I had to uncheck "Enable IO APIC" in the virtual machine settings under the System section.
  • X11 will be wonky since Virtualbox's video driver is not the same as your physical card. This can be worked around rather trivially with a short shell script, though. In particular, for Arch users, I used the sysinit_end boot hook(see https://wiki.archlinux.org/index.php/Ar ... stom_hooks) to detect whether or not I was in a VM and load either the nvidia kernel module or the appropriate VirtualBox modules. It also makes symbolic links in /etc/X11/xorg.conf.d to the appropriate X configuration files (first removing any symlinks from that directory).
  • A few times when switching from virtual boot to physical I notice a complaint about dates being in the future when mounting partitions. I believe this was because I had checked "Hardware clock in UTC time" which is wrong for my setup since I am dual-booting Windows. I will investigate more. This issue seems to be benign as far as I can tell.
The result is slick: when I boot it in VirtualBox 4, I get a cool dual monitor setup and I can minimize one to go Linux on one side, Windows on the other. Of course, per original requirements, booting into Linux itself still works just fine. Thanks for those that took a look at this thread -- I hope this helps someone. :D