6. Running dosemu as a normal user

This section of the document by Hans, <lermen@fgan.de>. Last updated on Jan 21, 2003.

  1. In the default setup, DOSEMU does not have root privileges. This means it will not have direct access to ports, external DOSish hardware and won't use the console other than in normal terminal mode, but is fully capable to do anything else. See the previous section on how to enable privileged operation if you really need to.

  2. If a user needs access to privileged resources other than console graphics, then you may need to explicitly allow the user to do so by editing the file /etc/dosemu.users (or /etc/dosemu/dosemu.users). The format is:

             loginname [ c_strict ] [ classes ...] [ other ]

    For example, to allow joeuser full access you can use

             joeuser c_all

  3. The msdos partitions, that you want to be accessable through Section 5 should be mounted with proper permissions. I recommend doing this via 'group's, not via user ownership. Given you have a group 'dosemu' for this and want to give the user 'lermen' access, then the following should be

    • in /etc/passwd:

               lermen:x:500:100:Hans Lermen:/home/lermen:/bin/bash
                            ^^^-- note: this is NOT the group id of 'dosemu'

    • in /etc/group:


    • in /etc/fstab:

               /dev/hda1 /dosc msdos defaults,gid=200,umask=002 0 0

    Note: the changes to /etc/passwd and /etc/group only take place the next time you login, so don't forget to re-login.

    The fstab entry will mount /dosc such that is has the proper permissions

           ( drwxrwxr-x  22 root     dosemu      16384 Jan  1  1970 /dosc )

    You can do the same with an explicit mount command:

              mount -t msdos -o gid=200,umask=002 /dev/hda1 /dosc 

    Of course normal lredir'ed unix directories should have the same permissions.

  4. Make sure you have read/write permissions of the devices you configured (in /etc/dosemu.conf) for serial and mouse.

Starting with dosemu- there should be no reason against running dosemu as a normal user. The privilege stuff has been extensively reworked, and there was no program that I tested under root, that didn't also run as user. Normally dosemu will permanently run as user and only temporarily use root privilege when needed (during initialization) and then drop its root privileges permanently. In case of non-suid root (as of dosemu-0.97.10), it will run in lowfeature mode without any privileges.