Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am looking for something similiar to Bootcamp.

Currently, I run Ubuntu Maveric as my primary operating system and run Windows 7 in Virtualbox. For some tasks, however, running Windows virtualized just seems to result in too much overhead and speed loss, and I'd like to be able to boot natively.

The ideal situation would be to setup Windows and Ubuntu in dual boot on seperate partitions, with the ability to boot the Windows partition in Virtualbox on Ubuntu as well.

Is this possible?

Also, how it is that Bootcamp seems to be the only system capable of this?

share|improve this question

4 Answers 4

up vote 15 down vote accepted

It is possible to boot your Windows installed on your computer in a VM running on a Linux installed on the same computer. The only thing to remember: do not mount a partition on both OS. I've used this setup in qemu, kvm and VirtualBox.

EDIT: The ideea is to use the entire physical disk and be careful not to mount the same partition twice (like booting the same OS twice, or trying to mount a partition from an OS that was hibernated) VirtualBox setup:

  • Create a VMDK file pointing to a raw disk: VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -register See: http://www.virtualbox.org/manual/ch09.html#rawdisk
  • create a new VM and use the raw disk for that VM.
  • unmount all partitions that will be used by VM.
  • boot the VM and in the Grub menu chose an OS that is not already booted.
share|improve this answer
    
Could you elaborate on this? I am very interested in the how aspect. –  Aron Rotteveel Mar 1 '11 at 15:05
    
I've updated the answer. –  Mircea Vutcovici Mar 1 '11 at 16:30
    
Thanks! Out of curiosity: what would actually happen if I'd dual-mount a disk? –  Aron Rotteveel Mar 2 '11 at 17:00
    
You can have filesystem corruption. But there are filesystems that allow to be mounted by two different machines (e.g. GFS). See: en.wikipedia.org/wiki/Global_File_System –  Mircea Vutcovici Mar 4 '11 at 22:05
1  
The corruption is caused by the fact that part of the filesystem state is keept in the memory of each kernel. For example the dirty pages are kept in memory for few seconds and meantime the other kernel can change the same files, jurnal or fs structure at the same time. For example you delete a file from one OS and meantime the other OS will create another file in the same folder. Because the 2nd OS has a older copy of the folder cached in memory, it could write it to disk with the cached info (first file not deleted) and new file added. The firs OS fill not notice the added file. –  Mircea Vutcovici Mar 4 '11 at 22:12

Right now, there's no specific support for sharing a bootable partition with a VM. There's been some attempts at coercing VirtualBox into doing this on Macs w/ BootCamp, but it looks like a very difficult to accomplish and fragile process.

If you search the VirtualBox forums, you can find out what kind of success others have had. If this is something you intend to use in any kind of production environment, I'd wait until Oracle is at least attempting to implement it as a usable feature before trying to use it.

I know that Parallels Desktop for the Mac provides explicit support for sharing a VM with a BootCamp partition, and it's very easy to set up. So as far as it being possible to do, then yes. I don't know if they provide the same feature for their Windows and Linux products or not. It'd be worth a look.

share|improve this answer

I would suggest this is almost certainly not possible, or at least practically infeasible. Even if you could find a way to either boot natively from a VirtualBox image, or to boot a VB guest from a real partition (the latter is possible, I think), you'd still face the issue of the underlying hardware platform changing massively every time you switched. That at least would break your activation in a fairly short order.

share|improve this answer

VMWare Workstation used to be capable of something like that, but it has been ages I used this so I don't know if (a) the function still exists and (b) it would work with modern Windows versions and their activation crap.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.