7

I need to create an image to be able to mount the install DVD inside virtualbox in order to boot and install Windows.

Important: I need to do it using the command line.

I tried with genisoimage as suggested here and created an image using the command below but it turned out not bootable...

genisoimage -r -J -o cd_image.iso /cdrom

What I need is to RIP my original bootable DVD into a bootable IMAGE that I can mount in virtualbox.

So I thought I would ask how to A) convert that ISO file into a bootable one or B) re-create the ISO making it bootable with genisoimage or other command.

lpanebr
  • 1,277
  • I want to create an ISO image file so that I can boot a virtualbox machine from it. I don't want a USB stick.. I will check the mentioned question. – lpanebr Jun 16 '14 at 18:12
  • I need to do it from the command line. Will try to find info with dd – lpanebr Jun 16 '14 at 18:53
  • Use the original iso. How to create a custom windows install image is off topic here. – psusi Jun 17 '14 at 01:22
  • 1
    @psusi There is no original ISO in this case; the OP has a Windows installation CD/DVD. Furthermore, it's very unlikely this is off-topic, as it's really a question about how to rip a CD to an ISO while maintaining DOS/Windows style boot information. And considering that we actually have an open and highly upvoted question about how to create USB media for installing Windows (from Ubuntu), this question would probably be on-topic even if it were specific to installing Windows (which it is not). – Eliah Kagan Jun 17 '14 at 14:00
  • @EliahKagan, the original disc is the original iso. You just copy it rather than generating a new iso using the files copied off the disc. – psusi Jun 17 '14 at 14:14
  • @psusi I had the oiginal media but my computer does not have a DVD tray. So I needed a way to make an IMAGE from that media. I will try to improve my question to make it more on-topic. – lpanebr Jun 17 '14 at 14:28
  • What? Obviously you need a drive to read the disc. – psusi Jun 17 '14 at 14:50
  • 1
    @psusi Obviously there's two computers here, one of which has an optical drive. Also, most people use "iso" to mean "iso image file." It's rare and probably incorrect to call a physical disc with ISO-9660 compliant data written to it "an iso." Besides the answer that's already here, your comment, which is not specific to installing Windows, itself goes a long way toward answering this. Maybe this is a duplicate; I don't think it's off-topic. – Eliah Kagan Jun 17 '14 at 16:03
  • @EliahKagan, in that case yes, it's a dup... shame it won't let you change your vote. – psusi Jun 17 '14 at 23:27
  • I can still report or delete. Duplicate of what question? – lpanebr Jun 18 '14 at 00:35
  • There is absolutely nothing off-topic about this question. Reopening. – Seth Jun 20 '14 at 17:42
  • @Braiam I re-edited the question because I had to do it from the command line and the marked duplicate answer does not address that. – lpanebr Jun 22 '14 at 11:18

2 Answers2

8

I found here how to do it using the dd command and as far as I can tell it will work for any bootable media.

The command below created a bootable DVD image of my Windows 7 installation disc from the Ubuntu command line:

dd if=/dev/cdrom of=/output/path/forYourImage.iso bs=2k

Note 1: the generated image will only be bootable if the source media is bootable.

Note 2: in my case, since I was on a headless server, I first used sudo lshw -c disk to find out where on /dev/ my cdrom drive was located.

Note 3: also in my case, the cdrom was not mounted so I had to mount it with sudo mount /dev/sr0 /cdrom

lpanebr
  • 1,277
  • 1
    Smoke and mirrors: you can just cp /dev/cdrom /output/path/forYourImage.iso. There is no dark art being mastered by dd. – starfry Oct 10 '18 at 18:09
3

To create a bootable ISO image, you have to specify to the command that you want this. By default, the ISO image you will create won't be bootable.

With genisoimage, you can use the following command line : genisoimage -b isolinux/isolinux.bin -c isolinux/isolinux.cat -r -J -o cd_image.iso /cdrom

Assuming that a directory called isolinux has been created under the root of your source directory from which you create the ISO file.

The file isolinux.cat will be created by the command, this is a catalog needed for the boot loader. The file isolinux.bin is the image of a bootloader, valid for a CD or DVD. These images are available in the syslinux package. Check that you have this package installed, if not perform

sudo apt-get install syslinux-common

Under /usr/share/syslinux you will find a predefined bootload, the file isolinux.bin.

More info on the official web site of Syslinux (generic Linux information)

Fabby
  • 34,259
Benoit
  • 7,567
  • 1
  • 25
  • 34
  • 2
    @EgyptBeast For the future: no need to leave a comment inside the text. That's what the comment field is for! ;-) – Fabby Jan 06 '15 at 16:14