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:
- Download MS DOS from https://archive.org/details/002962-MsDos62
- Download Ontrack Disk Manager from https://www.philscomputerlab.com/ontrack-disk-manager.html
- Install Virtual Box on modern Windows PC https://www.virtualbox.org/
- Connect CF card to modern Windows PC
- Remove all partitions from the CF card in Windows Disk Management
- Open a command prompt as administrator
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.
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…)
Hi Andreas! The vdmk-file is created on your computer, usually in the c:\Programxxx\Oracle\VirtualBox\ folder.
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
Is your cf-card’s DeviceID PhysicalDrive1 according to Step1?
Yes that’s correct. I’ve typed in for listing first and changed N value
Did you run the command prompt as administrator? (needed to access physical drives).
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.
Now everything is sorted out! I reconfigured Bios setup twice, saved and everything works smooth. Two partitions with 2GB each. No notice!
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.
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.
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.
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.
Hey, great to know that it works under Linux as well!
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!!
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!
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!
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.
Perhaps a fdisk /mbr will save the day?
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.
Hello, try using a different filename instead of “CompactFlashCard.vmdk” (e.g. CFCard.vmdk or similar).
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”.
My own ignorance, I forgot to start VB with Admin rights.
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
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.
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.
OK, my bad. Wrong file.VM 6.1 works fine with freshly created raw disk.
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!
Thank you! Did you try the CF-adapter / card in another computer? Is the CF-card visible in the bios settings of the Toshiba?
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.
I ran into the same thing (in windows 10) — I disabled disk automounting in diskpart with the “automount disable” command
I’m trying to do this from VBox 7 in Win 10 ver 22H2, but VBox 7 says “createrawvmdk” is deprecated. I tried downgrading to VBox 6, but now Windows complains it cannot access the CF card which is locked. How do I unlock the card? Or should I use Windows 7 and old VBox on my non-networked H-P Pavilion (no floppy)?
According to this thread: https://forums.virtualbox.org/viewtopic.php?t=108383 you can use the createmedium command instead of createrawvmdk. Also, make sure to run things as administrator when working in Windows 10. Good luck!
Hi. I’ve been tryingto make a .img file from VirtualBox 7 and the 6.1 downgrade and found the following command sequence worked for me. I made sure to keep my VMs in C:\Program Files\Oracle\Virtualbox. I thought this might make things a little easier.
The “vboxmanage clonehd” command has been replaced by “vboxmanage clonemedium” and it seems you need to be more specific in using the swithes.
However, after I issued the following Windows 10 terminal command I got my DOS622.img file in the right path.
C:\Program Files\Oracle\VirtualBox>vboxmanage clonemedium disk “c:\program files\oracle\virtualbox\virtualmachines\dos622\dos622.vdi” –format vdi “C:\program files\oracle\virtualbox\virtualmachines\dos622\dos622.img” –format raw
0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%
Clone medium created in format ‘raw’. UUID: 431f6767-d1d0-44b7-8307-ee9cbfa21d44
I hope this helps.
I can not start the VM? it gives an error. Failed to get device handle and/or partition ID for 00000000014f2910 (hPartitionDevice=0000000000000d59, Last=0xc0000002/1) (VERR_NEM_VM_CREATE_FAILED). A little more detail may help.
Hello Jeffrey. Check out this thread where a similar issue is discussed: https://forums.virtualbox.org/viewtopic.php?f=6&t=101232