2

I installed some CD based windows educational software in wine and it works great, except for some reason it can't find the disk unless I manually change the path from its default location G:/media/user/cdname/ to D:/media/user/cdname/, but this is reset back to G:/... every time I put in a new cd. Is there a way to permanently change this location to D? There are too many disks to virtually mount them from my hard drive

This is on ubuntu 19.04 and wine 4.7

edit- The output of ls -l ~/.wine/dosdevices is

total 0
lrwxrwxrwx 1 user_family user_family 10 Apr 30 18:08 c: -> ../drive_c
lrwxrwxrwx 1 user_family user_family 27 May  2 11:56 d: -> /media/user_family/Geom-9
lrwxrwxrwx 1 user_family user_family  8 May  2 11:43 d:: -> /dev/sr0
lrwxrwxrwx 1 user_family user_family  1 May  1 14:16 e: -> /
lrwxrwxrwx 1 user_family user_family  8 Apr 30 18:08 f:: -> /dev/sde
lrwxrwxrwx 1 user_family user_family 27 May  2 11:43 g: -> /media/user_family/Geom-9
lrwxrwxrwx 1 user_family user_family  8 May  1 15:33 g:: -> /dev/sr0
lrwxrwxrwx 1 user_family user_family  8 Apr 30 18:08 h:: -> /dev/sdc
lrwxrwxrwx 1 user_family user_family  8 Apr 30 22:15 i:: -> /dev/sdf
lrwxrwxrwx 1 user_family user_family 19 May  1 14:38 j: -> /home/user_family
lrwxrwxrwx 1 user_family user_family  8 May  2 11:44 k:: -> /dev/sdd
lrwxrwxrwx 1 user_family user_family  1 Apr 30 18:08 z: -> /

Following telcoM's solution makes the cd drove show up in the proper D:/ location as wanted. But I still need to go into winecfg every time i put in a new disk or the location points to the old disk and I get a no cd error in the program. It is enough to simply run winecfg to update the pointer to the new disk each time, but I would like to be able to start the program with no edits. here is the terminal output with no changes made to winecfg beside closing it:

user_family@user-pc-home:~$ ls -l ~/.wine/dosdevices
total 0
lrwxrwxrwx 1 user_family user_family 10 Apr 30 18:08 c: -> ../drive_c
lrwxrwxrwx 1 user_family user_family 27 May  3 09:25 d: -> /media/user_family/Alg2-2
lrwxrwxrwx 1 user_family user_family  8 May  2 11:43 d:: -> /dev/sr0
lrwxrwxrwx 1 user_family user_family  1 May  1 14:16 e: -> /
lrwxrwxrwx 1 user_family user_family  8 Apr 30 18:08 f:: -> /dev/sde
lrwxrwxrwx 1 user_family user_family  8 Apr 30 18:08 h:: -> /dev/sdc
lrwxrwxrwx 1 user_family user_family  8 Apr 30 22:15 i:: -> /dev/sdf
lrwxrwxrwx 1 user_family user_family 19 May  1 14:38 j: -> /home/user_family
lrwxrwxrwx 1 user_family user_family  8 May  2 11:44 k:: -> /dev/sdd
lrwxrwxrwx 1 user_family user_family  1 Apr 30 18:08 z: -> /
user_family@user-pc-home:~$ winecfg
000b:fixme:winediag:start_process Wine Staging 4.7 is a testing version containing experimental patches.
000b:fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
0019:fixme:ntoskrnl:ObDereferenceObject failed to release 0x1bc50
0019:fixme:ntoskrnl:ObDereferenceObject failed to release 0x1cd40
0019:fixme:ntoskrnl:ObDereferenceObject failed to release 0x1bb70
user_family@user-pc-home:~$ 
user_family@user-pc-home:~$ ls -l ~/.wine/dosdevices
total 0
lrwxrwxrwx 1 user_family user_family 10 Apr 30 18:08 c: -> ../drive_c
lrwxrwxrwx 1 user_family user_family 28 May  3 09:36 d: -> /media/user_family/Geom-10
lrwxrwxrwx 1 user_family user_family  8 May  2 11:43 d:: -> /dev/sr0
lrwxrwxrwx 1 user_family user_family  1 May  1 14:16 e: -> /
lrwxrwxrwx 1 user_family user_family  8 Apr 30 18:08 f:: -> /dev/sde
lrwxrwxrwx 1 user_family user_family  8 Apr 30 18:08 h:: -> /dev/sdc
lrwxrwxrwx 1 user_family user_family  8 Apr 30 22:15 i:: -> /dev/sdf
lrwxrwxrwx 1 user_family user_family 19 May  1 14:38 j: -> /home/user_family
lrwxrwxrwx 1 user_family user_family  8 May  2 11:44 k:: -> /dev/sdd
lrwxrwxrwx 1 user_family user_family  1 Apr 30 18:08 z: -> /
user_family@user-pc-home:~$ 

I thought maybe I was too specific so i tried to use the higher level folder D:\media\user-family\ in winecfg and hoped it would pick out the appropriate sub-folder automatically when I put the new disk in, but that didn't work, and winecfg rewrite it to the full path anyway when I ran winecfg a second time.

  • I believe that this question belongs on Super User. – Scott May 2 '19 at 2:36
  • @scott I posted here because most of the wine related questions I see on stack exchange are from here, but I can post there too. should I delete this question? – mother brain May 2 '19 at 3:06
  • If you run ls -l ~/.wine/dosdevices, what is the output? Please edit the answer into your original question post. – telcoM May 2 '19 at 5:41
  • @sourcejedi I redid it and got something different, so I must have typed something wrong. I edited my post with the correct output – mother brain May 2 '19 at 19:05
  • @Scott why? wine only works on Unix systems (mainly on Linux). – mosvy May 2 '19 at 20:48
0

Note that in the ~/.wine/dosdevices directory both d: and g: symbolic links point to /media/user_family/Geom-9 (which I assume is the mountpoint of the CD) and both d:: and g:: point to /dev/sr0 which is the device for the CD drive.

While Wine is not running, delete the extra g: and g:: symbolic links:

rm ~/.wine/dosdevices/g: ~/.wine/dosdevices/g::

Once the duplicates have been removed, your CD drive should stay as D:.


The second problem, the fact that each disc gets mounted into a different path, is a consequence of using the udisks2 subsystem for handling the removable devices. For security reasons, udisks2 will not allow the user requesting the mount to influence the selection of the mount point in any way.

By default, it mounts CDs for any local user, in location /media/<username>/<CD volume name>. By setting ENV{UDISKS_FILESYSTEM_SHARED}="1" in an udev rule applying to your CD drive, you could change the default path to just /media/<CD volume name>. But this does not help you, as the volume label of the CD is still used as part of the name of the mount point, and that is something wine is not programmed to expect at all - at least not yet.

But you could try putting this line into your /etc/fstab file:

/dev/sr0 /media/cdrom iso9660,udf ro,noauto,user 0 0

Then use sudo mkdir /media/cdrom to create an empty directory that will be used as a mount point for all your CDs.

This should override udisks2's treatment of your CD drive, and tell the system that any CD should be mounted to that specific mount point, regardless of what its volume label is. This is the old-school way of using CD drives in Linux, and that is what wine currently expects.

But when a CD drive is listed in /etc/fstab, then udisks2 may or may not skip it altogether: you might lose the GUI-based mount functionality for the CD drive (I haven't verified this on Ubuntu 19.04). But if so, you should now be able to use mount /media/cdrom and umount /media/cdrom commands as a regular user, without even using sudo. So it would be quite simple to write a script with three commands:

#!/bin/sh

mount /media/cdrom     # mount the CD before starting wine
wine <your educational program and its options, if any>
umount /media/cdrom    # unmount the CD after wine exits

...and then use that script (possibly dressed up as a nice GUI icon or menu item) to run the educational program.

  • This answered my question perfectly and I gave you an upvote. Before I close it out, I have one problem still happening that seems to be too small to make into a separate thing and seems to be related to the question and your solution, I edited the end with the extra info. If you think it should be a new question then I will accept your solution and post a new one – mother brain May 3 '19 at 17:01
  • :-) Accepting an answer does not mean closing the thread here. The idea of StackExchange is subtly different from an ordinary discussion forum: here, the goal is to have meaningful questions and answers that can help others with the same problem. If something later changes and an old answer is no longer accurate, anyone who notices the error is invited - or almost expected - to add a new, updated answer, and/or edit the old one to note that things have changed. – telcoM May 5 '19 at 23:13

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.