Installing and Using DOSBox-x on Linux

Jarret B

Well-Known Member
Staff member
Joined
May 22, 2017
Messages
364
Reaction score
403
Credits
13,257
Before Linux and even Windows, there was Disk Operating System (DOS), or more specifically Microsoft DOS (MS-DOS). DOS was an 8 and 16-bit Operating System (OS), depending on the processor it was running on, and went through various versions and even knock-offs from other companies, such as IBM (PC DOS).

You can run DOSBox-x on Linux which 'emulates' DOS and lets you play DOS games. It is even possible to install Windows 1.0 up to Windows ME.

Installation

Installation is easy. You'll need SNAP, so just run the commands:

Code:
sudo apt install snap -y
sudo snap install dosbox-x

After you install it, you can start DOSBox-x with:

Code:
dosbox-x

Once started, you’ll see another window open, similar to a terminal, that will look like Figure 1.

Figure 1.JPG

FIGURE 1

If you run the command 'ver' it will give the DOSBox version and the 'reported DOS version 5.00'.

This is the base Operating System for DOSBox-x and we will create disk images to load and use instead.

Let's see if we can get this upgraded to DOS 6.22.

Setting up Software

Technically. We aren't upgrading DOSBox-x to DOS 6.22; we are creating an image that will run DOS 6.22.

NOTE: To get the images for DOS or Windows, you need to go to a website:
So, in this way, you can run DOS or Windows on Linux and not really require WINE. Of course, DOS and the older versions of Windows run better. The DOSBox-x emulation works at up to a 32-bit Operating System. I'll change hardware settings once we require it.

Download the IMG files for DOS 6.22 from 'https://winworldpc.com/download/c38...2ac/from/c39ac2af-c381-c2bf-1b25-11c3a4e284a2'.

The four disks will need to be extracted, but you only need the first three ('Disk1.img', 'Dosk2.img', 'Disk3.img'). We will not use the Supplemental Disk ('Suppdisk.img').

When using DOSBox-x in Linux, the default folder for loading files is your Home folder. Unfortunately, it has issues if you use the tilde (~) for specifying absolute folders.

So, it is best for now to place any needed files in the Home folder, or in another folder within the Home Folder. On my system, I made a folder named 'Dosbox' in the Home directory. The 'Dosbox' folder is where I stored all the hard drive images I created. You can place the disk images into the 'Dosbox' folder as well.

Creating DOS 6.22 Hard Disk

I will assume you have a 'Dosbox' folder as well. You can change the names as you need. When you specify a folder in DOSBox-x, it is based on Home being the current folder.

Place your needed DOS 6.22 image files where you want them.

From a terminal, type the command:

Code:
dosbox-x

Once the new window appears, as in Figure 1, you can create an empty hard disk image to use for installing DOS 6.22.

Use the following command to create a new image:

Code:
imgmake Dosbox/dos622.img -t hd -size 2048

Be aware that folder and filenames are case-sensitive since the commands are being handled by Linux in the background. Dosbox creates the file as '/home/jarret/Dosbox/dos622.img'. In your case, the Home folder will have a different location since you will use a different username. When I reference any file in DOSBox-x, the Present Working Directory (PWD) from DOSBox-x is '/home/jarret', in my case.

The previous command creates a hard disk (hd) image that is 2 GB in size with a name of 'dos622.img'. Its location is in the 'Dosbox' folder. It is this file we will mount and use it to install and run DOS 6.22. Keep in mind that the partition size limit is 2 GB on DOS's FAT 16.

Now that we have a 'hard disk', we can load everything and get DOS 6.22 started. To load the disks, we use the following command:

Code:
imgmount c Dosbox/dos622.img -t hdd[/copy]

It should respond to the command, if typed correctly, and load Drive C.

Now, we have a disk mounted that is not partitioned or formatted.

We can boot from the DOS disks. Since there are three disks, we need to boot from all three. Place them in the home folder and issue the command:

[code]boot disk1.img disk2.img disk3.img

The command boot can boot from a mounted drive or unmounted media. Here, it is unmounted media. If you place the files in a different location than Home, you need to specify the location on each file.

Once you press ENTER, DOSBox-x should start booting from the first disk in the 'boot' list. When it asks for Disk 2, press 'F12+O' to get to the next disk in the boot list you entered. Once you do this, you can press ENTER to designate that you switched the floppy disk.

After you install DOS, it will reboot the system and you will find yourself back at the DOSBox-x prompt. So, to load DOS 6.22, do:

Code:
imgmount c Dosbox/dos622.img -t hdd
boot c:

Since DOS is on the image we are mounting as Drive C, we can boot from the drive. DOS should load and start.

Automation, Kind of

Instead of typing in the commands over and over, we can create a folder, such as 'batch', in the Home folder. Within the 'batch' folder will be batch files which we can mount the 'batch' folder, then just run the specific batch file you need so you do not have to type in the commands over and over.

When installing some Windows systems, the system will reboot and you'll need to remount and reboot. This requires you to retype everything. So, you only need to type it once.

So, how can we automate adding this new folder? There is a file menu at the top of the Dosbox-x screen. Click on 'Main' and then 'Configuration Tool'. You should then see a menu, as shown in Figure 2.

Figure 2.JPG

FIGURE 2

In the bottom left corner is a button labeled 'Autoexec.bat'. Click on this so you can edit the 'Autoexec.bat' file and add the following line:

Code:
mount e batch -t cdrom

Change 'e' to a different drive letter. If you name the folder something different or placed it somewhere other that Home, then adjust that as well. Save the configuration to the default and go back to DOSBox-x.

Every time that you start DOSBox-x, it will auto-load this folder as Drive E. I can then switch to Drive E (e:) and run any batch file or program in this folder.

For example, I could have a file named 'dos.bat' and place the following in the file:

Code:
imgmount c Dosbox/dos622.img -t hdd
boot "Disk1.img" "Disk2.img" "Disk3.img"

This file will load my hard disk and then boot from the DOS floppy images. This all happens by switching to Drive E and the running 'dos.bat'.

Duplicating Images

Now, I have a bootable DOS 6.22 image that I can copy and boot from to install other Operating Systems.

To do this, just go to the folder you specified for the image. Here we used 'Dosbox/dos622.img'. Take the 'dos622.img' file and then copy and paste it back to the same folder. Rename it to 'win98.img'.

Do NOT copy any mounted image or one being used.

You can make as many duplicates as you need. Be aware that the file we created is only a 2 GB file with DOS 6.22 on it.

We can discuss in a bit about how to make bigger partitions.

Larger Partitions

If you want a drive larger than 2 GB, you need to have a different version of an OS to handle the size. So, we need to get something more advanced.

Look for MS DOS 7.1. You can get it here: 'https://winworldpc.com/product/ms-dos/7x'.

Extract it and find the files named 'disk01.img' and 'disk02.img'. These are what you'll need to get this started.

Let's set up DOSBox-x to handle this as well. At the 'Z:\' prompt, type 'ver 7.1'. This will make DOSBox-x report it is running a DOS version of 7.1. You can add this line to the 'Autoexec.bat' file to make it permanent.

Let's create the image now:

Code:
imgmake Dosbox/dos8.img -t hd_8gig

Find the images named 'disk01.img' and 'disk02.img' and copy them the Home folder.

Now, we can start with the following commands:

Code:
ver 7.1
imgmount c Dosbox/dos8.img -t hdd
boot disk01.img disk02.img

MS DOS 7.1 should start and go through quite a few screens to get you to answer questions before it does the install.

At the Welcome screen, click 'Next'.

You should now get a warning about Long File Names (LFN). Just click on 'Next'.

Next is the License Agreement. Click on 'I agree' and then on 'Next'.

DOS 7.1 Setup will ask if you want the partitions checked. Click on ‘Continue’.

The program will prompt you if you want to rewrite the Master Boot Record (MBR), click 'Yes'.

The installation folder will default to 'c:\DOS7.1', just click on 'Next'.

It will then ask if you want to create the folder since it does not exist, so answer 'Yes'.

The system will ask you about the installation type. Leave it as 'Full Install' and uncheck the Add-ons. Click 'Next' to continue.

The next screen asks if you want to install AccessDos, answer 'No'.

Next, you’re shown your choices you have made and you’ll need to verify these are OK or if you want to make changes. Click on ‘OK once the choices are correct.

It should start installing at this point. When it asks for the second disk, press 'F12+O' to switch floppy disks and then press ENTER. When the system is copying files, you can select 'CPU' from the menu and enable 'Turbo' to speed up the process.

After the installation, the program will continue to ask questions to configure the installation more.

You're asked if you want the Logo to appear at boot. Make your selection. ‘No’ is a good choice.

The system asks if you want a startup log file, select 'No'.

Then you're prompted about LFN support, so answer 'Yes'.

Next, you can select the memory type of UMB, UMB and EMS, or none. Make your choice, but it really doesn't matter since we'll be overwriting it.

The next choice is whether to load a CD-ROM driver. Make your choice. None is fine.

On the next screen you'll want to uncheck 'Sharing’, leave DOSLFN checked and the Mouse option. Check the option for Smartdrv before clicking on 'Continue'.

Set your code page and click 'Continue'.

You are now informed that the setup is done. Click on ‘OK’.

When done, click on 'No Reboot'.

Go to the C Drive (c:) and run a directory listing (dir). The total amount of free space whould be 8 GB.

You now have a large partition over the 2 GB allowed.

Restart DOSBox-x from the menu 'Main' and select 'Restart DOSBOX instance.

Windows Millennium Edition (ME)

Now that we have a larger partition, we can install Windows ME. This version of Windows does not need the larger partition size, but it helps for storing more programs that you may want to run on Windows.

So, download Windows ME. Extract the ISO from the 7z file. The extract the ISO to '~/winme'.

You will also need the Windows ME boot disk. Extract the ‘img’ file to Home and rename it ‘bootme.img’.

The following can be manually entered, or even placed in a batch file as directed above:

Code:
ver 7.1
imgmount c Dosbox/dos8.img -t hdd
mount d winme -t cdrom
mount a bootme.img -t floppy
boot a:

NOTE: If you do not boot from the Windows ME Boot Disk, the install will fail.

Once the system boots, the installation of Windows ME should start automatically. Once started, choose ‘Boot from CD-ROM’, then ‘Start computer without CD-ROM support’. When you get to a DOS prompt, type ‘d:’ to switch to the CD-ROM image mounted as Drive D. Then type ‘setup’ and press ENTER to begin. At one point, DOSBox-x will restart. Restart with the settings:

Code:
imgmount Dosbox/dos8.img -t hdd
mount d winme -t cdrom
boot c:

NOTE: Remember to enable 'Turbo' to speed up the install, especially when copying files.

Windows ME should finish the setup and ask you for the key. Keys are on the website where you downloaded the files. If you do not find one, there are lists on the Internet, but you may need to try a few before one will work.

NOTE: After every install, when you are using the same hard drive image, make a copy in case something fails, and the image becomes corrupted.

After mounting the ‘dos8img’ and booting from it, the OS will complete setting up the desktop and system.

Be aware that installing Windows ME is the same process as installing Windows 95 or Windows 98. You do not need the larger partition though. I am only using it to show it can be done. You also do not need the Windows 95 or 98 Boot Disk to run setup. You can just as easily boot from the DOS 6.22 image we created above.

After you complete the installation, stop DOSBox-x and make a backup of the image file for the last time.

Now you have Windows ME, or another version that will support larger partitions to handle more games or apps.

Conclusion

Rather than using WINE or VirtualBox, you can run Windows and install games or apps.

This can be another method to get your Linux system to work with Windows and be better at not having issues with emulators attempting to handle various programs for compatibility.
 

Members online


Latest posts

Top