Can I boot Linux from a VHD?

29

13

Is there some way to boot a Linux system from a VHD in Windows 7?

If there is a way, how do I put it there in the first place?

EDIT: To clarify, I'm not trying to run Linux in a VM. I'm trying to boot it in my physical machine, from a VHD, as I can do with Windows 7.

R. Martinho Fernandes

Posted 2009-09-01T10:56:36.723

Reputation: 654

2

You can do this in linux now. I recently posted an answer here. https://unix.stackexchange.com/questions/309900/deploy-linux-into-and-boot-from-vhd?answertab=active#tab-top

– Dean – 2018-08-28T02:25:49.810

Answers

16

You cannot. In Windows VHD support is integrated in boot process and Linux does not offer such support. Additionally, I am not aware that Linux supports booting from any other virtual disk type.

Josip Medved

Posted 2009-09-01T10:56:36.723

Reputation: 8 582

Linux can boot from ext4 images easily Is there a Linux equivalent for VHD from which it can boot? although it's not strictly a disk format for common virtual machines. However as of now Linux can boot from VHD

– phuclv – 2018-09-05T17:12:51.103

4Correct - VHD booting support is part of the Windows 7 Boot Loader, and this is not supported by any other OS. I am not aware of any plans to have this migrated either. – BinaryMisfit – 2009-09-01T12:04:20.020

23

yes, We just released a sample Linux VHD that you can boot any computer.

You can find more info here:

Download and boot your physical PC, also runs as vm - http://www.vmlite.com/index.php/forums/17-vboot/1864-linux-vhd-boot-available-download-and-boot-your-physical-pc-also-runs-as-vm

1 Linux as Real Appliance

With VBoot for Linux, you can pre-install and pre-configure Linux OS and its applications, then distribute the resulting virtual disk file in VHD format. The vhd can boot a real computer, with configuration and apps instantly available. This way, operating systems are truly manageable, as simple as files. We call such a Linux VHD to be a real appliance, in the sense that it boots physical computers.

It's very easy to setup and boot a computer with a vhd file. You download the vhd file, drop it to Windows or Linux file system, then configure the boot loader, and reboot the computer.

2 Linux as Virtual Appliance

The exact same vhd file also runs as a virtual machine using virtualization software, such as VMLite Workstation, VirtualBox, Xen and Virtual PC and Hyper-V, etc. By default, it's optimized for VMLite Workstation.

If VMLite Workstation is installed, you can simply double click the ubuntu-910-desktop-i386.mop file to launch the vhd as a virtual machine with VMLite Workstation.

A sample Ubuntu VHD package is ready for download:

http://www.vmlite.com/index.php/download/22-appliances (free site registration required)

download, extract it, then double click setup.exe on Windows, reboot On Linux, need to configure boot loaders.

detailed instructions:

http://www.vmlite.com/appliances/ubuntu-910-readme.html

screenshot:

http://www.vmlite.com/images/vboot/vboot-grub2.png

VMLite Team

user33819

Posted 2009-09-01T10:56:36.723

Reputation:

The first link is broken! – msangel – 2016-01-12T22:09:11.680

3It appears this VBoot program was a trial set to expire on 2012-01-12, almost ten months ago now, and is no longer free. – James Dunne – 2012-10-16T01:57:48.567

10

First Create a bootable Win 7 VHD using this known procedure from Keith Combs.

http://blogs.technet.com/b/keithcombs/archive/2009/05/22/dual-boot-from-vhd-using-windows-7-and-windows-server-2008-r2.aspx

Boot the Win 7 operating system on the VHD.

Go get the free Wubi installer.

http://www.ubuntu.com/download/ubuntu/windows-installer

From Windows 7, install the Ubuntu Wubi installer, but make sure you install files on the Physical HD's primary partition (not VHD's C: windows partition)

Reboot when asked to do so, but don't select Ubuntu yet from the boot menu (it won't work), you need to launch Windows 7 one last time.

Now the important bit: In Windows 7 make sure you change the Folder view settings to "Show all files" and make sure OS files are un-hidden. Once you have done this browse the C: drive. You will see two important files: wubildr and wubildr.mbr

Copy these two files to the root of the Physical Partition (ie, the partition where the Windows7.vhd file is located and the Ubuntu folder that was created when you installed wubi above). Just to be sure you are copying the files to the right partition, make sure you can see that there is a pagefile.sys bootmgr and bootsect.bak file.

Thats it! reboot and select Ubuntu from the Windows bootloader.

TestVHD

Posted 2009-09-01T10:56:36.723

Reputation: 101

5

it is possible to use a disk image as a root device, but compiling this into the kernel or the bootloader is somewhat tricky. Since the VHD specification is freely available, extending lilo or grub or the linux kernel to give a vhd the same status as a .iso or .img or other disk image file should be a simple matter of programming, taking you no more than a year or two of weekends and evenings. Then you'll be a hero, and after your patches are accepted into the main line kernel source you are eligible to get a Tux tattoo.

user17779

Posted 2009-09-01T10:56:36.723

Reputation:

5unneccesary snarkiness – uSlackr – 2011-10-03T23:22:22.023

0

lol this is a late reply, but you could try the WUBI installer or unetbootin. They don't use VHD files, although they do allow you to boot a few linux distros without any partitioning as long as you have a copy of the cd or iso.

Anon

Posted 2009-09-01T10:56:36.723

Reputation:

-1

Do you mean running an existing Linux System in a virtual machine?

If yes this might be the answer: http://www.windley.com/archives/2007/08/p2v_how_to_make_a_physical_linux_box_into_a_virtual_machine.shtml

user9329

Posted 2009-09-01T10:56:36.723

Reputation: 9

Nope. He was referring to booting the OS from bare metal using a file container. I've seen it done in the past, using various methods. In fact, I used to run a distro this way. It's cleaner than GRUB, since there's nothing to clean up in the partition table if you decide to change or remove the Linux distro. – TomXP411 – 2015-03-02T20:19:41.477

-2

You can try converting the VHD into VMDK (for VMWare products), and then try booting from there.

You just need to open the VHD with a VMWare product (even the free VMWare player will work), and VMWare will convert it to VMDK for you.

You might need to tweak the Linux system to operate fully in the new VMWare environment though.

caliban

Posted 2009-09-01T10:56:36.723

Reputation: 18 979

The question was about booting to a bare-metal VHD, not a virtual machine. You can do this with Windows: boot the OS directly to a VHD without using a hypervisor. The OP wanted to do the same with Linux. – TomXP411 – 2015-03-02T20:19:03.797

I didn't intend to boot a vm. I can do that with Virtual PC. What I want is to boot my physical machine in the vhd. Thanks anyway. – R. Martinho Fernandes – 2009-09-01T11:10:44.357