Page 1 of 1

How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 5. Apr 2012, 04:57
by seipp orion
I searched a lot and couldn't find the answer to this simple question anywhere.

(For the eager ones, the simple
VBoxManage convertfromraw LiveDVD.iso Linux.vdi
will *not* work. It completes successfully with no errors, but it doesn't make the resulting VDI bootable.)

Why would you need such conversion? The case is: you downloaded or created a Linux Live CD/DVD. You want to play with it while preserving changes between restarts.

Of course, you can create very quickly simple VM and boot from the CD/DVD (or the ISO) and to preserve changes made, you could "save the VM state". But what if your host or guest crash? Then you would've lost all changes you made while running CD/DVD-based VM.

The procedure below is tested on the following config:

- Host: Windows 7 Home Premium 64 bit
- Guest: Ubuntu 9.04 LIve CD/DVD
- VirtualBox 4.1.10

1) create simple VirtualBox VM which boots from the Live CD/DVD and make sure you boot the OS successfully. Everyone can do that easily by just following all default prompts for creating new VM. When you start the VM for first time, point it to boot from your Linux Live CD/DVD (from host's physical DVD/CD reader, or from ISO file)

2) When you successfully boot into your virtual Linux, do the following:
- System -- Administration -- Install
- Standard Linux installation starts
- Follow default prompts or adjust settings as in any standard Linux installation
- (At "Prepare disk space" window, if you have created more than one hard disks for your VM, choose the one to install Linux to)
- Follow default prompts or adjust settings as in any standard Linux installation
- After successful installation, shutdown the VM
- in the VM's Settings -- System - change "boot order" to boot from the VM's hard drive where you installed your Linux
- start the VM and done - you have converted the Linux LIve CD/DVD to bootable VDI

You can, of course, achieve the above alliteratively by:

- opening the LIve CD/DVD ISO file and editing GRUB boot options to specify the disk to boot from, and probably some other changes
- converting the ISO file to VDI via the above mentioned command VBoxManage

But note that the first procedure doesn't require you to know any deep Linux OS boot config details :D

Hope it helps!

Re: How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 5. Apr 2012, 10:27
by Leak
Really? Installing Ubuntu on a virtual hard drive by booting a live CD and using the built in installer creates a regular bootable Linux installation? Who would have thought...

Re: How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 6. Apr 2012, 08:17
by seipp orion
Leak wrote:Really? Installing Ubuntu on a virtual hard drive by booting a live CD and using the built in installer creates a regular bootable Linux installation? Who would have thought...
Who said the case was installing a *vanilla* Ubuntu?

It was a custom-altered Ubuntu, an ISO file, with a lot of config and non-OS packages installed. How do you convert such ISO into a VM which preserves states b/w reboots?

Just check the net how many people are asking on the net for exactly this case.

Re: How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 5. Apr 2013, 15:31
by blisterpeanuts
Thank you!

This was driving me crazy. I never thought to look at boot order.

Blister

Re: How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 9. Jan 2014, 11:02
by manuelpf
What if I want to run something like a privacy live OS where changes to the image are not supposed to be allowed and there is no installation process. How do I boot this with virtual box? Tails for example?

Re: How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 9. Jan 2014, 12:10
by socratis
manuelpf wrote:What if I want to run something like a privacy live OS
Boot from the live CD and do not attach a hard drive?

Re: How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 10. Jan 2014, 12:38
by manuelpf
socratis wrote:
manuelpf wrote:What if I want to run something like a privacy live OS
Boot from the live CD and do not attach a hard drive?
I cannot figure out how to create a new virtual machine without a virtual hard drive. I have to point it toward an existing one or create a new one otherwise it won't let me create a new virtual machine.

Re: How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 10. Jan 2014, 13:23
by noteirak
Just delete it after the VM was creading by editing the VM settings.

Re: How to "convert" Linux Live CD/DVD into bootable VDI

Posted: 11. Jan 2014, 12:14
by socratis
manuelpf wrote:I cannot figure out how to create a new virtual machine without a virtual hard drive. I have to point it toward an existing one or create a new one otherwise it won't let me create a new virtual machine.
DisklessVM.png
DisklessVM.png (117.54 KiB) Viewed 15203 times