How to access ISO image connected to virtual machine?

32,338

Solution 1

As suggested, you could manually (on command line) mount the ISO image:

sudo mount -t iso9660 /dev/cdrom /media

Or - if this is vm has a graphical desktop installed - you could use GUI tools instead of the command line. For example, if KDE is installed, you could use Dolphin to mount the virtual CD.

Then install it and unmount it when you're done. Either by using the same graphical tool you used for mounting (right-click on the drive in Dolphin) or manually:

sudo umount /media

However, it sounds like you've created an iso image just to copy an rpm file from the host to the guest system, which is kind of a detour. It's probably easier to configure a shared folder on the host system and copy the rpm there, however VMware tools have to be installed for this to work.

If all you want to do is copy one rpm file to the guest, then creating a simple NFS share is probably the easiest and most convenient way to go. You would create a shared directory on the host:

sudo mkdir -m 1777 /data/Share

This assumes that /data already exists; permissions are increased so that all users may write into this directory; modify the path so that it fits your needs (for example, name it "share" if all your shares have lower case names). If you are the only user, it might be more appropriate to create the directory in your home:

mkdir ~/Share

Then add this directory to the list of exported NFS shares (/etc/exports):

/data/Share *(rw)

You might want to specify your own (local) ip address or subnet, depending on how your vm network is set up, because * will make this directory available for every computer, which may not be what you want. The man page (man 5 exports) lists a few examples.

Don't forget to confirm the changes.

sudo exportfs -r

Then open your vm and create a mountpoint:

sudo mkdir -m 0 /mnt/Share

The -m 0 (no permissions) is optional, it will make it more obvious if the share is not mounted (you'd get an error instead of an empty directory when accessing it), so you won't accidentally fill up your local (virtual) drive with files. It won't affect the share as long as it's mounted.

Add the mount to /etc/fstab to make it permanent (replace HOST with the ip of your host system, from the guest's perspective):

HOST:/data/Share /mnt/Share nfs defaults 0 0

If everything works as expected, your share will be available after you restart the (guest) system. But try mounting it anyway:

sudo mount /mnt/Share

You can use this shared directory with whatever tool (graphical file managers or command line) you want. You can copy the rpm file (host) to /data/Share and directly access/use it in /mnt/Share (guest). As far as copying single files between host and guest is concerned, this should be much easier than wrapping everything in iso files.

Hope this helps.

Solution 2

Fedora17 does not (checking...) automatically mount and show the cdrom. You can do this by

sudo mount /dev/cdrom /media

in a terminal window, and

cd /media
ls -l

to start finding your files. Something like

sudo yum install *.rpm

might be the next step.

If you repeat the mount command, it will report the latter (that it is already mounted). You can unmount that device by any of these commands

umount /media
umount /dev/cdrom
eject
Share:
32,338

Related videos on Youtube

Liban
Author by

Liban

Updated on September 18, 2022

Comments

  • Liban
    Liban over 1 year

    I am new to Linux environment and i want to install a package to a virtual machine. I have vmware esxi server, and i installed a virtual machine with fedora17 OS. My intention is to install Dropbox on the virtual machine.

    I searched ways to transfer the rpm file to the virtual machine and i am following the ISO image method.

    I made an ISO image for the rpm package of the Dropbox and i connected the virtual machine to ISO image. so now how to access the ISO image and the files it contains? any steps on how to do it?

    in other words, how can i install the Dropbox package in the ISO image?

    Thanks a lot

  • Liban
    Liban almost 9 years
    when i do sudo mount /dev/cdrom/media it says : mount: you must specify the file system type how to add the filesystem type?
  • Thomas Dickey
    Thomas Dickey almost 9 years
    You left out the space between "/dev/cdrom" and "/media". Fedora 17 does not require a filesystem-type option for mounting this device. (My /etc/fstab does not mention the cdrom, and I typed the command exactly as given).
  • Liban
    Liban almost 9 years
    ok i did type now exactly as with the space, it says : mount : /dev/sr0 is write-protected, mounting read-only , mount: /dev/sr0 is already mounted or /media busy