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

I have a running setup as following:

  • Native OS: Windows 7 64bit, 3 Partitions:
    • c: (System)
    • d: (FAT32, here is my vdi file)
    • e: (unformatted)
  • VirtualBox: Fedora 14 running off the vdi file on drive d.

Usually this setup is great for me, but sometimes I'd like to run Linux natively, and not inside VirtualBox.

Is there a way to boot directly into the vdi file without the Windows overhead? E.g. using a USB stick with some modified Linux Kernel / GRUB that can mount the vdi file directly as "/"? Or copy the contents of my vdi file to the empty partition and somehow use this from VirtualBox (when booting into Windows) AND directly booting into Linux?

Hope to get some hints or even howtos.

share|improve this question

3 Answers 3

up vote 13 down vote accepted

I don't know if it is possible to boot a vdi file but you can convert VDI file to raw image:

VBoxManage internalcommands converttoraw Fedora14.vdi Fedora14.raw

You must remember though that this is a whole drive image, so just copying it to a empty partition won't work, you can copy using Windows version of dd to a spare disk and boot that.

If your Fedora installation is using only one partition you could skip those first sectors containing MBR and copy only the remaining stuff. This will be easily bootable using either Fedora CD or Super GRUB Disk.

All in all, I think that this is a good exercise but rather pointless. Installing Fedora natively and copying data from /home from VM (if you didn't use MySQL or other databases in the VM that's the only thing you need to copy) will be much easier and less error prone.

share|improve this answer
    
I'm doing a lot of programming work on my linux machine, that includes installation of various stuff in /usr, /var etc. usually speed is not an issue (and I can work with Windows programs too), but sometimes I want "full power", that's when I need the native mode. I'll definately try it, and hope for the best :) –  mawimawi Jan 13 '11 at 18:53
1  
See this post for finding the right offset into the disk image so you can start the copy at the beginning of the partition you want to use muralipiyer.blogspot.com/2008/02/… –  nealmcb Jan 30 '11 at 3:41
2  
An even easier way to get at the data which you need to copy is here, using the qemu-nbd program to directly mount stuff out of the .vdi file! bethesignal.org/blog/2011/01/05/… –  nealmcb Jan 30 '11 at 4:20
    
It looks like it is possible to boot a .vdi file using realmcb advice. You'd need to use initrd image with manually edited scripts and additional kernel modules but it definitely looks doable with qemu-nbd module. –  Hubert Kario Jan 30 '11 at 10:23

It is possible to boot directly into Virtual PC/Hyper-V VHD files on a Windows 7 machine, but that works because Windows 7 can mount VHDs like they're physical disks. I'm not sure it would be possible using VDI, so you'd either need to convert the virtual machine to a VHD format or follow Hubert's suggestion above.

Scott Hanselman has a good article on Boot-to-VHD in Windows 7.

share|improve this answer

maybe put in startup something like:

VBoxHeadless -startvm "Fedora 14"
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.