Howto Auto mount a drive in DOSBOX
Sponsored Link
Install dosbox in ubuntu
Open terminal window and type the following command
sudo apt-get install dosbox
Howto Automount drive
Open a terminal session, and it should take you to your home directory. If not, type cd /home/yourname/
Create a directory to store your DOS programs in. I called mine dosprog, so I typed mkdir dosprog The full pathname to this file is home/yourname/dosprog
Open dosbox by typing dosbox
You are now in the dosbox shell. Neat, huh? Note that it automatically puts you at the Z:\ drive We want to change that. Try typing in the dos command C: Note that it says the drive doesn't exist. We could mount the C drive everytime we open dosbox by typing mount c /home/yourname/dosprog everytime, but why do that whendosbox can create a configuration file to take care of that for you! But first we need to create the file.
At the dosbox Z:\ prompt, type in config -writeconf /home/yourname/dosbox.conf You now have the configuration file.
Type exit. This puts you back in your terminal session
Type sudo gedit dosbox.conf This will open the dosbox configuration file.
Scroll down the dosbox.conf file to this section
[autoexec]
# Lines in this section will be run at startup.Type the following in on a new line:
mount c /home/yourname/dosprog
This will automatically mount the C: drive to your dosprog directory.
If you want dosbox to automatically start on the C: drive, enter C: on a new line after your mount line.
Save and quit gedit.
Now at the terminal prompt, type in dosbox It should auto mount the C: drive, (and if you followed step 8a, it will also start you on the C: drive)
Manually Mounting a CD-ROM
Place a CD in your CD-ROM. Ubuntu will happily auto-mount the CD for you to /media/cdrom0 assuming that you placed teh CD in that drive. If you have more than one CD-ROM drive Ubuntu may will have mounted it to /media/cdromx where x is a number. Now that we're done with that OS stuff back to DosBox.
Type mount d /media/cdrom0 -t cdrom
Now your CD is mounted in DosBox to the D: drive. Again if you'd like to test this type, D: and press enter. Now type dir and press enter. You should again get a listing of all items on the CD.
Mounting a directory to a drive in DosBox
Open triminal windows and type the following command
dosbox
This launches DosBox in a new window, and starts you with a Z:\ prompt
So now on to really mounting a drive. I suggest you mount a directory that you have permission to write to (as a user, not a superuser). Your home directory (/home/username) works nicely.
Type mount c /home/username
This mounts your home directory to the C:\ drive in DosBox. If you'd like to test this, type C: and press enter.
Now type dir and press enter. Just as in DOS, you will get a listing of all items in your directory.
Hey,
This is missing one vital piece of info. To use your new configuration file with dosbox you have to tell dosbox where it is when you start it.
So if you used this command inside dosbox:
config -writeconf /home/yourname/dosbox.conf
You have to run Dosbox with the following commandline in a terminal or an app launcher:
dosbox -conf /home/yourname/dosbox.conf
This will then load your customised .conf file, including any mounting you have put in the [Autoexec] section.
Hope that helps,
Dom.
Is that really necessary? On my system, after following admin’s suggestions, typing “Dosbox” in the terminal starts Dosbox with the new configuration settings. No need for any command line arguments…
frits
when you mount and boot from an image, how can you use other Psychical drives with it?
like I mount a win95 image, and my flashdrive, win95 boots fine, but my flashdrive will not show up!!
Except Warcraft 2, won’t be using CD audio just plain MIDI.
I’m after a way to get Warcraft 2 to use cd audio.
Alright… I’m using Linux here. I can get Dosbox to read a dosbox.conf file when it is in my home (~) directory. However, I’d like to put the dosbox.conf file in my ~/Dos_Games directory. Whenever I do that, Dosbox won’t run the file! It runs it fine when I have it in ~ though.
Any ideas?
omg Dominic thank you so much! I knew everything was set up right. I just couldnt get how to connect dosbox to the config file. worked perfectly on xp but not on ubuntu. now I have a shortcut on my desktop and everything’s in place.
Oh and if your arrow keys aren’t working, type this into the terminal just once and it’ll be fixed forever. Hasnt caused me any problems so far.
echo -e “[sdl]\nusescancodes=false\n” >>~/.dosboxrc
an easier way to set up an autoexec file. make a text file. put in these command lines. assuming it is c:\ drive and dosprog folder.
[autoexec]
mount c c:\dosprog
c:\
save this then change the file name to dosbox.conf and put in your dosbox folder.
ok, so i have POS software shared from a windows server.
in dosbox on a windows system:
i first mount the windows share as a local filesystem.
i setup a lpt1 redirect “net use lpt1 \\server\printer”
i then config dosbox to mount that drive.
i can then run the POS in the dosbox, and print to the network printer.
how can i do the same with dosbox on ubuntu?
i’ve mounted the shared filesystem via fstab, but dosbox can’t see it.
i cannot find a way to set up the lpt1 redirect.
help! this is a show stopper for ubuntu, as i must be able to run the POS software.
Gaz: See the first post by Dominic. You have to tell it where your dosbox.conf file is.
to make this global, put the conf file in the /etc directory.
ie.
/etc/dosbox.conf
it worked as clockwork…..
thanx buddy 😀
Thanks, this is exactly what I was looking for
Hi,
I’m new with DosBox and I will use it to run some old DOS programs I have on floppy disk. I’ve a external floppy disk (USB). Ubuntu 10.04 put this drive under Computer with the name Floppy Disk.
Anyone a idea how to mount this Floppy Disk in DosBox?
Hi,
Please send the steps. how to setup printer in dosbox0.74 and i am use Ubuntu 11.10 OS.
Please help me.
Thanks
Regards
Rampal
Hi,
I am using Dosbox-0.74 for fox-pro application. But i can’t find net use command for printer
Thanks in Advance
Rampal
An error occurred while I performed the instructions by adim and Linuxdoctor: there is no /media/cdrom0 in my system (only /media), even when CD is in the driver. I tried both /media/cdrom0 and /media only and both failed. The former, said that such directory doesn’t exist, and the in the latter, the mounting went well, but the CD was not found.
What should I do?
Thank you in advance!
Yuri
needed to have the command after doing what is mentioned than just put dosbox on desktop and in the properties add the command as given
dosbox -conf location_of_config_file
Still works in 2019.
There is a good way to manage different configurations of Dosbox. Just create catalog /conf/ with dosbox.conf files and catalog with *.sh files with commands like this:
dosbox -conf /home/yourname/dosbox/conf/dosbox.conf