7

Is there a graphical, preferably integrated with Dolphin, utility for mounting ISO images?

3

The best answer to your problem is to add contextual menus for Mount/Unmount in Dolphin, or service menus as they are called in KDE.

To do this, you need to:

  1. create the folder where the ISO will be mounted. (for this example I will use /mnt/iso)
  2. navigate to /usr/share/kde4/services/ServiceMenus
  3. create a new file with .desktop extension (I used iso.desktop)
  4. add the following lines:

    [Desktop Entry]
    Type=Service
    ServiceTypes=KonqPopupMenu/Plugin
    MimeType=application/octet-stream;
    Actions=mountISO;umountISO;
    
    [Desktop Action mountISO]
    Name=Mount
    Icon=utilities-terminal
    Exec=kdesu 'sudo mount -o loop,ro -t iso9660 "%f" /mnt/iso/'
    
    [Desktop Action umountISO]
    Name=Unmount
    Icon=utilities-terminal
    Exec=kdesu 'sudo umount "%f"'
    
  5. If kdesudo is available on you system instead of kdesu, then add the following lines instead:

    [Desktop Entry]
    Type=Service
    ServiceTypes=KonqPopupMenu/Plugin
    MimeType=application/octet-stream;
    Actions=mountISO;umountISO;
    
    [Desktop Action mountISO]
    Name=Mount
    Icon=utilities-terminal
    Exec=kdesudo 'mount -o loop,ro -t iso9660 "%f" /mnt/iso/'
    
    [Desktop Action umountISO]
    Name=Unmount
    Icon=utilities-terminal
    Exec=kdesudo 'umount "%f"'
    

OBSERVATIONS:

  • mounting to /media/iso instead of /mnt/iso will cause the mounted iso to conveniently appear as a read-only drive in Dolphin places.
  • in the ServiceMenus directory you can find other examples of how the file should be formatted.
  • the syntax is pretty so i will not describe it (please comment if you have questions).
  • this method works for only one ISO at a time, as they are all mounted in the same directory and I could not yet find a way to overcome this.
  • you will be prompted for password each time you mount/unmount
  • in the end it should look like this: problem solved!

Here is an app that does all of the above.

|improve this answer|||||
  • Please don't post just a link. Your post should make sense even if the reader does not choose to follow the link. See how to answer. – Gilles 'SO- stop being evil' Sep 4 '12 at 21:46
  • There's kdesudo ... – daisy Sep 5 '12 at 10:54
  • This actually made Dolphin crash every time I right-clicked on something. Then I downloaded a service menu that provides a similar script and menus, and now everything works butter smooth. Thank you! – missingfaktor Sep 13 '12 at 8:09
  • Not sure if this hits anyone else, but in Plasma5/KF5, the directory is $KF5/share/kservices5/ServiceMenus, and at least for my kdesu installation, I needed to prepend the commands with -c, eg Exec=kdesu -c 'sudo mount .....' – chrisb2244 Jun 3 '15 at 5:25
  • this doesn't work anymore in Plasma 5.8 – user32012 Feb 13 '18 at 12:35
2

Simple service menu based on KDE-Services and Mount ISO image (more details here):

 kate ~/bin/iso_manager-mount-image.sh 

With this content (pasting this here in order to avoid the need of installing KDE-Services or uploading the script):

#!/bin/bash

#################################################################
# For KDE-Services. 2012-2017.                  #
# By Geovani Barzaga Rodriguez <igeo.cu@gmail.com>      #
# Improved by Victor Guardiola (vguardiola) Jan 5 2014      #
#   -Fixed the problem of [dir|file]name with whitespaces.  #
#################################################################

PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/$USER/bin
MOUNTEXIT=""

##############################
############ Main ############
##############################

cd "${1%/*}"

if [ "$1" == "${1%.*}.iso" ]; then
   fuseiso -p "$1" "${1%.iso}"
   MOUNTEXIT=$?
else
   rename .ISO .iso *
   kdialog --icon=ks-error --title="Mount ISO-9660 Image" \
                   --passivepopup="[Error] Can't mount ${1##*/}: Renamed extension of ISO image, because contain uppercase characters. Please try again."
   exit 1
fi

if [ "$MOUNTEXIT" = "0" ]; then
   kdialog --icon=ks-media-optical-mount --title="Mount ISO-9660 Image" --passivepopup="[Finished] ${1##*/} mounted."
else
   kdialog --icon=ks-error --title="Mount ISO-9660 Image" \
                   --passivepopup="[Error] Can't mount ${1##*/}: Already mount or check image integrity."
   exit 1
fi

exit 0

Then:

kate ~/.local/share/kservices5/ServiceMenus/mount-iso.desktop

with this content:

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/x-cd-image;model/x.stl-binary
Actions=mount;unmount;
X-KDE-Priority=TopLevel
X-KDE-StartupNotify=false
Icon=application-x-cd-image
X-KDE-Submenu=Mount/unmount image


[Desktop Action unmount]
Name=Unmount
Icon=edit-redo
Exec=which fuser fusermount; if [ "$?" != "0" ];then kdialog --icon=ks-error --title="Unmount ISO-9660 Image" --passivepopup="[Error] Please install fuser and fusermount command and try again."; exit 1; else fuser -k %f; fusermount -u "$(ls "%f"|sed 's/.iso$//')"; rm -fr "$(ls "%f"|sed 's/.iso$//')"; kdialog --icon=ks-media-optical-umount --title="Unmount ISO-9660 Image" --passivepopup="[Finished] $(basename %f) unmounted.";fi

[Desktop Action mount]
Name=Mount
Icon=circular-arrow-shape
Exec=which fuseiso; if [ "$?" != "0" ];then kdialog --icon=ks-error --title="Mount ISO-9660 Image" --passivepopup="[Error] Please install fuseiso command and try again."; exit 1; else ~/bin/iso_manager-mount-image.sh %F;fi

enter image description here

It will mount the image in a newly created folder inside the same directory as the image, and that folder will be deleted when the unmount option is selected for the iso.

fuser, fusermount, fuseiso and kdialog are needed."


Acetoneiso comes in Plasma 5 with only three supplementary packages: fuseiso and other two that are qt-based.

sudo apt install acetoneiso

To see it in Dolphin you have to add the program to the file properties of the iso file.

enter image description here

Then, it can be found in Dolphin under the Open with option:

enter image description here

That will mount the image, open it in Dolphin, and also open the Acetineiso window, where you can find the Unmount option.

enter image description here


There is also gnome-disk-utility which, in spite of the name, comes without non-kde dependencies in Plasma 5.8 (in fact no dependencies at all), and it includes (beside gnome-disks, also called "Disks", default in Ubuntu) a tool called gnome-disk-image-mounter.

sudo apt-get install gnome-disk-utility

After that, a Dolphin context menu entry is created, accessible by selecting 'Open with' - 'Disk Image mounter'.

enter image description here


These programs could be used with a service menu also (but they both lack an unmount command).

For example, one could use this with Acetoneiso:

kate ~/.local/share/kservices5/ServiceMenus/acetoneiso-mount-iso.desktop 

with the content:

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/x-cd-image
Actions=mount
X-KDE-Priority=TopLevel
X-KDE-StartupNotify=false
Icon=application-x-cd-image
X-KDE-Menu=Mount with Acetoneiso



[Desktop Action mount]
Name=Mount with Acetoneiso
Icon=Acetino2
Exec=acetoneiso %f

enter image description here


There seem to be a sort of bug here when using this programs with Dolphin: unmounting from the Acetoneiso button or from the Dolphin devices list, the list entry will remain there (called 'Loop device' in the case of gnome-disks) which, if selected, will again mount the image. That entry will stay there until system restart (logout is not enough). (The first script is not affected by this.)

|improve this answer|||||
  • 1
    This is probably the simplest, sanest option for most users. – iLikeDirt Aug 14 '17 at 16:22
  • @iLikeDirt - I have updated the answer to give multiple solutions, including a simplified script that I prefer. – user32012 Feb 13 '18 at 13:15
  • opendesktop.org/p/1214091 – user32012 Feb 13 '18 at 14:55
  • I have noticed that in Ubuntu 18.04, in order for a Dolphin context service menu to work for iso files, the desktop file needs model/x.stl-binary for the Mimetype line. – user32012 Jun 25 '18 at 7:15
  • AcetoneISO (like FuriusISOMount) does not adapt file permissions when mounting. So I can't install run script (e.g. for installing software) from the mounted ISO. Any solution for that? – Silicomancer Feb 7 at 16:10
1

You can try either acetoneiso or EasyISO

acetoneiso can be found in Ubuntu.

And source code of EasyISO was here

enter image description here

Just drag the image in, and double to open the mounted folder.

|improve this answer|||||
0

Marius Cotofana provided a great answer, but here are two additional notes:

  1. When kdesu is not available in your KDE configuration (if the kdesu command doesn't work in bash/konsole), use kdesudo to create the mount/unmount context menus in Dolphin.

  2. Creating /media/iso and mounting the image to that will cause the image to show up in places under Dolphin as read only which provides additional conveniences.

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/octet-stream; Actions=mountISO;umountISO;

[Desktop Action mountISO]
Name=Mount
Icon=utilities-terminal
Exec=kdesudo 'mount -o loop,ro -t iso9660 "%f" /media/iso/'

[Desktop Action umountISO]
Name=Unmount
Icon=utilities-terminal
Exec=kdesudo 'umount "%f"'

|improve this answer|||||
0

Combining all the above answers, this works perfect for me on Kubuntu 19.10 in 2020. No kdesu or kdesudo needed. Only downside is it doesn't report errors, it fails silently.

kate .local/share/kservices5/ServiceMenus/iso_mounter.desktop

And add this config:

[Desktop Entry]
Type=Service
ServiceTypes=KonqPopupMenu/Plugin
MimeType=application/x-cd-image;application/octet-stream;
Actions=mount;umount;
X-KDE-Priority=TopLevel
X-KDE-StartupNotify=false
Icon=media-import-audio-cd
X-KDE-Submenu=Mount/Unmount Image

[Desktop Action mount]
Name=Mount
Icon=media-import-audio-cd
Exec=pkexec 'env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY mount -o loop,ro -t iso9660 "%f" /media/iso/'

[Desktop Action umount]
Name=Unmount
Icon=media-eject
Exec=pkexec 'env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY umount "%f"'
|improve this answer|||||
-2

what is "Linux"??

In my Ubuntu 12.04, you only need:

  1. search .iso file
  2. right click over
  3. Select the first option: "Open with Archive mounter"

Then a CD icon appears on net group of the file browser. That's all!

|improve this answer|||||
  • 1
    You are likely using GNOME/Unity + Nautilus. My question is about KDE + Dolphin. – missingfaktor Sep 4 '12 at 11:57
  • Fwiw, I am using Linux Mint 13, KDE edition. – missingfaktor Sep 4 '12 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.