Creating a MS-DOS Virtual PC under Virtualbox


Whilst WINE is a great Linux API for Microsoft OS based applications. However, it is not quite the same as running the real thing if you need 100% compatibility. Even under Windows 7, support for older programs based on MS-DOS is rather limited requiring the use of programs like DOSBOX or using XP Compatibility Mode.

I tend not to throw out formerly useful software, you never know when it may become useful again! Therefore, I still have software from my MS-DOS days, including genuine MS-DOS 6.21 boot disks as well as a complete set of Softlanding Linux System "Linux SLS Distribution v0.99p9" http://tinyurl.com/5cgrx dating from late 1992. SLS eventually became Slackware and the rest is Linux history!

This tutorial will explain how to create a bootable MS-DOS 6 based VirtualBox VM with CD-ROM support.

For those of you who are not lucky enough to have original MS-DOS disks, I plan to do a further article but this time using FreeDOS, an 100% compatible open source MS-DOS 6.22 replacement (with bells!).

Turning your Floppy Disks into .img files

Note: Your PC will need a floppy disk drive!

Because VirtualBox does not work with physical floppy disks (at least as far as I can tell) but with disk images, the first thing you need to do is turn the physical MS-DOS disks into disk images.

Luckily, in Linux this is really easy:

Open Terminal

Navigate to where you want the images saved, which is normally the hidden .VirtualBox directory in your home folder.

Insert the first floppy MS-DOS disk in the drive and enter in Terminal:

Kdesudo cat /dev/fd0 > imagefilename.img

Example: sudo cat /dev/fd0 > MSDOS6.21-1.img

Repeat for all the remaining two MS-DOS disks, remember to give each file name a slightly different name to identify it!

Creating your VirtualBox VM

Launch VirtualBox and click New, then click Next.

Change Operating System to Other, this defaults the version to DOS.

Give the VM a name e.g. MS-DOS 6.21

Click Next

As this VM will only run MS-DOS applications, I’m going to leave the amount of RAM at the default size of 32Mb. This can be changed later.

Click Next

We are now going to create a new virtual hard disk and make it bootable, so the default settings are okay.

Click Next

The New Virtual Disk Wizard will be displayed.

Click Next

Again accept the defaults.

Click Next

For Virtual Disk Location and Size, 512Mb should be more than enough so accept the defaults.

Click Next

You are now given a summary of your Virtual Hard Disk settings.

Click Finish

You are now given the Summary information for the VM you have just configured.

Click Finish

Making floppy disk .img files available to VirtualBox and your VM

From the VirtualBox menu bar, select File > Virtual Media Manager

Click the Floppy Images tab.

Click Add and select the images you wish to add. Then click Open.

If done correctly, your Floppy Images folder should look similar to the above.

Clock OK.

We are now going to configure our MS-DOS VM for Floppy Disks, so with the VM selected from the main window, select Settings from the toolbar.

Select the Storage menu down the left hand side of the window and then select Add Controller > Add Floppy Controller from the icon at the bottom of the controller window.

To the right of the Floppy Controller, click the icon Add Floppy Device. An ‘Empty’ floppy drive will be added.

We now need to insert our first MS-DOS floppy disk so when we boot the VM, it will boot off the disk and start the install.

With the floppy drive selected, the far right window pane will change.

To the right of the label Floppy Device, click on the drop-down currently showing as Empty and select the first MS-DOS disk image listed.

Click OK, you will be returned to the main VirtualBox menu.

Installing MS-DOS in your VM

With the MS-DOS VM selected, click Start from the toolbar.

Your VM should boot and load the MS-DOS installation program like in the screen-shot below

Follow the on screen instructions to install MS-DOS.

As this is a new Virtual hard disk you will be asked to configure unformatted disk space. Select this option.

You will be asked to mount the first floppy disk. This is already mounted so press Enter.

One of two things may now happen:

a. Your disk formats successfully and MS-DOS starts to install itself.

or

b. The disk formatting remains at 0%. If this should happen, go to the VM menu bar and select Machine > Reset.

When the Starting MS-DOS…. message appears on the screen press F8. You will be prompted as in the screen-shot below.

Reply N to Process AUTOEXEC.BAT, and the command prompt will appear as above. We are now going to manually format the C: drive. Enter the command format c:.

Once the drive has been formatted, enter the command setup, the installation process will now continue.

After a short while (remember floppy disks normally held 1.44Mb!) you will be asked to insert the next floppy disk.

At the bottom of the VirtualBox VM window, right click on the floppy disk icon and select the second MS-DOS installation disk image.

Then continue with the installation by pressing Enter.

Once the installation has been completed, you will be asked to remove all floppies from the floppy drive and then reboot the VM. As before right click on the Floppy icon and this time un-tick the currently mounted floppy disk.

Now press Enter to reboot.

When the VM first reboots, it does not correctly display the command prompt.

To resolve go to the VM menu bar and select Machine > Reset. The VM will reboot and the command prompt will be correctly displayed.

Managing Performance!

MS-DOS is not a demanding OS, however running in a VM can cause problems for the host computer. To avoid the CPU on the host being fully loaded, we will use a program called DOSIDLE, this is a TSR (Terminate and Stay Resident) program. I’ve included DOSIDLE on the floppy disk image file called cdrom.img which can be downloaded from here.

Just download this file from the link above, add it to your .VirtualBox where you MS-DOS image disks reside, and then add to VirtualBox in the same way.

Mount your cdrom.img disk into the VirtualBox floppy drive. Now type a: to change to the ‘a’ drive, followed by dir to display the contents. If all goes to plan you should see the following

Copy the contents of the drive ‘a’ to a folder called CDROM on c: by entering

mkdir c:\cdrom

xcopy *.* c:\cdrom /s

copy c:\cdrom\dosidle\dosidle.exe c:\

Dismount the virtual floppy disk.

Now edit config.sys by entering edit c:\config.sys

and change the contents so they look like the following

Save the file and now edit autoexec.bat by entering edit c:\autoexec.bat.

and change the contents so they look like the following

Save the file and reboot the VM.

On reboot you should get the following displayed

Your MS-DOS VM will now only consume the CPU it needs.

Adding Support for CD-ROMs

By default MS-DOS does not come with CD-ROM support. However, this can be easily changed.

In the cdrom directory (which contains the contents of the cdrom.img file copied earlier) is a device driver for the CD ROM drive for VirtualBox. Copy this to the root of C: by entering

copy c:\cdrom\oakcdrom.sys c:\

Now edit config.sys so that it looks like the following screen-shot

Save the file and now edit autoexec.bat so that it looks like the following screen-shot

Here we have added the 3rd line from the bottom, the /L:D tells DOS to assign the drive letter D: to the CD ROM drive.

Save the file and reboot the VM.

On reboot you should get the following displayed

The 4th line down tells you that the MSCDEX has been loaded and the line below that tells you that the CD-ROM drive has been successfully assigned the letter D.

I would have liked to have added network support to MS-DOS using Microsoft Lanman so files could be shared between the guest VM and the host. However, whilst driver support exists for the network cards used in VirtualBox it has turned out to be far too complicated to set-up in VirtualBox. FreeDOS unlike MS-DOS offers network support as standard and I’ll endeavour to build a VirtualBox image with this version of DOS at a later date.

In the meantime, those of you desperate to use MS-DOS with networking should consider using VMWare as this provides better network card support for MS-DOS and there are a number of articles available on the internet on how to configure.

=-=-=-=-=
Powered by Blogilo

20 thoughts on “Creating a MS-DOS Virtual PC under Virtualbox

  1. Good – thanks ! Finally someone that got me past the problem that msdos in virtualbox can’t access the shared folders. I was able to at least mount a folds are a ISO CD rom using what you presented. Thanks !!!!

  2. Thanx a lot for this tutorial !
    Even though I was able to install Dos 7.1 (CD), I couldn’t pass the floppy thing with this version… now I’m using it to run Win 3.11 on top of it:-)

  3. Hello:

    everything went smoothly (once I removed the UK things) but the capability I am desperate to use is a USB FlashDrive. Anychances of a continuation of the tutorial adding the capability of adding a USB drive?

    Thanks in advance.

    Sparky

    1. After a bit of research, it is possible to use a USB in MS-DOS!

      Follow the instructions in http://www.theinquirer.net/inquirer/news/1046069/yes-usb-drivers-dos

      Unless you can read Japanese (I don’t) the link to the Panasonic DOS drivers is not much use. However, this has been uploaded to http://rayer.ic.cz/download/usbexfat.zip by RayeR at http://www.bttr-software.de/forum/board_entry.php?id=9208

      I would have tested this myself, but at present I don’t have the time. Hence the absence of recent blog posts. However, I would be interested on hearing how you got on.

      Good luck!

      Mark

      1. could not get the pany usb drivers to reliably work. even if it did detect the usb (a rare event) it would crash when trying to mount. perhaps if you have a pany drive it will work better

  4. my virtualbox running on puppy linux does not have floppy support. There’s no add button on the floppy tab, in the virtual media manager. And when you first-boot a new vm, when you pick boot media, it does not recognize img files, only CD’s. Is there a virtualbox extension for this, or some other way to add floppy support? thanks!

  5. hi!,I love your writing very a lot! share we be in contact extra about your article on AOL?
    I require a specialist in this area to resolve my problem.
    May be that’s you! Looking forward to see you.

  6. Thanks for a great article. By no means did I under it all! The VM seems to be exactly what I need, for three dos based programs. The big question is, will the VM run a CalComp DrawingBoard III digitizing board.

    1. if the board uses a serial port then yes, but if it uses USB then this is post MS-DOS so unless you have some software which will read a usb attached device and possibly provide usb dos drivers then no.

      you could look to using another version of dos like freedos or dump the virtualbox approach and use dosbox which does support usb devices

  7. Regarding network support… I’ve made some progress and hope someone here can advance me just a tad further…

    the 82540EM DOS/NDIS driver is available on Intel’s website. The correct driver is in the PRO1000\DOS subfolder, but it doesn’t include the .NIF file and isn’t in the MSLANMAN format. I got ahold of a file called 100ALM.EXE and extracted it, and duplicated the directory structure using the files from the PRO1000 folder. I also changed “e100” to “e1000” everywhere relevant.

    Using this folder during the MS LAN Manager install, it took the driver ok. When it reboots, it grabs an IP and acts as though it’s going to work… actually, it DOES work. I can PING my server… it just insists my password is wrong!

  8. Hi,
    I hope it’s not too obvious, but I simply cannot seem to get anywhere with Virtualbox in trying to create a VM for Windows 98, using my original (bootable) CD. The links to a download of FreeDOS are no use – they are for non PC users. I am using Windows 7 (it came pre-installed), and I need to run old Windows 98 (or earlier) stuff, with absolutely minimal effort. Compatibility mode simply does NOT work at all. The VM says It cannot boot from the CD, yet I had no such trouble creating a Windows Xp virtual machine. Please be clear in your instructions, my DOS days are about a million years ago!

    Andy

    1. Windows 98 or 95 for that matter do not run on top of DOS in the same way as Windows 3.x did.

      Windows 98 installs ms-dos as part of its install. Full install instructions can be found on microsofts website http://support.microsoft.com/kb/221829

      I’m unsure what CD you have but you will need the boot floppy disks or floppy disk images (to mount) if you do not have a physical floppy disk drive. These can be downloaded from http://www.bootdisk.com/bootdisk.htm.

      I hope this helps

  9. Thanks, I realised later that a boot floppy image was required, and downloaded one from http://www.bootdisk.com, so I now have a working Windows 98 VM, though I have not yet got around to replacing the default display driver with a better one, so it’s limited to 640×480.

  10. If you are still intrested, I just made a MS-DOS 6.22 VirtualBox with network capabilities (i.e. I can telnet and ping outside, get the ip from my dhcp and so on), but I decided to left MS Client 3.0 out due to memory problems (I got it working and could see the servers but could not access them and gave up) and went to Packet Drive and mTCP instead. Thank you for all the info, especially the dosidle and cdrom driver!

Leave a comment