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

This is for discussing general topics about how to use VirtualBox.

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

Postby seipp orion » 5. Apr 2012, 04:57

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!
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

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

Postby Leak » 5. Apr 2012, 10:27

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...
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

Postby seipp orion » 6. Apr 2012, 08:17

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.
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

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

Postby blisterpeanuts » 5. Apr 2013, 15:31

Thank you!

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

Blister
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

Postby manuelpf » 9. Jan 2014, 11:02

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?
manuelpf
 
Posts: 2
Joined: 9. Jan 2014, 10:55

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

Postby socratis » 9. Jan 2014, 12:10

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?
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 18126
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5

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

Postby manuelpf » 10. Jan 2014, 12:38

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.
manuelpf
 
Posts: 2
Joined: 9. Jan 2014, 10:55

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

Postby noteirak » 10. Jan 2014, 13:23

Just delete it after the VM was creading by editing the VM settings.
Hyperbox - Virtual Infrastructure Manager - https://kamax.io/hbox/
Manage your VirtualBox infrastructure the free way!
noteirak
Site Moderator
 
Posts: 5182
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7

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

Postby socratis » 11. Jan 2014, 12:14

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 8948 times
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
socratis
Site Moderator
 
Posts: 18126
Joined: 22. Oct 2010, 11:03
Location: Greece
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5


Return to Using VirtualBox

Who is online

Users browsing this forum: Google [Bot] and 18 guests