How to install MS-DOS on a CF-card without using a floppy

Oracle VM

This information is based on http://theinstructionlimit.com/installing-ms-dos-6-22-on-a-486-without-a-floppy-drive-using-a-cf-to-ide-adapter and is more of a note to self. Anyway, as a retrocomputer enthusiast I often find myself in the following situation:

!Make sure to run Virtual Box in administrator mode! Also, the syntax is different in Virtual Box 6 and 7. This guide is based on v. 6.x!

I have a compact flash to IDE adapter with a suitable CF-card. However, I do not have a floppy drive on the retrocomputer that I want to install MS DOS to. Furthermore, I also need to install Ontrack Disk Manager to utilize larger partitions on older computers. The proposed solution is to perform the install by using a Virtual Machine.

Preparations:

Now, I follow this procedure to install Ontrack Disk Manager and MS DOS 6.22 on the CF-card.

Step 1: Type:

wmic diskdrive list brief

to identify your cf-card’s DeviceID (it should look something like \.\PHYSICALDRIVE1)

Step 2: Change to the VirtualBox directory (usually c:\Program Files\Oracle\VirtualBox). Type the following to create a raw virtual machine (.vmdk) (replace N in \.\PHYSICALDRIVE1 with DeviceID).

vboxmanage internalcommands createrawvmdk -filename CompactFlashCard.vmdk -rawdisk \\.\PhysicalDriveN

Step 3: Start VirtualBox with administrator rights.

Create a DOS virtual machine (other -> DOS), default settings, except for hard disk, where you choose “Use an existing virtual disk file”, where you assign the CompactFlashCard.vmdk-file that you created earlier.

From here, you can add your Ontrack Disk Manager and MS DOS disk images to the floppy drive of the virtual machine, and install MS DOS. Ontrack Disk Manager usually divides your CF-card to partitions of 2 gb each. If Virtualbox has problems accessing your cf-card, open disk management in Windows 10, and remove any volumes associated with the card.

If you want to add additional files (games, drivers etc) to the cf card using your modern PC, you can just unplug and plugin the cf card in Windows and drag n drop software onto it.

30 Comments

  1. a

    Hi
    I tried your instructions on a Win10 machine. I can crate the vdmk file on the CF card. However, since I deleted all the partitons, I cannot acces the vdmk file from the virtualpc menue (it shows the usb device but does not see a partition and does not let me open it…)

    Reply
    1. Dreamcast (Post author)

      Hi Andreas! The vdmk-file is created on your computer, usually in the c:\Programxxx\Oracle\VirtualBox\ folder.

      Reply
  2. Walter Wold

    C:\Program Files\Oracle\VirtualBox>vboxmanage internalcommands createrawvmdk -filename CompactFlashCard.vmdk -rawdisk \.\PhysicalDrive1
    VBoxManage.exe: error: Cannot open the raw disk ‘\.\PhysicalDrive1’: VERR_FILE_NOT_FOUND
    VBoxManage.exe: error: The raw disk vmdk file was not created

    Reply
    1. Dreamcast (Post author)

      Is your cf-card’s DeviceID PhysicalDrive1 according to Step1?

      Reply
  3. Walter Wold

    Yes that’s correct. I’ve typed in for listing first and changed N value

    Reply
    1. Dreamcast (Post author)

      Did you run the command prompt as administrator? (needed to access physical drives).

      Reply
  4. Walter Wold

    Thanks ! I forgot to use this function. Now I managed to install MsDos 6.22 . To bad my BIOS on my Compaq CDS524 W like CF card tough. Will have to try 2GB instead of 4GB.

    Reply
  5. Walter Wold

    Now everything is sorted out! I reconfigured Bios setup twice, saved and everything works smooth. Two partitions with 2GB each. No notice!

    Reply
  6. Sean H.

    Hello, thank you for this summary. This is what finally got my 486 to boot dos without a floppy. Have you been able to mount the other partitions on your CF card as extra drives through DOS? I’m not sure how this is accomplished.

    Reply
    1. Dreamcast (Post author)

      Hi Sean. Great that you got your 486 up and running through this guide. I have not attempted to create additional partitions via MS-DOS, but I suggest trying Ontrack Disk Manager (see, https://www.philscomputerlab.com/ontrack-disk-manager.html), which can handle most type of partitions.

      Reply
      1. Sean H.

        Thought I would report. I did use OnTrack to partition my drive as part of your steps, however DOS would not see them as logical drives; I didn’t see them at all.

        I have since gone into the BIOS and set the drive as ‘LBA’ mode. Now I have 4 logical drives for that disk, 2GB each.

        Thanks again.

        Reply
  7. Dooser

    This worked brilliantly; thank you! I had previously tried to write existing images to the card, but none of them would boot.
    I used a laptop running Ubuntu in order to install DOS to the CF card. The only thing I had to change was to replace “\.\PHYSICALDRIVEX” with “/dev/sdX”. I also didn’t do any of the Ontrack stuff, since it was a 512MB card.

    Reply
    1. Dreamcast (Post author)

      Hey, great to know that it works under Linux as well!

      Reply
  8. RetroTech Chris

    Wonderful procedure! One thing I would add for people who want to re-mount the card and use it in the VM in a Windows environment: unless you do an exclusive lock on the volume, you won’t be able to write any files to the CF card. If you Google search for “User-mode Raw Disk Access”, you will find a utility call xclusive to circumvent this, and it works great! Now, as the author here noted, if you just want to drag files over, you should be good to go!! Naturally, the lock problem isn’t a problem on first mount since there are no partitions on the card to “lock” (i.e. when you create partitions in the VM for the first time, “you own the lock”). But, ya, on subsequent mounts of the CF card, Windows will lock the partition!!

    Reply
    1. Vincent

      your post saved me! I was going crazy with windows 11 taking over the partition and messing up the process. Once I used the xclusive tool everything went well.

      Thanks!

      Reply
    2. Jason

      I spent at least 6 hours trying to figure out how to write to the card after reinserting it yesterday until I came across this comment. Thanks!

      Reply
  9. Dos Nerd

    Hello,
    I ran into a problem with booting from the compact flash drive itself as even though Dos recognises the c: drive and allows me to run files like Qbasic from it, it wont let me boot from it (furthermore testing it in my gateway solo laptop also confirms this). Entering fdisk shows that the partition is set active and I have formated the drive so I’m mystified to why its not working.

    Reply
    1. Dreamcast (Post author)

      Perhaps a fdisk /mbr will save the day?

      Reply
  10. beyonson

    I can see my disk and cleared partitions, but when I try to create the raw virtual machine I get:

    “Cannot create the raw disk VMDK: VERR_ALREADY_EXISTS”

    I am running as administrator too.

    Reply
    1. Dreamcast (Post author)

      Hello, try using a different filename instead of “CompactFlashCard.vmdk” (e.g. CFCard.vmdk or similar).

      Reply
  11. Curtis Adams

    Well I had it running but now when I try to access the .vmdk file in Virtual box to setup the drive I keep getting an error dialog stating “Permission problem accessing the file”.

    Reply
  12. Curtis Adams

    My own ignorance, I forgot to start VB with Admin rights.

    Reply
  13. Matt

    Does this method work with a USB multi card reader? Getting the following error when running vboxmanage. Physical drive for this is 4 and I deleted the partition in disk manager. Confirmed the card is working fine in windows when I do partition it.

    Running CMD in admin mode, tried running without admin too and it gives me the expected permission error.

    c:\Program Files\Oracle\VirtualBox>vboxmanage internalcommands createrawvmdk -filename CompactFlashCard.vmdk -rawdisk \\.\PhysicalDrive4
    VBoxManage.exe: error: VMDK: Image path: ‘CompactFlashCard.vmdk’. Getting config interface failed
    VBoxManage.exe: error: Error code VERR_INVALID_PARAMETER at F:\tinderbox\win-rel\src\VBox\Storage\VMDK.cpp(4481) in function int __cdecl vmdkRawDescParseConfig(struct VMDKIMAGE *,char **,unsigned int *,unsigned int *,void **,unsigned __int64 *,bool *,char **)
    VBoxManage.exe: error: VMDK: could get raw descriptor for ‘CompactFlashCard.vmdk’
    VBoxManage.exe: error: Error code VERR_INVALID_PARAMETER at F:\tinderbox\win-rel\src\VBox\Storage\VMDK.cpp(5296) in function int __cdecl vmdkCreateImage(struct VMDKIMAGE *,unsigned __int64,unsigned int,const char *,const struct VDGEOMETRY *,const struct VDGEOMETRY *,const union RTUUID *,struct VDINTERFACEPROGRESS *,unsigned int,unsigned int)
    VBoxManage.exe: error: Cannot create the raw disk VMDK: VERR_INVALID_PARAMETER
    VBoxManage.exe: error: The raw disk vmdk file was not created

    Reply
    1. Dreamcast (Post author)

      This thread: https://www.reddit.com/r/virtualbox/comments/y3snld/help_with_creating_vmdk_file_for_raw_drive_access/ suggests that the syntax has changed a bit between VirtualBox 6 and 7. Try downgrading to e.g., 6.0.24 (https://download.virtualbox.org/virtualbox/6.0.24/) and see if it helps.

      Reply
  14. Dawid Oszkiewicz

    I can confirm that this doesn’t work in Virtualbox 7. In 6.1 I was able to create raw drive but VM refuse to start the machine. Using admin rights of course.

    Reply
  15. Dawid Oszkiewicz

    OK, my bad. Wrong file.VM 6.1 works fine with freshly created raw disk.

    Reply
  16. Richard Troupe

    Hey!

    Thanks for the excellent guide! All went really well and I got DOS 6.22 plus Windows 3.1 installed in a 4GB Transcend CF card (with 2 x 2GB Partitions). However, when I insert the CF card into my Toshiba 486 laptop via CF-IDE adaptor, the laptop won’t boot off it and just hangs on a black screen.

    Is there any obvious thing that I’m missing at all? I’ve been sure to match the VirtualBox specifications to my laptop as close as possible.

    Thanks!

    Reply
    1. Dreamcast (Post author)

      Thank you! Did you try the CF-adapter / card in another computer? Is the CF-card visible in the bios settings of the Toshiba?

      Reply
  17. Peter

    I found an odd quirk with this – Everything did work but when I swapped disks for the MSDOS installer, if I had to go through the ‘Choose a disk file’ dialog to browse for the .img, windows would re-mount the cf card and when returning to virtualbox the install would fail as the card had been preempted by windows. If the disk image was on the ‘recent’ disks list, I could swap between disks and the installer would continue. Very frustrating.

    Reply
    1. aj

      I ran into the same thing (in windows 10) — I disabled disk automounting in diskpart with the “automount disable” command

      Reply

Leave a Comment

Your email address will not be published. Required fields are marked *