Jump to content

a virtual CD/DVD program?


yellowchicken
 Share

Recommended Posts

No extra program needed to do that ! :headbang:

 

All you need to do is mount your iso image in a directory of your choice, yeah, its that simple ! :lol2:

 

For example, we are mounting the file Mandrake_DVD.iso into the MDKDVD directory on my home partition, so we do (as root):

 

mount -o loop -t iso9660 Mandrake_DVD.iso /home/feralertx/MDKDVD

 

And thats about it, you can use the MDKDVD directory as you like.

 

:lol: :lol:

Link to comment
Share on other sites

Is there a way to make the mount point mountable by a user rather than root?

 

I want to create a /mnt/iso mount point where a user can mount an iso file from the hardrive (specifically this is to be able to play homeworld without having to insert a CD, but I want /mnt/iso to be the generic mount point for iso in loopback).

 

when I try to do the mount it tells me that only root can do that.

 

Do I need to add something like that to my fstab:

dev/loop0 /mnt/iso auto umask=0,user,iocharset=iso8859-1,codepage=850,noauto,ro,exec 0 0

 

how do I know which loop device to use?

 

 

EDIT: I do not want to dedicate a permanent mount point to the iso (i.e. not do something like adding "/full/path/isoimage.iso /mnt/iso iso9660 loop,user,noauto 0 0" to fstab

Edited by papaschtroumpf
Link to comment
Share on other sites

You could use /dev/loop9 for example. I guess other tools using loop devices are unlikely to conflict with the use of loop9; they'd rather use loop0, I suppose.

 

So yes, you could add a line like that to /etc/fstab:

/dev/loop9 /mnt/img udf,iso9660,vfat,msdos user,ro,...

 

Then you could have a "mymount.sh" script like that

#!/bin/bash
# $1: file (.iso, .img...) to mount

losetup /dev/loop9 "$1"
mount /mnt/img

And "myumount.sh" script like that

#!/bin/bash

umount /dev/loop9
losetup -d /dev/loop9

 

I don't know if losetup requires root's privileges. You may have to configure sudo for allowing losetup without a password, and then add sudo in front of the lines beginning with losetup.

 

Then you only have to configure your favourite file-manager to execute mymount.sh when you "open" a .iso or .img file. And put a shortcut icon somewhere for the umount part. But if you do this, be sure to add some security to the scripts: don't mount if already mounted; don't umount if not mounted.

 

Yves.

Link to comment
Share on other sites

Letting users use losetup is not a security risk if:

- you check that "$1" is, and ONLY is, ONE file ([ -f "$1" ]);

- you give access to losetup with sudo, and only for parameters "/dev/loop9 *" and "-d /dev/loop9";

- you take care of /etc/fstab options, such as nodev,noexec...

- you make sure /dev/loop9 is not mounted, nor attached, before trying to attach&mount it.

 

Yves.

Edited by theYinYeti
Link to comment
Share on other sites

is it more secure than adding the following to my sudoers file:

papaschtroumpf ALL=/bin/mount -t iso9660 *.iso /mnt/iso/ -o loop\,ro\,user

or even:

papaschtroumpf ALL = NOPASSWD: /bin/mount -t iso9660 *.iso /mnt/iso/ -o loop\,ro\,user

 

it seems that either way I'm letting user papaschtroumpf mount any iso with user permissions.

 

The game startup script then looks like:

 

#!/bin/sh

# Shell script wrapper for running Homeworld with the proper library search

# location and mounting the ISO so you don't need to insert the disk

 

# remove any previous mount

sudo umount /mnt/iso

 

# mount the ISO and make sure we point the game to it

sudo mount -t iso9660 homeworld-linux.iso /mnt/iso/ -o loop,ro,user

export HW_CDROM=/mnt/iso

 

# launch the game

LD_LIBRARY_PATH=./lib:$LD_LIBRARY_PATH ./homeworld.bin $*

 

# now unmount the ISO

sudo umount /mnt/iso

Edited by papaschtroumpf
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...