Install dosemu at a console, Accessories ‣ Terminal, with the commands:
sudo aptitude install dosemu xauth
sudo sysctl -w vm.mmap_min_addr=0
sudo bash < <(echo 'echo "vm.mmap_min_addr=0" >> /etc/sysctl.conf')
The DOS system can be started from Applications ‣ System Tools ‣ DOS emulator.
Note
xauth is required for remote X11 execution over ssh. Some versions of Ubuntu (8.04, for example) omit this package.
Change dosemu configuration with commands to edit either global configuration file sudoedit /etc/dosemu/dosemu.conf or user file nano ~/.dosemurc.
Emulate the DOS 640X480 EGA/VGA display with the command:
echo '$_X_font = vga12x30' >> ~/.dosemurc
The following command would change this setting globally for all users:
sudo sed -ie "/$_X_font/c\$_X_font = vga12x30" /etc/dosemu/dosemu.conf
Note
DOS video configurations include: vga, vga8x19, vga11x19, vga10x24, vga12x30, vga-cp866, and vga10x20-cp866.
To make dosemu run faster for the current user, add a command:
echo '$_hogthreshold = (xx)' >> ~/.dosemurc
where xx is the percentage of CPU time to devote to dosemu, which defaults to 1 percent.
To start an interactive DOSemu session, type dosemu at the console or select Applications ‣ System ‣ DOS emulator from the system menu.
Exit the command line of an interactive session by typing exitemu or by pressing Control-Alt-PgDn.
Press <Shift-Ctrl-Alt-K> to switch into and out of keygrab mode in DOSEMU. The <Shift> is required in KDE, optional in Gnome and maybe other desktops.
A DOS program may be executed from the Linux command line by calling dosemu followed by the name of the DOS program (.bat, .exe, .com) to execute. When the called program exits in DOSemu, the DOSemu session will close.
If other commands are required in the context of the DOS program, then a shell script may perform the complete task. For example, suppose program WARES would change shared file permissions from public to private when executed by a user not in group __USERS__. Issuing a chmod command after executing WARES would fix permissions. A script wares.sh for this purpose could be created with command nano ~/wares.sh:
dosemu C:\WARES.BAT
sudo chmod -R 777 /home/samba/shares/wares/*
Make the shell script executable with command chmod +x ~/wares.sh. Finally, run the DOS session by typing ~/wares.sh at the console.