{"id":14441,"date":"2026-07-27T02:00:00","date_gmt":"2026-07-27T06:00:00","guid":{"rendered":"https:\/\/www.both.org\/?p=14441"},"modified":"2026-07-13T17:04:10","modified_gmt":"2026-07-13T21:04:10","slug":"transfer-files-to-freedos-the-easy-way","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=14441","title":{"rendered":"Transfer files to FreeDOS the easy way"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"14441\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p class=\"wp-block-paragraph\">While I run Linux on my desktop, I like to work in FreeDOS for quite a bit of my time. The QEMU virtual machine on Linux makes this easy. I might boot FreeDOS in QEMU to <a href=\"https:\/\/www.both.org\/?p=14056\">write a program<\/a>, to play a classic DOS game, or to use a favorite DOS app.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To do all of that effectively, I need a way to transfer files <em>to and from<\/em> the FreeDOS virtual machine, from my Linux desktop. Here\u2019s an easy way to do it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sneakernet for the win<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The term <a href=\"https:\/\/en.wikipedia.org\/wiki\/Sneakernet\">sneakernet<\/a> became popular in the 1980s and 1990s, to mean <em>transferring files from one system to another using a floppy disk<\/em>. And in 2026, that\u2019s still a good method to exchange files between a <em>host<\/em> system (my Linux desktop) and a <em>guest<\/em> operating system (FreeDOS in QEMU).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The overview is pretty simple: define a virtual floppy disk, and boot the QEMU virtual machine with it. FreeDOS will \u201csee\u201d this as the <strong>A:<\/strong> drive, to copy files <em>to and from<\/em> the floppy. On Linux, you can access the virtual floppy to a directory and copy files <em>to and from<\/em> the floppy image.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Floppy disks in the 1980s and 1990s came in several common capacities; the most popular (that I used) were 360 kB (5 1\/4\u201d size), 720 kB (3 1\/2\u201d size), and 1.44 MB (also 3 1\/2\u201d size). Let\u2019s set up a 1.44 MB virtual floppy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Create a virtual floppy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You don\u2019t need anything special to create a virtual floppy; you can make one yourself using the <strong>dd<\/strong> command. The Linux <strong>dd<\/strong> command uses <strong>name<\/strong>=<em>value<\/em> pairs for its command line arguments, like <strong>bs<\/strong> for block size, <strong>count<\/strong> for the number of blocks to copy, <strong>if<\/strong> for the input file, and <strong>of<\/strong> for the output file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To create a 1.44 MB virtual floppy image, we need to copy 1440 1-byte blocks from an empty source, and save the output to a new file. The <code>\/dev\/zero<\/code> special device always generates zeroes, so we can use that to create an empty 1.44 MB floppy image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ dd bs=1024 count=1440 if=\/dev\/zero of=floppy.img\n1440+0 records in\n1440+0 records out\n1474560 bytes (1.5 MB, 1.4 MiB) copied, 0.0188383 s, 78.3 MB\/s<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. Format the floppy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you can use the virtual floppy, you need to put a DOS filesystem on it\u2014this process is called \u201cformatting\u201d in a DOS context. The easiest way to format the floppy is to boot a FreeDOS virtual machine, then run the <strong>format<\/strong> command on the <strong>A:<\/strong> drive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, let\u2019s boot QEMU using FreeDOS. In this example, I\u2019ve already downloaded the <a href=\"https:\/\/www.freedos.org\/download\/\">FreeDOS monthly test release<\/a>, which is \u201cT2607\u201d (July 2026) at the time I wrote this. I find it\u2019s easiest to work with the FullUSB FreeDOS image; this is both the installer plus a \u201clive\u201d bootable version of FreeDOS. The FullUSB bootable image is called <code>T2607FULL.img<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ qemu-system-i386 -hda T2607FULL.img -fda floppy.img <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">I\u2019m using the defaults to boot FreeDOS in QEMU, I haven\u2019t provided any special options to define the CPU, memory, keyboard, mouse, video, sound, or any other options. By default, QEMU will emulate a computer system with a VGA display, PS\/2 mouse, and other standard components.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once QEMU has booted and started FreeDOS, I can use the <strong>format<\/strong> command to create a DOS filesystem on the <strong>A:<\/strong> floppy:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\&gt;format A:\n Insert new diskette for drive A:\n Press ENTER when the right disk is in drive...\n Boot sector contents implausible, disk not yet FAT formatted\nUsing drive default: 1440k (Cyl=80 Head=2 Sec=18)\nCannot find existing format - forcing full format\nPlease enter volume label (max. 11 chars): FLOPPY\n Full Formatting (wiping all data)\n100 percent completed.\n Preparing FAT area...\n100 percent completed.\n\nFormat complete.\n\n     1,474,560  bytes total disk space (disk size)\n     1,457,664  bytes available on disk (free clusters)\n\n           512  bytes in each allocation unit.\n         2,847 allocation units on disk.\n\n Volume Serial Number is 096D-1BFD\n\nFormat another floppy (y\/n)? N<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. Use the floppy to transfer files<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After writing a DOS filesystem with <strong>format<\/strong>, FreeDOS can copy file <em>to and from<\/em> the floppy, just like \u201csneakernet\u201d from the 1980s and 1990s. For example, to copy a file called <code>changes.log<\/code> from the <strong>C:<\/strong> drive to the <strong>A:<\/strong> floppy, use the FreeDOS <strong>copy<\/strong> command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>C:\\&gt;copy changes.log A:\nchanges.log =&gt;&gt; A:changes.log<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. Access the floppy from Linux<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Having copied files to the virtual floppy from FreeDOS, now we need to access them from Linux. There are several ways to do this on Linux; the most direct way is to use the <strong>mount<\/strong> command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Normally, the <strong>mount<\/strong> command is reserved for the systems administrator, or <em>root<\/em>, to perform system maintenance. But you can use <strong>mount<\/strong> using the <strong>sudo<\/strong> command, to temporarily run it as the <em>root<\/em> user. However, you need to give <strong>mount<\/strong> two special options:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><em>Use the <code>loop<\/code> option.<\/em> The <strong>mount<\/strong> command normally operates on devices, but in this case, the floppy image is a file. To access a file as though it were a device, you need to tell <strong>mount<\/strong> to use a \u201cloopback\u201d device, with the <code>-o loop<\/code> option.<\/li>\n\n\n\n<li><em>Specify the user ID.<\/em> Without other options, the <strong>mount<\/strong> command will access the filesystem as root, and rely on the filesystem permissions to guide who can (and cannot) write files to it. But DOS filesystems are very simple, and do not provide access by user ID. Instead, you need to indicate the user ID to use for the DOS filesystem, with the <code>-o uid=__<\/code> option.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">You need to know your own user ID; this is usually 1000 for a Linux system with just one user on it. You can verify your user ID using the <strong>id<\/strong> command. This actually prints out a lot of information, but the <code>-u<\/code> option only prints your user ID, which is what we want:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ id -u\n1000<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We can combine these two options to access the floppy from Linux. In this example, let\u2019s also create a new directory called <code>floppy<\/code> where we will access the floppy image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir floppy\n$ sudo mount -o loop,uid=1000 floppy.img floppy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Having mounted the floppy image, you can now access the virtual floppy disk using the <code>floppy<\/code> directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ ls floppy\nCHANGES.LOG<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When you\u2019re done using the virtual floppy on Linux, don\u2019t forget to use <strong>umount<\/strong> to \u201cun-mount\u201d the floppy image:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo umount floppy<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Transferring files made easy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Using the <strong>mount<\/strong> command makes it easy to transfer files <em>to and from<\/em> my FreeDOS virtual machine. The limitation is that I can only transfer small-ish files, such as about 1 MB or smaller. But this fits a lot of use cases, such as copying a source file that I wrote on FreeDOS so I can use it on Linux, or vice versa. Most \u201cshareware\u201d DOS apps and games from the 1980s and 1990s were distributed as zip files, and had to fit in less than 1.44 MB\u2014which makes it easy to use this method to transfer those files so I can run them in my FreeDOS virtual machine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Floppy disks are a common way to transfer files on DOS<\/p>\n","protected":false},"author":33,"featured_media":3293,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[100,340,5],"tags":[104,267,91],"class_list":["post-14441","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-line","category-freedos","category-linux","tag-command-line","tag-freedos","tag-linux"],"modified_by":"Jim Hall","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/14441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14441"}],"version-history":[{"count":1,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/14441\/revisions"}],"predecessor-version":[{"id":14442,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/14441\/revisions\/14442"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/3293"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}