This blog is subject the DISCLAIMER below.

Saturday, March 10, 2007

Linux Tip #4 : Virtual CD

Indeed sometime you have faced the situation that you have an ISO image and you want to use it as an actual CD but without burning it to a real CD. In windows you need to get some software to do that for you that usually create a virtual device etc.

In Linux you can do with a single line, mounting it to a folder.

Here's the command:
sudo mount -o loop -t iso9660 CD_IMAGE.ISO /path/to/folder

You give it the ISO file name and the path to the folder where you want to access it and it's all done for you! No device naming (A: G: I:...) required, no max number of virtual CD-ROM devices, none. Just that simple.

Enjoy.

http://www.linuxhelp.net/linux_downloads/

8 comments:

sh@dy said...

If we are talking just about ISO files (not other CD images file types) you can always use programs like winRar to read the file directly without mounting it (on windows environment)

Mohammad Nabil said...

I think there is some stubborn programs that insist on using a CD device on windows, that can't be handled just by un-raring it.
Here the case is different, any program will see it as a CD device...

Mohammad Nabil said...

this link: http://wiki.linuxquestions.org/wiki/CD_Image_Conversion
Shows how to convert from a lot of CD image formats to ISO, and these programs that does the conversion, run on Linux.

Mohammad Nabil said...

Thanks for the hint anyway :)

Adel Solaiman said...

salamo 3lekom
i'm sorry for that
but i cann't do that i don't know where is the problem
i typed that command:
sudo mount -o loop -t iso9660 AppDev - ASP.NET Using Visual C# 2005.ISO /mnt/ASP

but it didn't work right it gives me that:

Usage: mount -V : print version
mount -h : print this help
mount : list mounted filesystems
mount -l : idem, including volume labels
So far the informational part. Next the mounting.
The command is `mount [-t fstype] something somewhere'.
Details found in /etc/fstab may be omitted.
mount -a [-t|-O] ... : mount all stuff from /etc/fstab
mount device : mount device at the known place
mount directory : mount known device here
mount -t type dev dir : ordinary mount command
Note that one does not really mount a device, one mounts
a filesystem (of the given type) found on the device.
One can also mount an already visible directory tree elsewhere:
mount --bind olddir newdir
or move a subtree:
mount --move olddir newdir
One can change the type of mount containing the directory dir:
mount --make-shared dir
mount --make-slave dir
mount --make-private dir
mount --make-unbindable dir
One can change the type of all the mounts in a mount subtree
containing the directory dir:
mount --make-rshared dir
mount --make-rslave dir
mount --make-rprivate dir
mount --make-runbindable dir
A device can be given by name, say /dev/hda1 or /dev/cdrom,
or by label, using -L label or by uuid, using -U uuid .
Other options: [-nfFrsvw] [-o options] [-p passwdfd].
For many more details, say man 8 mount .

thanks for any advice
salam

Mohammad Nabil said...

sudo mount -o loop -t iso9660 'AppDev - ASP.NET Using Visual C# 2005.ISO' /mnt/ASP

You need to include the file name in quotes ( double or single quotes ) since it contains special characters like space, and dash. (space is the default splitter of command line parameters, you can precede it with backslash like this : AppDev\ -\ ASP.NET\ Using ......, dash represent the standard input file, I think you can precede it with back slash too. You precede them with backslash if you don't want to quote them)

A hint: if you are in the folder that contains the file, type the first few characters and press TAB it will autocomplete the file name correctly for you ( including the backslashes )

Adel Solaiman said...

thanks for your help
it's working well now

maxim said...

i have problem with kind of virtual cd any one know about virtual cd and it's extention is *.vd4 it work only in windows and i want to convert it to iso but in linux any one can help me
http://www.virtualcd-online.com/