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

This is for discussing general topics about how to use VirtualBox.
Post Reply
seipp orion
Posts: 2
Joined: 5. Apr 2012, 03:59
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu, Solaris, Windows XP
Contact:

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

Post 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!
Leak
Posts: 242
Joined: 31. Mar 2009, 13:00
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Debian Testing, Windows XP, Windows Server 2003/2008 R2

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

Post 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...
seipp orion
Posts: 2
Joined: 5. Apr 2012, 03:59
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Ubuntu, Solaris, Windows XP
Contact:

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

Post 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.
blisterpeanuts
Posts: 1
Joined: 31. Mar 2011, 17:19
Primary OS: openSUSE
VBox Version: OSE other
Guest OSses: WinXP

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

Post by blisterpeanuts »

Thank you!

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

Blister
manuelpf
Posts: 2
Joined: 9. Jan 2014, 10:55

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

Post 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?
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

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

Post 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?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
manuelpf
Posts: 2
Joined: 9. Jan 2014, 10:55

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

Post 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.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

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

Post by noteirak »

Just delete it after the VM was creading by editing the VM settings.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
socratis
Site Moderator
Posts: 27330
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

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

Post 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 15151 times
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply